3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Qwe { public function __construct(){ $this->{''} = 20; echo $this->{''}.PHP_EOL; } } ${''}=10; echo ${''}.PHP_EOL; // 10 echo ${null}.PHP_EOL; // 10 $b = new Qwe;
based on lSRbM
Output for 7.1.0 - 7.2.6
10 10 20
Output for 7.0.0 - 7.0.20
10 10 Fatal error: Uncaught Error: Cannot access empty property in /in/FNfe5:6 Stack trace: #0 /in/FNfe5(16): Qwe->__construct() #1 {main} thrown in /in/FNfe5 on line 6
Process exited with code 255.
Output for hhvm-3.15.4
10 10 Fatal error: Uncaught Error: Cannot access empty property in /in/FNfe5:6 Stack trace: #0 /in/FNfe5(16): Qwe->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
10 10 Fatal error: Cannot access empty property in /in/FNfe5 on line 6
Process exited with code 255.