Repository navigation
Bug sweep 2: (array) of interface-typed values, array_replace, dynamic new, reflection (#244 #253–#256 #258 #295 #409) - #470
Merged
Conversation
…classed operands; type array_replace's accumulator as mixed (array) of a value typed by an interface, an abstract class or a class with subclasses read a layout that static type does not name (garbage / SIGSEGV). It now takes the same class_id walk an erased receiver does. array_replace's first copy loop narrowed its accumulator to the first array's element type, so values from a later cell-typed array were unboxed as int. Fixes #255 Fixes #256 Fixes #258
…on, constant attributes, Exception reflection A `new $cls`, `class_exists($n)` or `new ReflectionClass($n)` with a computed name now pulls the demand-gated built-in families (array/SPL, DateTime) into the program; literal names in those lookups count as mentions. A raw scalar element of a spread pack bound to a scalar parameter of another kind is coerced instead of reaching the callee as a bare word. Class-constant attributes get their own rmeta table (v6) read by ReflectionClassConstant::getAttributes(). Exception and Error declare php's property set in php's order and hide the trace storage from reflection. Fixes #253 Fixes #254 Fixes #244 Fixes #295 Fixes #409
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.
What
(array)of a value typed by an interface (Throwable or a user interface) answers a garbage array or crashes. #255(array)of a value typed by an interface / non-final class now walks the runtime class_id instead of assuming the static class's layout (also fixes subclass properties missing from(array)of a parent-typed value).(array)$objectresult from anobject-typed function throws a TypeError. #256 array_replace() of an int-valued literal and an(array)$objectthrows "Argument must be of type int, string given". #258array_replaceaccumulator was typed from the first array's element type; nowarray<array-key, mixed>like its recursive siblings.new $cls,class_exists($x),new ReflectionClass($x)) are now linked (SPL, array and DateTime families); Exception/Error declare php's property order with a private$string.ReflectionClassConstant::getAttributes()returns real attributes (rmeta v6: per-class constant row table,RMETA_SIZE136).Not done
#467:
(array)$exceptionstill has a different key set than php (needs a prelude Exception visibility/layout change).Risk / gates owed
new $varor computed-nameclass_exists/ReflectionClassnow link the SPL/array/DateTime preludes: binary size and compile time grow (symfony-style apps). Fallback: gate on the names that matter.-kgroups green on each half before the merge.docs/builtins.md/docs/design/memory-abi.md(RMETA_SIZE = 104) are stale.