3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = 'asdf asd'; $array = array('asdf', 'asd'); var_dump('string'); var_dump(explode(' ', $string)); var_dump('array'); var_dump(explode(' ', $array));
based on HoLXd
Output for 5.3.1 - 7.1.0
string(6) "string" array(2) { [0]=> string(4) "asdf" [1]=> string(3) "asd" } string(5) "array" Warning: explode() expects parameter 2 to be string, array given in /in/5giif on line 8 NULL
Output for 4.3.0 - 5.3.0
string(6) "string" array(2) { [0]=> string(4) "asdf" [1]=> string(3) "asd" } string(5) "array" Notice: Array to string conversion in /in/5giif on line 8 array(1) { [0]=> string(5) "Array" }