- Removed redundant zval macro handling for property access - Replaced Z_LVAL_P and Z_DVAL_P calls with direct attribute accessors - Updated property getter logic to use attrInt and attrFloat methods - Modified tests to match new property access pattern - Added comprehensive test case for inherited property reference handlingmaster
parent
011cb31882
commit
38d828cbbe
4 changed files with 41 additions and 6 deletions
@ -0,0 +1,31 @@ |
||||
--TEST-- |
||||
Hoisted this numeric slots preserve inherited properties and existing references |
||||
--FILE-- |
||||
<?php |
||||
class SlotBase { |
||||
public int $count = 2; |
||||
public float $weight = 1.5; |
||||
} |
||||
class SlotChild extends SlotBase { |
||||
public function update(): void { |
||||
$this->count += 3; |
||||
$this->weight += 0.5; |
||||
} |
||||
} |
||||
function main(): void { |
||||
$object = new SlotChild(); |
||||
$count =& $object->count; |
||||
$weight =& $object->weight; |
||||
$object->update(); |
||||
var_dump($count, $weight); |
||||
$count = 10; |
||||
$weight = 3.5; |
||||
$object->update(); |
||||
var_dump($count, $weight); |
||||
} |
||||
?> |
||||
--EXPECT-- |
||||
int(5) |
||||
float(2) |
||||
int(13) |
||||
float(4) |
||||
Loading…
Reference in new issue