3v4l.org

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