3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class C { var $p; function m($v) { echo $this->p, $v, "\n"; } } function f($c) { for($i=0; $i<10; ++$i) $c[0][$c[1]]($i); } $c = new C(); $c->p = 'X'; f(array(&$c, 'm'));
based on p3ZCk
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot use object of type C as array in /in/EKRMY:17 Stack trace: #0 /in/EKRMY(23): f(Array) #1 {main} thrown in /in/EKRMY on line 17
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Fatal error: Cannot use object of type C as array in /in/EKRMY on line 17
Process exited with code 255.