3v4l.org

run code in 500+ PHP versions simultaneously
<?php echo http_build_query( ["foo"=>["a","b","c"]], null, '&') . "\n"; $array = array('a', 'n'); echo http_build_query($array, 'foo');
Output for 8.2.0 - 8.2.32, 8.3.0 - 8.3.32, 8.4.1 - 8.4.23, 8.5.0 - 8.5.8
Deprecated: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in /in/ku2oK on line 3 foo%5B0%5D=a&foo%5B1%5D=b&foo%5B2%5D=c foo0=a&foo1=n
Output for 8.1.0 - 8.1.34
Deprecated: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in /in/ku2oK on line 6 foo%5B0%5D=a&foo%5B1%5D=b&foo%5B2%5D=c foo0=a&foo1=n
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
foo%5B0%5D=a&foo%5B1%5D=b&foo%5B2%5D=c foo0=a&foo1=n

preferences:
107.82 ms | 1416 KiB | 4 Q