Stdlib: ceil, floor, intval and expanded PHPT specs#3
Merged
Conversation
Register double ceil(double) and floor(double) in standard module jitInit when not already present. VM paths mirror PHP for int/float operands; intval truncates floats toward zero per (int) cast semantics. Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Add compliance cases for ceil, floor, intval, str_repeat edge cases, and negative intdiv. Extend real-world digest to chain ceil/floor through intval. Co-authored-by: PurHur <PurHur@users.noreply.github.com>
This was referenced May 19, 2026
PurHur
added a commit
that referenced
this pull request
May 23, 2026
Wire array/filesystem/scope/numeric call() paths through Internal::jitString(), JitLongArg, and jitBool; expand SelfHostBuiltinPolicy bundle categories; add AOT lint fixtures for stdlib array ops and filesystem probes. Co-authored-by: PurHur <PurHur@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced May 25, 2026
This was referenced Jun 1, 2026
This was referenced Jun 16, 2026
3 tasks
This was referenced Jun 30, 2026
Merged
PurHur
added a commit
that referenced
this pull request
Jul 5, 2026
…16327) compileCallArgSends emitted null-literal ARG_SEND before nameSlot was registered, so fgetcsv($fp, separator: null) bound null to argument #2 ($length) instead of #3 ($separator). Resolve callArgNameSlot up front for all fast-path sends; add delimiter→separator alias for php-src 8.2. Co-authored-by: PurHur <PurHur@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 5, 2026
PurHur
added a commit
that referenced
this pull request
Jul 10, 2026
…15475, #17736) (#17741) Prevent forcedSiblingSlot from overwriting a resolved trailing FirstClassCallable callback slot so array_udiff(array_keys(), array_keys(), strcmp(...)) wires arg #3 correctly. Add compliance guard for Generator::next() on closed generators. Co-authored-by: PurHur <PurHur@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 12, 2026
Stdlib: preg_filter() — enum case subject must TypeError (ext/pcre/php_pcre.c, php-src-strict)
#9026
Closed
PurHur
added a commit
that referenced
this pull request
Jul 13, 2026
… (#18661) Wire unpack('i', pack(...), E::A) so the nested pack EXEC_RETURN feeds argument #2 and the hoisted enum feeds argument #3, matching Zend's TypeError on the offset operand instead of misreporting argument #2. Co-authored-by: PurHur <PurHur@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
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
This change extends the compiler’s standard library surface and test coverage.
Implementations
ceilandfloor: VM execution mirrors PHP for integer and float operands. JIT lowers tolibm-styledouble fn(double)declarations registered fromext\standard\Module::jitInit()when missing, with integer arguments promoted viasiToFp.intval: Subset behaviour for integer and float only—integers pass through; floats truncate toward zero, matching an(int)cast.Specs
ceil,floor,intval,str_repeatwith multiplier zero, and negative-operandintdiv.test/real/cases/stdlib_digest.phptupdated to exerciseceil/floorchained throughintval.Notes
intvalintentionally does not accept strings in this build (throws like other narrow builtins).ceil/floorrely on linking against the platform math library for the declared symbols.