3v4l.org

run code in 300+ 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.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
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.33
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:
133.44 ms | 409 KiB | 5 Q