- 在引用参数解析中添加临时变量处理以支持引用类型参数 - 为静态属性获取器添加 toReference() 方法调用支持 - 添加新的测试用例验证静态属性引用操作的正确性 - 优化编译器对 nativeProperty 属性的引用值处理逻辑pull/3/head
parent
991e4bc931
commit
15bcacacc0
2 changed files with 51 additions and 1 deletions
@ -0,0 +1,41 @@ |
|||||||
|
--TEST-- |
||||||
|
object link operator |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
class StackHolder |
||||||
|
{ |
||||||
|
public static array $stack = []; |
||||||
|
|
||||||
|
public static function push(string $item): void |
||||||
|
{ |
||||||
|
self::$stack[] = $item; |
||||||
|
} |
||||||
|
|
||||||
|
public static function pop(): void |
||||||
|
{ |
||||||
|
array_pop(self::$stack); |
||||||
|
} |
||||||
|
|
||||||
|
public static function count(): int |
||||||
|
{ |
||||||
|
return count(self::$stack); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function main(): int |
||||||
|
{ |
||||||
|
StackHolder::push('a'); |
||||||
|
StackHolder::push('b'); |
||||||
|
StackHolder::pop(); |
||||||
|
|
||||||
|
if (StackHolder::count() !== 1) { |
||||||
|
echo "FAIL: expected 1, got " . StackHolder::count() . "\n"; |
||||||
|
return 1; |
||||||
|
} |
||||||
|
|
||||||
|
echo "OK\n"; |
||||||
|
return 0; |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
OK |
||||||
Loading…
Reference in new issue