3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array('one', 'two', 'three', new stdClass, array()); var_dump(is_array($array[4])); foreach($array as $key=>$value) { switch($value) { case 'one': echo 'one'; break; case 'two': echo 'two'; break; case 'three': echo 'three'; break; case is_object($value): echo 'object'; break; case is_array($value) === true: echo 'array'; break; } }
based on 58OfB
Output for 5.0.0 - 5.0.5, 5.2.0 - 7.1.0
bool(true) onetwothreeobjectobject
Output for 5.1.0 - 5.1.6
bool(true) onetwothree Notice: Object of class stdClass could not be converted to int in /in/C6PRo on line 9 Notice: Object of class stdClass could not be converted to int in /in/C6PRo on line 12 Notice: Object of class stdClass could not be converted to int in /in/C6PRo on line 15 objectobject
Output for 4.3.0 - 4.4.9
bool(true) onetwothreearrayobject