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 Aug 9, 2026
This was referenced Aug 16, 2026
5 tasks
This was referenced Aug 24, 2026
PurHur
added a commit
that referenced
this pull request
Aug 26, 2026
…5151) (#35154) TITLE/TITLE_SIMPLE still required a compile-time encoding literal while UPPER/LOWER already accepted runtime strings via JitMbCase. Wire assertEncodingArgv (Argument #3) like the #34858 peer wave. Co-authored-by: PurHur <PurHur@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
4 tasks
3 tasks
PurHur
added a commit
that referenced
this pull request
Aug 26, 2026
…#35157) Encoding still required a compile-time literal while peers (mb_strwidth / mb_convert_case TITLE) already accept runtime strings. Wire assertEncodingArgv (Argument #3) like the #34884 peer wave. Co-authored-by: PurHur <PurHur@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 26, 2026
PurHur
added a commit
that referenced
this pull request
Aug 29, 2026
…). (#35712) JitMbStrcut missed isNullConstant on argument #3, so mb_strcut($s, -N, null) hit JitStrictIntArg and threw TypeError while peer JitMbSubstr already mapped null to the -1 omit-length sentinel. Add repro + MbNegativeOffsetNullLengthAotTest. 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.