3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testvectors = [ 'null' => null, 'empty string' => '', /* 'one space' => ' ', 'four spaces' => ' ', 'one tab' => "\t", 'four tabs' => "\t\t\t\t", 'one newline' => "\n", 'four newlines' => "\n\n\n\n", 'one carriage return' => "\r", 'four carriage returns' => "\r\r\r\r", 'one colon' => ':', 'four colons' => '::::', 'one @ sign' => '@', 'four @ signs' => '@@@@', 'one slash' => '/', 'four slashes' => '////', 'one backslash' => '\\', 'four backslashes' => '\\\\\\\\', 'one percent' => '%', 'four percents' => '%%%%', 'one plus' => '+', 'four plusses' => '++++', 'one question mark' => '?', 'four question marks' => '????', 'one # sign' => '#', 'four # signs' => '####', */ ]; foreach($testvectors as $name => $value) { echo '--- Testvector '.$name.' ---'.PHP_EOL; $result = parse_url($value); if ($result === false) { echo 'FALSE'.PHP_EOL; } else { echo 'NOT FALSE'.PHP_EOL; var_dump($result); } echo PHP_EOL; }
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
--- Testvector null --- Deprecated: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated in /in/QIUQr on line 39 NOT FALSE array(1) { ["path"]=> string(0) "" } --- Testvector empty string --- NOT FALSE array(1) { ["path"]=> string(0) "" }
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
66.66 ms | 407 KiB | 5 Q