3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); var_dump(http_build_query(['foo' => 'bar'], null));
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Fatal error: Uncaught TypeError: http_build_query(): Argument #2 ($numeric_prefix) must be of type string, null given in /in/M0pJO:5 Stack trace: #0 /in/M0pJO(5): http_build_query(Array, NULL) #1 {main} thrown in /in/M0pJO on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught TypeError: http_build_query() expects parameter 2 to be string, null given in /in/M0pJO:5 Stack trace: #0 /in/M0pJO(5): http_build_query(Array, NULL) #1 {main} thrown in /in/M0pJO on line 5
Process exited with code 255.
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/M0pJO on line 3 string(7) "foo=bar"

preferences:
170.55 ms | 402 KiB | 242 Q