3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'hostname.com/path?arg=value#anchor'; print_r(parse_url($url)); echo parse_url($url, PHP_URL_SCHEMA);
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.6
Array ( [path] => hostname.com/path [query] => arg=value [fragment] => anchor ) Fatal error: Uncaught Error: Undefined constant "PHP_URL_SCHEMA" in /in/6hn48:7 Stack trace: #0 {main} thrown in /in/6hn48 on line 7
Process exited with code 255.
Output for 7.3.12 - 7.3.33, 7.4.0 - 7.4.33
Array ( [path] => hostname.com/path [query] => arg=value [fragment] => anchor ) Warning: Use of undefined constant PHP_URL_SCHEMA - assumed 'PHP_URL_SCHEMA' (this will throw an Error in a future version of PHP) in /in/6hn48 on line 7 Warning: parse_url() expects parameter 2 to be int, string given in /in/6hn48 on line 7
Output for 7.2.6 - 7.2.33
Array ( [path] => hostname.com/path [query] => arg=value [fragment] => anchor ) Warning: Use of undefined constant PHP_URL_SCHEMA - assumed 'PHP_URL_SCHEMA' (this will throw an Error in a future version of PHP) in /in/6hn48 on line 7 Warning: parse_url() expects parameter 2 to be integer, string given in /in/6hn48 on line 7
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20
Array ( [path] => hostname.com/path [query] => arg=value [fragment] => anchor ) Notice: Use of undefined constant PHP_URL_SCHEMA - assumed 'PHP_URL_SCHEMA' in /in/6hn48 on line 7 Warning: parse_url() expects parameter 2 to be integer, string given in /in/6hn48 on line 7
Output for 5.1.2 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.37, 5.6.0 - 5.6.28
Array ( [path] => hostname.com/path [query] => arg=value [fragment] => anchor ) Notice: Use of undefined constant PHP_URL_SCHEMA - assumed 'PHP_URL_SCHEMA' in /in/6hn48 on line 7 Warning: parse_url() expects parameter 2 to be long, string given in /in/6hn48 on line 7
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.1
Array ( [path] => hostname.com/path [query] => arg=value [fragment] => anchor ) Notice: Use of undefined constant PHP_URL_SCHEMA - assumed 'PHP_URL_SCHEMA' in /in/6hn48 on line 7 Warning: parse_url() expects exactly 1 parameter, 2 given in /in/6hn48 on line 7

preferences:
200.41 ms | 403 KiB | 349 Q