You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added support for variadic functions/methods using the ... operator (e.g. function f(int first, ...rest)) #2025
Compiler now recognizes the parser-emitted yield AST node (bare yield;, yield expr;, yield key, value;) #1849
Added PHPBench-based runtime benchmarks suites under tests/Benchmark/#2541
Changed
for k, v in expr now skips the unreachable branch when the iterand's dynamic type is known #1878
Fixed
Fixed dynamic init new {className}() ignoring constructor visibility, allowing classes with a protected/private constructor to be instantiated from any scope #882
Fixed unset(obj->{variable}) (dynamic property name) and unset(obj->{"literal"}) (string-literal brace syntax) throwing CompilerException: Cannot use expression type: property-dynamic-access in "unset". UnsetStatement now handles property-dynamic-access and property-string-access nodes, emitting the new zephir_unset_property_zval() kernel helper for variable keys #808
Fixed continue inside for ... in loops over PHP Iterator/Traversable objects producing an infinite loop #2546
Fixed elseif conditions that contain sub-expressions with side effects (such as array element access myvar[0]) being evaluated unconditionally before the outer if, causing spurious "Cannot use a scalar value as an array" notices when a preceding branch had already returned #1097
Fixed cross-class chained <static> (and <self>/<parent>) return-type resolution. The same-class case landed in Fixing static/self init treated as a literal #2537 by substituting the lexical class for the reserved keyword. The cross-class case — other->returnsStatic()->method() where other is a local variable typed as a different class — was still resolved against the call site's lexical class, so the chained method lookup ran on the wrong definition and the build aborted with Class '<EnclosingClass>' does not implement method: '<method>'. MethodCall.php already resolves the receiver's $classDefinition earlier in the function (from $variableVariable->getClassTypes()); the substitution now uses that definition, which is identical to $compilationContext->classDefinition for the this branch and preserves existing behavior there. #2505
Documentation
Documented the workaround for [ClassName, "protectedOrPrivateMethod"] arrays passed as callbacks to PHP higher-order functions (array_reduce, usort, preg_replace_callback, etc.) #2167
This discussion was created from the release 0.22.0.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Added
...operator (e.g.function f(int first, ...rest)) #2025yieldAST node (bareyield;,yield expr;,yield key, value;) #1849tests/Benchmark/#2541Changed
for k, v in exprnow skips the unreachable branch when the iterand's dynamic type is known #1878Fixed
new {className}()ignoring constructor visibility, allowing classes with aprotected/privateconstructor to be instantiated from any scope #882unset(obj->{variable})(dynamic property name) andunset(obj->{"literal"})(string-literal brace syntax) throwingCompilerException: Cannot use expression type: property-dynamic-access in "unset".UnsetStatementnow handlesproperty-dynamic-accessandproperty-string-accessnodes, emitting the newzephir_unset_property_zval()kernel helper for variable keys #808continueinsidefor ... inloops over PHPIterator/Traversableobjects producing an infinite loop #2546elseifconditions that contain sub-expressions with side effects (such as array element accessmyvar[0]) being evaluated unconditionally before the outerif, causing spurious "Cannot use a scalar value as an array" notices when a preceding branch had already returned #1097<static>(and<self>/<parent>) return-type resolution. The same-class case landed in Fixing static/self init treated as a literal #2537 by substituting the lexical class for the reserved keyword. The cross-class case —other->returnsStatic()->method()whereotheris a local variable typed as a different class — was still resolved against the call site's lexical class, so the chained method lookup ran on the wrong definition and the build aborted withClass '<EnclosingClass>' does not implement method: '<method>'.MethodCall.phpalready resolves the receiver's$classDefinitionearlier in the function (from$variableVariable->getClassTypes()); the substitution now uses that definition, which is identical to$compilationContext->classDefinitionfor thethisbranch and preserves existing behavior there. #2505Documentation
[ClassName, "protectedOrPrivateMethod"]arrays passed as callbacks to PHP higher-order functions (array_reduce,usort,preg_replace_callback, etc.) #2167This discussion was created from the release 0.22.0.
Beta Was this translation helpful? Give feedback.
All reactions