3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class MyClass { protected $prop; } $foo = new MyClass(); $foo->prop = 'test1'; $bar = $foo; $bam = new MyClass(); $bam->prop = 'test2'; $test = array($foo, $bar, $bam); print_r(array_unique($test, SORT_REGULAR));
based on WhOcl
Output for 7.0.0 - 7.3.0rc3
Fatal error: Uncaught Error: Cannot access protected property MyClass::$prop in /in/OhqlJ:8 Stack trace: #0 {main} thrown in /in/OhqlJ on line 8
Process exited with code 255.
Output for hhvm-3.18.4 - 3.21.0
Fatal error: Uncaught Error: Cannot access protected property in /in/OhqlJ:8 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Cannot access protected property MyClass::$prop in /in/OhqlJ on line 8
Process exited with code 255.