3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { private $a = 0; } $a = new A(); $b = (object)[chr(0) . 'A' . chr(0) . 'a' => 1]; $c = json_decode('{ "' . chr(0) . 'A' . chr(0) . 'a' . '":"2" }'); var_dump($c); echo $c->{chr(0) . 'A' . chr(0) . 'a'}; echo $b->{chr(0) . 'A' . chr(0) . 'a'}; echo $a->{chr(0) . 'A' . chr(0) . 'a'};
based on bMEQb
Output for 7.2.0 - 7.2.6
NULL Notice: Trying to get property '' of non-object in /in/UjBDU on line 12 Fatal error: Uncaught Error: Cannot access property started with '\0' in /in/UjBDU:13 Stack trace: #0 {main} thrown in /in/UjBDU on line 13
Process exited with code 255.
Output for 7.0.0 - 7.1.20
NULL Notice: Trying to get property of non-object in /in/UjBDU on line 12 Fatal error: Uncaught Error: Cannot access property started with '\0' in /in/UjBDU:13 Stack trace: #0 {main} thrown in /in/UjBDU on line 13
Process exited with code 255.
Output for hhvm-3.15.4
NULL Notice: Cannot access property on non-object in /in/UjBDU on line 12 1 Fatal error: Uncaught Error: Cannot access property started with '\0' in /in/UjBDU:14 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
NULL Notice: Trying to get property of non-object in /in/UjBDU on line 12 Fatal error: Cannot access property started with '\0' in /in/UjBDU on line 13
Process exited with code 255.