3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php print_r(preg_split("/[ ,]+/", '21, 151, 555')); echo json_encode(preg_split("/[ ,]+/", '21, 151, 555'));
based on OqH9s
Output for 5.2.0 - 7.1.0
Array ( [0] => 21 [1] => 151 [2] => 555 ) ["21","151","555"]
Output for 5.0.0 - 5.1.6
Array ( [0] => 21 [1] => 151 [2] => 555 ) Fatal error: Call to undefined function json_encode() in /in/KEqFh on line 5
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Array ( [0] => 21 [1] => 151 [2] => 555 ) Fatal error: Call to undefined function: json_encode() in /in/KEqFh on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Array ( [0] => 21 [1] => 151 [2] => 555 ) Fatal error: Call to undefined function: json_encode() in /in/KEqFh on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Array ( [0] => 21 [1] => 151 [2] => 555 ) Fatal error: Call to undefined function: json_encode() in /in/KEqFh on line 5