| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| zephir.phar | < 10 hours ago | 2.0 MB | |
| 0.20.1 source code.tar.gz | < 10 hours ago | 1.1 MB | |
| 0.20.1 source code.zip | < 10 hours ago | 1.9 MB | |
| README.md | < 10 hours ago | 3.1 kB | |
| Totals: 4 Items | 5.1 MB | 0 | |
Changed
- Migrated Black-box Testing from Sharness to PHPUnit. #2492
Fixed
- Fixed method return-type enforcement at runtime for
return this->property: methods declared with a strict scalar return type (-> string,-> int,-> double,-> array) now throwTypeErrorwhen the property holds a mismatching value instead of silently returning it. PHP only verifies internal-function return types inZEND_DEBUG=1builds, so the generated C code now emits a runtime check via newRETURN_MEMBER_TYPED/RETURN_MM_MEMBER_TYPEDkernel macros. The error message matches PHP's userland format:Class::method(): Return value must be of type X, Y returned. Nullable return types (string | null) and union/mixedreturns are left unchecked, as before. #1991, #2196 - Fixed built-in array methods called on a
var-typed variable (e.g.let b = b->join("");wherebis declaredvar). Previously these were emitted asZEPHIR_CALL_METHOD(b, "join", …)and surfaced as aRuntimeException: Trying to call method join on a non-object(originally a segfault, reduced to an exception over time). When the method name is one of the array-specific built-in names that can't meaningfully be a real object method (join,reversed,rev,tojson,haskey,mergerecursive,replacerecursive,sortbykey,reversesort,reversesortbykey), the compiler now dispatches viaArrayType— lowering to the matching PHP function call (e.g.join(glue, array)), just like statically-typed array variables already did. Common Iterator/Countable-style method names (count,push,pop,shift,sort,next,current,end,key,reset,each) are deliberately excluded so object dispatch on those is preserved. #733, #2228 - Fixed
let this->prop = valueinside closures: the closure-binding detector from [#2497] caught property reads but missed let-statement writes (different AST shape), so writes were rejected as "Property not defined on stub\NN__closure". #1873, #2203 - Reorganised
populate_fcic()to pin calling/called scope earlier for direct call paths (zephir_fcall_ceand closures). #2321 is NOT fixed by this change. The original symptom —preg_replace_callback(..., [this, 'privateMethod'], ...)failing with "cannot access private method" — remains; PHP's callable-argument validation walksprev_execute_datafor the nearestZEND_USER_CODEframe and Zephir methods areZEND_INTERNAL_FUNCTIONso they're skipped. Workaround: wrap the callback in a Zephir closure that capturesthis—function (m) { return this->privateMethod(m); }— closures aren't re-validated by PHP. #2321, #2325