Stdlib: floatval, boolval, gettype(null) and expanded PHPT specs - #5
Merged
Conversation
Add floatval and boolval builtins with VM and JIT paths for supported scalar types. Extend gettype and is_* JIT handling for null and boolean operands. Add compliance and integration PHPT coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced May 25, 2026
PurHur
added a commit
that referenced
this pull request
May 31, 2026
apply_php_cfg_enum_overlay copies the flags-bearing Enum_.php overlay then may return early without updating Parser.php, leaving vendor in a state where Op\Stmt\Enum_ expects int $flags but parseStmt_Enum passes attributes as argument #5. Add php_cfg_sync_enum_flags_parser() and invoke it from enum overlay paths and the early chain. Co-authored-by: Cursor <cursoragent@cursor.com>
4 tasks
PurHur
added a commit
that referenced
this pull request
May 31, 2026
apply_php_cfg_enum_overlay copies the flags-bearing Enum_.php overlay then may return early without updating Parser.php, leaving vendor in a state where Op\Stmt\Enum_ expects int $flags but parseStmt_Enum passes attributes as argument #5. Add php_cfg_sync_enum_flags_parser() and invoke it from enum overlay paths and the early chain. Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur
added a commit
that referenced
this pull request
May 31, 2026
* Language: BackedEnum::from() and tryFrom() VM lowering (#3114) Implement zend_enum_from_case-style lookup for backed enums, enum case values with name/value properties, and clear callArgEntries after internal handlers so chained static calls receive the correct arguments. Co-authored-by: Cursor <cursoragent@cursor.com> * test #3114: expect VM uncaught Exception for invalid BackedEnum::from() Internal handlers route ValueError through executeInternalHandler → raiseUncaughtException (Exception), matching other runtime builtins until native ValueError propagation lands (#195). Co-authored-by: Cursor <cursoragent@cursor.com> * test #3114: int-backed BackedEnum::from()/tryFrom() compliance PHPT Guards int backing type lookup alongside existing string enum_from/try_from cases. php-src: Zend/zend_enum.c zend_enum_from_case(). Co-authored-by: Cursor <cursoragent@cursor.com> * Language: Zend-parity ValueError message for BackedEnum::from() (#3114) Match php-src zend_enum.c message format (enum name unquoted) and add enum_from_invalid.phpt plus caught ValueError unit coverage. php-src: Zend/zend_enum.c — zend_enum_from_case() Co-authored-by: Cursor <cursoragent@cursor.com> * Language: BackedEnum from/tryFrom backing-value coercion (#3114) Normalize int-backed numeric strings and scalar coercions before case lookup so Level::from('1') matches Zend; reject non-numeric strings with TypeError. Adds unit coverage for int string acceptance and bad input. Co-authored-by: Cursor <cursoragent@cursor.com> * docs #3114: note BackedEnum::from/tryFrom VM parity in capability matrix Co-authored-by: Cursor <cursoragent@cursor.com> * Fix enum parser flags when apply-patches exits early (#3114) Run enum overlay chain before typed-class-const so Op\Stmt\Enum_ receives int $flags before attributes. Tighten abstract-patch skip detection and guard with ApplyPatchesTest. Co-authored-by: Cursor <cursoragent@cursor.com> * Fix apply-patches enum early chain when parser path omitted (#3114) apply_php_cfg_enum_class_method_parser_fix() is invoked without an argument from apply_php_cfg_enum_early_chain(); default to vendor Parser.php like sibling helpers to avoid set -u unbound $1 abort. Co-authored-by: Cursor <cursoragent@cursor.com> * Self-host: sync Enum_.php flags ctor with parseStmt_Enum (#3114) apply_php_cfg_enum_overlay copies the flags-bearing Enum_.php overlay then may return early without updating Parser.php, leaving vendor in a state where Op\Stmt\Enum_ expects int $flags but parseStmt_Enum passes attributes as argument #5. Add php_cfg_sync_enum_flags_parser() and invoke it from enum overlay paths and the early chain. Co-authored-by: Cursor <cursoragent@cursor.com> * Language: uncaught ValueError/TypeError preserve native type (#3114) Map materialized VM Throwable objects to native PHP exceptions in raiseUncaughtException so BackedEnum::from() invalid values throw ValueError (not generic Exception) per Zend parity. php-src: Zend/zend_enum.c — zend_enum_from_case() Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: PurHur <PurHur@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
4 tasks
This was referenced Jun 30, 2026
3 tasks
3 tasks
4 tasks
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
floatval()andboolval()builtins with VM and JIT implementations for supported scalar types (int/float for floatval; null, int, float, bool, string for boolval).gettype()JIT path fornulland improveis_*JIT handling for boolean and null operands.floatval,boolval,gettype_null) plus integration tests (stdlib_casts, extendedstdlib_digest).Test plan
make test(VM + JIT via CircleCI)Made with Cursor