3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $obj = new stdClass(); $obj->a = 65; $obj[1]=6666; $stack = array("orange", "banana"); $stack2 = array(array("11", "22",array("77", "99")), "orange2", "banana2", array("33", "44"), new DateTime,$obj); var_dump($stack2); $a='gggg'; array_push($stack, $stack2, 'ff','tt','ii',$stack); print_r($stack); print_r($stack2); /*$stack = array("orange", "banana"); $stack2 = array("orange2", "banana2"); $stack2 = array(array("11", "22"), "orange2", "banana2", array("33", "44")); $result = array_merge($stack,'ff','tt','ii', $stack2); print_r($result);*/
based on 3OK6P
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/eUCDn:5 Stack trace: #0 {main} thrown in /in/eUCDn on line 5
Process exited with code 255.
Output for 5.3.22 - 5.6.28
Fatal error: Cannot use object of type stdClass as array in /in/eUCDn on line 5
Process exited with code 255.