3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function split_trim(string $str) { preg_match_all('/./us', $str, $retArray); if (isset($retArray[0])) { return $retArray[0]; } return false; } var_dump(split_trim('foobar'));
based on RJJT9
Output for 7.0.0 - 7.3.0beta1
array(6) { [0]=> string(1) "f" [1]=> string(1) "o" [2]=> string(1) "o" [3]=> string(1) "b" [4]=> string(1) "a" [5]=> string(1) "r" }
Output for 5.6.0 - 5.6.26
Catchable fatal error: Argument 1 passed to split_trim() must be an instance of string, string given, called in /in/r0L0H on line 13 and defined in /in/r0L0H on line 3
Process exited with code 255.