{"id":15296478,"url":"https://github.com/xp-lang/php-is-operator","last_synced_at":"2026-02-01T05:31:41.344Z","repository":{"id":57084841,"uuid":"207374179","full_name":"xp-lang/php-is-operator","owner":"xp-lang","description":"Is operator for PHP","archived":false,"fork":false,"pushed_at":"2025-12-22T08:01:46.000Z","size":67,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-23T05:39:46.221Z","etag":null,"topics":["compiler-plugin","is-operator","php7","php8","xp-compiler","xp-framework"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xp-lang.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-09-09T18:12:25.000Z","updated_at":"2025-12-20T10:35:31.000Z","dependencies_parsed_at":"2024-09-30T18:10:51.139Z","dependency_job_id":"9c57a21d-2f69-4dec-aa3e-7abb3221471a","html_url":"https://github.com/xp-lang/php-is-operator","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"3b350a9128cbf8056cfaa7d88663292816edfefa"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/xp-lang/php-is-operator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fphp-is-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fphp-is-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fphp-is-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fphp-is-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xp-lang","download_url":"https://codeload.github.com/xp-lang/php-is-operator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fphp-is-operator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28969998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T04:44:20.970Z","status":"ssl_error","status_checked_at":"2026-02-01T04:44:19.994Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler-plugin","is-operator","php7","php8","xp-compiler","xp-framework"],"created_at":"2024-09-30T18:10:42.843Z","updated_at":"2026-02-01T05:31:41.329Z","avatar_url":"https://github.com/xp-lang.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Is operator for PHP\n===================\n\n[![Build status on GitHub](https://github.com/xp-lang/php-is-operator/workflows/Tests/badge.svg)](https://github.com/xp-lang/php-is-operator/actions)\n[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)\n[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)\n[![Requires PHP 7.4+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_4plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/xp-lang/php-is-operator/version.svg)](https://packagist.org/packages/xp-lang/php-is-operator)\n\nPlugin for the [XP Compiler](https://github.com/xp-framework/compiler/) which adds an `is` operator to the PHP language.\n\nBefore\n------\nA mix of functions, syntax and XP core functionality `is()`:\n\n```php\nis_string($value)                                  // for primitives, use is_[T]()\nis_callable($value)                                // for pseudo types callable, array, object\nis_array($value) || $value instanceof \\Traversable // no is_iterable in PHP 5 and 7.0 \n$value instanceof Date                             // for value types\nnull === $value || is_int($value)                  // nullable types cannot be tested directly\nis('[:string]', $value)                            // for types beyond PHP type system\nis('string|util.URI', $value)                      // for types beyond PHP type system\n```\n\nAfter\n-----\nAnything that works as a parameter, property or return type can be used with the `is` operator.\n\n```php\n$value is string\n$value is callable\n$value is iterable\n$value is Date\n$value is ?int\n$value is array\u003cstring, string\u003e\n$value is string|URI\n```\n\nInstallation\n------------\nAfter installing the XP Compiler into your project, also include this plugin.\n\n```bash\n$ composer require xp-framework/compiler\n# ...\n\n$ composer require xp-lang/php-is-operator\n# ...\n```\n\nNo further action is required.\n\nSee also\n--------\n* https://wiki.php.net/rfc/pattern-matching\n* https://docs.hhvm.com/hack/expressions-and-operators/is\n* https://kotlinlang.org/docs/reference/typecasts.html\n* https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/is\n* https://externals.io/message/120655 (Proposal to introduce is operator)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-lang%2Fphp-is-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxp-lang%2Fphp-is-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-lang%2Fphp-is-operator/lists"}