3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo { var $bar = 'arr'; } $arr = array(0 => 'bar'); $f = new foo(); echo $f->$baz[0]; // php7 // < php7 'okok'
based on vHe5F
Output for 7.1.0 - 7.2.0
Notice: Undefined variable: baz in /in/bkqpT on line 6 Notice: Undefined property: foo::$ in /in/bkqpT on line 6
Output for 7.0.0 - 7.0.20
Notice: Undefined variable: baz in /in/bkqpT on line 6 Fatal error: Uncaught Error: Cannot access empty property in /in/bkqpT:6 Stack trace: #0 {main} thrown in /in/bkqpT on line 6
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Notice: Undefined variable: baz in /in/bkqpT on line 6 Fatal error: Cannot access empty property in /in/bkqpT on line 6
Process exited with code 255.