3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = "he%00llo=world%00apart"; echo 'Input:', var_dump($string); parse_str($string, $values); echo "Output:\n"; $count = 0; foreach($values as $key => $value) { echo var_export(++$count), ': ', var_dump($key), ' => ', var_dump($value), "\n"; } printf("done, %d variable(s)\n", $count);
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Input:string(22) "he%00llo=world%00apart" Output: 1: string(2) "he" => string(11) "worldapart" done, 1 variable(s)
Output for hhvm-3.10.0 - 3.12.0
Input:string(22) "he%00llo=world%00apart" Output: 11: string(2) "he" => string(11) "worldapart" done, 1 variable(s)
Output for 4.3.0 - 4.3.8, 4.3.10 - 5.1.6, 5.2.1 - 5.3.29
Input:string(22) "he%00llo=world%00apart" Output: 1: string(2) "he" => string(12) "world\0apart" done, 1 variable(s)
Output for 5.2.0
Input:string(22) "he%00llo=world%00apart" Output: 1: string(2) "he" => string(13) "world\\0apart" done, 1 variable(s)
Output for 4.3.9
Input:string(22) "he%00llo=world%00apart" Output: 1: string(2) "he" => string(12) "world\apart" done, 1 variable(s)