3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { private $a = 0; } class C { } $a = new A(); $b = (object)[chr(0) . 'A' . chr(0) . 'a' => 1]; $c = new C(); //$c->{chr(0) . 'C' . chr(0) . 'a'} = 2; 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 63Un9
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught Error: Cannot access property started with '\0' in /in/RdCCC:15 Stack trace: #0 {main} thrown in /in/RdCCC on line 15
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Cannot access property started with '\0' in /in/RdCCC:15 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/RdCCC on line 15
Process exited with code 255.