3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = '//host.example.com'; var_dump( wp_parse_url( $url ) ); $url = '//[::FFFF::127.0.0.1]'; var_dump( wp_parse_url( $url ) ); function wp_parse_url( $url ) { $parts = @parse_url( $url ); if ( ! $parts ) { // < PHP 5.4.7 compat, trouble with relative paths including a scheme break in the path if ( '/' == $url[0] && false !== strpos( $url, '://' ) ) { // Since we know it's a relative path, prefix with a scheme/host placeholder and try again if ( ! $parts = @parse_url( 'placeholder://placeholder' . $url ) ) { return $parts; } // Remove the placeholder values unset( $parts['scheme'], $parts['host'] ); } else { return $parts; } } // < PHP 5.4.7 compat, doesn't detect schemeless URL's host field if ( '//' == substr( $url, 0, 2 ) && ! isset( $parts['host'] ) ) { $path_parts = explode( '/', substr( $parts['path'], 2 ), 2 ); $parts['host'] = $path_parts[0]; if ( isset( $path_parts[1] ) ) { $parts['path'] = "/{$slashless_path}"; } else { unset( $parts['path'] ); } } return $parts; }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0070.00716.75
8.3.50.0120.00921.92
8.3.40.0060.01318.79
8.3.30.0070.00718.77
8.3.20.0060.00320.29
8.3.10.0040.00423.36
8.3.00.0080.00317.63
8.2.180.0040.01816.75
8.2.170.0110.00722.96
8.2.160.0110.00420.36
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0030.00617.38
8.2.110.0070.00320.34
8.2.100.0120.00017.91
8.2.90.0000.00819.18
8.2.80.0040.00417.97
8.2.70.0000.00817.50
8.2.60.0000.00917.93
8.2.50.0060.00318.07
8.2.40.0000.00821.12
8.2.30.0000.00720.64
8.2.20.0030.00617.68
8.2.10.0000.00818.04
8.2.00.0080.00018.15
8.1.280.0160.01025.92
8.1.270.0080.00023.97
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0040.01423.81
8.1.230.0000.01021.00
8.1.220.0000.00817.79
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0040.00417.23
8.1.180.0020.00518.10
8.1.170.0000.00719.03
8.1.160.0050.00321.97
8.1.150.0040.00418.86
8.1.140.0040.00419.65
8.1.130.0000.00717.75
8.1.120.0040.00417.50
8.1.110.0040.00417.36
8.1.100.0040.00417.46
8.1.90.0030.00317.47
8.1.80.0030.00317.36
8.1.70.0030.00317.46
8.1.60.0000.00717.64
8.1.50.0030.00517.56
8.1.40.0040.00417.57
8.1.30.0050.00317.69
8.1.20.0000.00817.64
8.1.10.0050.00217.58
8.1.00.0040.00417.55
8.0.300.0000.00718.77
8.0.290.0070.00016.63
8.0.280.0000.00818.39
8.0.270.0040.00417.32
8.0.260.0030.00317.19
8.0.250.0000.00716.86
8.0.240.0040.00416.96
8.0.230.0050.00316.92
8.0.220.0040.00416.84
8.0.210.0040.00416.94
8.0.200.0030.00316.98
8.0.190.0000.00717.02
8.0.180.0000.00716.97
8.0.170.0040.00416.92
8.0.160.0030.00316.97
8.0.150.0050.00316.84
8.0.140.0000.00816.85
8.0.130.0060.00013.37
8.0.120.0000.00816.87
8.0.110.0040.00416.88
8.0.100.0030.00516.93
8.0.90.0040.00416.80
8.0.80.0160.00016.93
8.0.70.0050.00316.93
8.0.60.0040.00416.85
8.0.50.0040.00416.86
8.0.30.0120.00817.10
8.0.20.0090.00817.40
8.0.10.0030.00516.93
8.0.00.0120.00816.75
7.4.330.0020.00215.08
7.4.320.0070.00016.42
7.4.300.0030.00316.59
7.4.290.0000.00716.51
7.4.280.0040.00416.51
7.4.270.0030.00316.54
7.4.260.0040.00416.64
7.4.250.0000.00816.48
7.4.240.0030.00316.43
7.4.230.0070.00016.70
7.4.220.0120.01216.67
7.4.210.0100.01016.48
7.4.200.0000.00816.49
7.4.160.0080.00816.77
7.4.150.0060.01317.40
7.4.140.0130.00817.86
7.4.130.0120.01316.50
7.4.120.0100.00916.58
7.4.110.0090.00916.57
7.4.100.0070.01016.53
7.4.90.0030.01716.48
7.4.80.0170.00319.39
7.4.70.0070.01116.59
7.4.60.0120.00416.50
7.4.50.0000.00816.68
7.4.40.0140.00316.43
7.4.30.0110.00616.54
7.4.00.0060.01015.01
7.3.330.0020.00213.39
7.3.320.0000.00613.35
7.3.310.0030.00616.23
7.3.300.0030.00316.50
7.3.290.0100.00816.40
7.3.280.0110.00616.36
7.3.270.0110.00617.40
7.3.260.0100.01016.57
7.3.250.0070.01216.54
7.3.240.0110.00616.48
7.3.230.0090.00916.48
7.3.210.0060.01116.57
7.3.200.0080.00816.47
7.3.190.0090.00616.62
7.3.180.0070.01316.36
7.3.170.0100.00716.32
7.3.160.0060.00916.34
7.2.330.0090.01016.42
7.2.320.0120.00616.42
7.2.310.0120.01216.81
7.2.300.0100.01016.66
7.2.290.0120.00616.73
7.2.60.0070.00716.67
7.2.00.0060.00619.12
7.1.200.0070.00715.50
7.1.100.0100.00317.86
7.1.70.0040.00417.11
7.1.60.0100.01419.11
7.1.50.0070.01416.61
7.1.00.0070.07322.31
7.0.200.0310.00714.51
7.0.60.0030.04019.93
7.0.50.0200.07317.88
7.0.40.0000.09720.30
7.0.30.0400.07720.30
7.0.20.0270.05720.17
7.0.10.0200.05320.09
7.0.00.0000.04320.22
5.6.280.0000.03720.92
5.6.210.0170.07020.54
5.6.200.0030.09018.19
5.6.190.0070.04720.54
5.6.180.0170.07020.58
5.6.170.0330.07320.57
5.6.160.0100.05020.45
5.6.150.0030.05718.18
5.6.140.0170.04018.30
5.6.130.0030.04018.18
5.6.120.0070.04321.03
5.6.110.0070.08720.99
5.6.100.0070.08021.04
5.6.90.0030.07321.11
5.6.80.0130.07320.52
5.6.70.0370.06020.41
5.5.350.0030.06020.34
5.5.340.0030.08317.98
5.5.330.0030.07320.31
5.5.320.0330.04020.29
5.5.310.0330.07020.35
5.5.300.0130.08017.93
5.5.290.0000.04718.04
5.5.280.0030.08320.98
5.5.270.0170.05720.97
5.5.260.0070.05320.77
5.5.250.0000.09020.50
5.5.240.0100.07720.27
5.4.450.0330.07019.18
5.4.440.0230.05319.18
5.4.430.0170.08019.43
5.4.420.0700.06319.61
5.4.410.0300.04719.45
5.4.400.0230.04719.29
5.4.390.0100.06319.06
5.4.380.0270.05019.30
5.4.370.0270.06019.29
5.4.360.0200.08019.30
5.4.350.0100.05719.06
5.4.340.0030.06019.29
5.4.320.0670.06719.26
5.4.310.0130.05319.28
5.4.300.0130.05318.85
5.4.290.0400.05319.37
5.4.280.0130.05319.14
5.4.270.0230.04318.96
5.4.260.0130.05019.28
5.4.250.0170.05019.30
5.4.240.0230.04319.28
5.4.230.0100.05019.07
5.4.220.0100.05319.00
5.4.210.0200.04719.30
5.4.200.0070.05319.29
5.4.190.0030.05719.13
5.4.180.0130.05319.13
5.4.170.0030.06019.13
5.4.160.0300.05719.12
5.4.150.0130.05319.13
5.4.140.0070.05716.33
5.4.130.0630.05016.57
5.4.120.0500.05316.32
5.4.110.0070.05316.62
5.4.100.0200.04016.57
5.4.90.0530.05016.43
5.4.80.0200.05016.56
5.4.70.0170.06716.41
5.4.60.0530.05316.62
5.4.50.0130.05016.55
5.4.40.0130.04716.57
5.4.30.0170.06316.57
5.4.20.0030.06016.58
5.4.10.0100.05316.22
5.4.00.0230.04015.75

preferences:
52.51 ms | 401 KiB | 5 Q