3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo { var $bar = 'arr'; } $arr = array(0 => 'bar'); $p7 = 'bar'; $f = new foo(); echo $f->$arr[0]; // php7 // < php7 'arr'
based on U8jh9
Output for 7.0.0 - 7.2.0
Notice: Array to string conversion in /in/ZJDIT on line 6 Notice: Undefined property: foo::$Array in /in/ZJDIT on line 6
Output for 4.3.0 - 4.4.9, 5.1.3 - 5.6.28
arr
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/ZJDIT on line 2 arr
Output for 5.1.0
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/ZJDIT on line 2 Fatal error: fatal flex scanner internal error--end of buffer missed in /in/ZJDIT on line 9
Process exited with code 255.