3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A{} $a = new A(); $a->{"\0native"} = 123; var_dump($a);
based on EsfRo
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Cannot access property started with '\0' in /in/FR7e5:5 Stack trace: #0 {main} thrown in /in/FR7e5 on line 5
Process exited with code 255.
Output for 5.0.5 - 5.6.28, hhvm-3.10.0 - 3.12.0
Fatal error: Cannot access property started with '\0' in /in/FR7e5 on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.4
object(A)#1 (1) { [":private"]=> int(123) }
Output for 4.3.5 - 4.4.9
object(a)(1) { ["native"]=> int(123) }
Output for 4.3.0 - 4.3.4
object(a)(1) { [""]=> int(123) }