3v4l.org

run code in 300+ PHP versions simultaneously
<?php $query_string = [ 'one' => 1, 'two' => '', 'three' => null, // gets omitted 'four' => ' ', // gets encoded 'five' => "&test=test" // gets encoded ]; echo http_build_query($query_string); echo "\n---\n"; echo http_build_query($query_string, '', '&amp;'); echo "\n\n\n\n\n";
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.30, 7.4.0 - 7.4.23, 8.0.0 - 8.0.11, 8.1rc1 - rc2
one=1&two=&four=+&five=%26test%3Dtest --- one=1&amp;two=&amp;four=+&amp;five=%26test%3Dtest

preferences:
265.68 ms | 459 KiB | 5 Q