3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'prijs=0,209&orderby=price&order=undefined&posts_per_page=undefined'; $array = preg_split('/[&]/' , $str); foreach ($array as $a) { $a = preg_split('/[=]/' , $a[0]); $a[1] = preg_split('/[,]/' , $a[1]); } var_dump($array);
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined offset: 1 in /in/rBU8b on line 9 Notice: Undefined offset: 1 in /in/rBU8b on line 9 Notice: Undefined offset: 1 in /in/rBU8b on line 9 Notice: Undefined offset: 1 in /in/rBU8b on line 9 array(4) { [0]=> string(11) "prijs=0,209" [1]=> string(13) "orderby=price" [2]=> string(15) "order=undefined" [3]=> string(24) "posts_per_page=undefined" }
Output for hhvm-3.12.0
Notice: Undefined index: 1 in /in/rBU8b on line 9 Notice: Undefined index: 1 in /in/rBU8b on line 9 Notice: Undefined index: 1 in /in/rBU8b on line 9 Notice: Undefined index: 1 in /in/rBU8b on line 9 array(4) { [0]=> string(11) "prijs=0,209" [1]=> string(13) "orderby=price" [2]=> string(15) "order=undefined" [3]=> string(24) "posts_per_page=undefined" }
Output for hhvm-3.10.0
Notice: Undefined index: 1 in /in/rBU8b on line 27 Notice: Undefined index: 1 in /in/rBU8b on line 27 Notice: Undefined index: 1 in /in/rBU8b on line 27 Notice: Undefined index: 1 in /in/rBU8b on line 27 array(4) { [0]=> string(11) "prijs=0,209" [1]=> string(13) "orderby=price" [2]=> string(15) "order=undefined" [3]=> string(24) "posts_per_page=undefined" }
Output for 4.3.0 - 5.2.17
Notice: Undefined offset: 1 in /in/rBU8b on line 9 Notice: Undefined offset: 1 in /in/rBU8b on line 9 Notice: Undefined offset: 1 in /in/rBU8b on line 9 Notice: Undefined offset: 1 in /in/rBU8b on line 9 array(4) { [0]=> string(11) "prijs=0,209" [1]=> string(13) "orderby=price" [2]=> string(15) "order=undefined" [3]=> string(24) "posts_per_page=undefined" }