3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $s = "1+hello/world"; $e = explode("/", $s); $f = strpos($s, "af+"); $pattern = '/([\+-\/])/'; $r = preg_split($pattern, $s, -1, PREG_SPLIT_DELIM_CAPTURE); var_dump($r);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(5) { [0]=> string(1) "1" [1]=> string(1) "+" [2]=> string(5) "hello" [3]=> string(1) "/" [4]=> string(5) "world" }