3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $original = array ( array ("title" => "one", "color" => "blue" ), array ("title" => "two", "color" => "green" ) ); $merged = array(); $str = "000three000red0!000four000white0!000five000black0!"; $pat = "/\d+(\D+)\d+(\D+)\d!/um"; preg_match_all($pat, $str, $match); var_dump($match); $merged = $original; foreach($match as $result) { //$merged[] = array("title" => $result, "color" => $result); } //print_r($merged);
Output for 4.3.0 - 5.0.5, 5.1.1 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(3) { [0]=> array(3) { [0]=> string(16) "000three000red0!" [1]=> string(17) "000four000white0!" [2]=> string(17) "000five000black0!" } [1]=> array(3) { [0]=> string(5) "three" [1]=> string(4) "four" [2]=> string(4) "five" } [2]=> array(3) { [0]=> string(3) "red" [1]=> string(5) "white" [2]=> string(5) "black" } }
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/5iu1i on line 29
Process exited with code 255.