mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
29 lines
471 B
PHP
29 lines
471 B
PHP
--TEST--
|
|
GH-19305 003: Operands may be released during comparison
|
|
--SKIPIF--
|
|
<?php
|
|
if (!method_exists('ReflectionClass', 'newLazyGhost')) {
|
|
die('skip No lazy objects');
|
|
}
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
class C
|
|
{
|
|
public $s;
|
|
}
|
|
$r = new ReflectionClass(C::class);
|
|
$o = $r->newLazyProxy(function () { return new C; });
|
|
|
|
// Comparison calls initializers, which releases $o
|
|
var_dump($o >
|
|
$r->newLazyGhost(function () {
|
|
global $o;
|
|
$o = null;
|
|
}));
|
|
|
|
?>
|
|
--EXPECT--
|
|
bool(false)
|