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('{ "' . 'A' . '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 UjBDU
Output for 7.0.0 - 7.2.6
object(stdClass)#3 (1) { ["Aa"]=> string(1) "2" } Fatal error: Uncaught Error: Cannot access property started with '\0' in /in/EkaDT:12 Stack trace: #0 {main} thrown in /in/EkaDT on line 12
Process exited with code 255.
Output for hhvm-3.15.4
object(stdClass)#3 (1) { ["Aa"]=> string(1) "2" } Fatal error: Uncaught Error: Cannot access property started with '\0' in /in/EkaDT:12 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
object(stdClass)#3 (1) { ["Aa"]=> string(1) "2" } Fatal error: Cannot access property started with '\0' in /in/EkaDT on line 12
Process exited with code 255.