3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new __PHP_Incomplete_Class; $r = new ReflectionProperty($a, 'x'); $r->setValue(null, 3); //$a->x = 2; var_dump($a); var_dump(unserialize(serialize($a)));
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Fatal error: Uncaught ReflectionException: Property __PHP_Incomplete_Class::$x does not exist in /in/3EOS1:4 Stack trace: #0 /in/3EOS1(4): ReflectionProperty->__construct(Object(__PHP_Incomplete_Class), 'x') #1 {main} thrown in /in/3EOS1 on line 4
Process exited with code 255.

preferences:
44.9 ms | 479 KiB | 5 Q