3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { protected $a = 0; } $a = new A(); $b = (object)[chr(0) . '*' . chr(0) . 'a' => 1]; echo $a->{chr(0) . '*' . chr(0) . 'a'}; echo $b->{chr(0) . '*' . chr(0) . 'a'};
based on rvj23
Output for 7.0.0 - 7.3.0alpha1
Fatal error: Uncaught Error: Cannot access property started with '\0' in /in/J25Xf:9 Stack trace: #0 {main} thrown in /in/J25Xf on line 9
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Cannot access property started with '\0' in /in/J25Xf:9 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Cannot access property started with '\0' in /in/J25Xf on line 9
Process exited with code 255.