3v4l.org

run code in 500+ PHP versions simultaneously
<?php class x { public $p; public mixed $q; } $x = new x; var_dump($x->p); var_dump($x->q); // Fatal error!
Output for 8.1.34, 8.2.0 - 8.2.32, 8.3.0 - 8.3.33, 8.4.1 - 8.4.24, 8.5.0 - 8.5.9
NULL Fatal error: Uncaught Error: Typed property x::$q must not be accessed before initialization in /in/itGW9:10 Stack trace: #0 {main} thrown in /in/itGW9 on line 10
Process exited with code 255.

preferences:
48.97 ms | 899 KiB | 4 Q