3v4l.org

run code in 300+ PHP versions simultaneously
<?php function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);} $base_uri = 'http://localhost/symfony-standard/app_dev.php'; $base_uri_with_trailing_slash = $base_uri . '/'; $generate_uri = function($path) use ($base_uri) { return $base_uri . $path; }; $correctly_generate_uri = function($path, $base_uri) { $fix_path_for_base_uri = function ($path) use ($base_uri) { if ($path === '/') { return ''; } if (strlen($base_uri) === strrpos($base_uri, '/')+1) { return substr($path, 1); } return $path; }; return $base_uri . $fix_path_for_base_uri($path); }; print "\nBroken\n\n"; it( 'generates the expected uri: http://localhost/symfony-standard/app_dev.php', $base_uri === $generate_uri('/', $base_uri) ); it( 'generates the expected uri: http://localhost/symfony-standard/app_dev.php/foo', $base_uri.'/foo' === $generate_uri('/foo', $base_uri) ); print "\nNot Broken\n\n"; it( 'correctly generates the expected uri: http://localhost/symfony-standard/app_dev.php', $base_uri === $correctly_generate_uri('/', $base_uri) ); it( 'generates the expected uri: http://localhost/symfony-standard/app_dev.php/foo', $base_uri.'/foo' === $correctly_generate_uri('/foo', $base_uri) ); it( 'correctly generates the expected uri: http://localhost/symfony-standard/app_dev.php/', $base_uri_with_trailing_slash === $correctly_generate_uri('/', $base_uri_with_trailing_slash) ); it( 'correctly generates the expected uri: http://localhost/symfony-standard/app_dev.php/foo', $base_uri.'/foo' === $correctly_generate_uri('/foo', $base_uri_with_trailing_slash) );

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.5.10.0080.00920.17
8.5.00.0140.00719.80
8.4.160.0110.01123.84
8.4.150.0030.00014.05
8.4.140.0110.01119.33
8.4.130.0040.00417.96
8.4.120.0090.00820.71
8.4.110.0110.01022.66
8.4.100.0060.00317.72
8.4.90.0130.00718.70
8.4.80.0060.00318.05
8.4.70.0070.00217.93
8.4.60.0080.00920.39
8.4.50.0070.00418.67
8.4.40.0040.01119.43
8.4.30.0070.01417.76
8.4.20.0140.00717.44
8.4.10.0060.00317.66
8.3.280.0140.00618.30
8.3.270.0110.00916.59
8.3.260.0120.00816.55
8.3.250.0110.00918.92
8.3.240.0070.00216.58
8.3.230.0110.00516.49
8.3.220.0100.00917.34
8.3.210.0110.00716.81
8.3.200.0060.00316.52
8.3.190.0060.01017.32
8.3.180.0100.01017.25
8.3.170.0040.00420.70
8.3.160.0140.00317.23
8.3.150.0120.00316.66
8.3.140.0050.00317.41
8.3.130.0150.00616.52
8.3.120.0160.00320.85
8.3.110.0030.00620.94
8.3.100.0160.00324.06
8.3.90.0030.00626.77
8.3.80.0100.00317.97
8.3.70.0130.00318.18
8.3.60.0030.01018.56
8.3.50.0120.01021.98
8.3.40.0140.00318.67
8.3.30.0110.00319.08
8.3.20.0040.00420.34
8.3.10.0040.00421.72
8.3.00.0080.00020.77
8.2.290.0100.00920.36
8.2.280.0120.00718.38
8.2.270.0070.00016.82
8.2.260.0050.00316.51
8.2.250.0070.00716.78
8.2.240.0060.01218.92
8.2.230.0070.00722.58
8.2.220.0000.00837.54
8.2.210.0070.00026.77
8.2.200.0000.00918.54
8.2.190.0090.00916.58
8.2.180.0110.01116.88
8.2.170.0100.01022.96
8.2.160.0070.00722.01
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0060.00319.66
8.2.110.0080.00022.20
8.2.100.0090.00318.16
8.2.90.0040.00419.28
8.2.80.0050.00317.97
8.2.70.0070.00317.50
8.2.60.0000.00817.80
8.2.50.0080.00018.07
8.2.40.0040.00419.95
8.2.30.0000.00718.19
8.2.20.0000.00817.68
8.2.10.0000.00818.17
8.2.00.0040.00417.84
8.1.330.0120.00822.01
8.1.320.0120.00717.93
8.1.310.0000.01016.43
8.1.300.0050.00518.34
8.1.290.0030.00630.84
8.1.280.0090.00925.92
8.1.270.0080.00018.95
8.1.260.0090.00326.35
8.1.250.0080.00028.09
8.1.240.0030.00622.05
8.1.230.0040.00719.28
8.1.220.0060.00317.91
8.1.210.0000.00818.77
8.1.200.0080.00417.35
8.1.190.0030.00517.35
8.1.180.0050.00318.10
8.1.170.0050.00318.78
8.1.160.0030.00521.99
8.1.150.0040.00418.87
8.1.140.0040.00419.20
8.1.130.0070.00017.88
8.1.120.0040.00417.41
8.1.110.0040.00417.54
8.1.100.0050.00317.48
8.1.90.0040.00317.41
8.1.80.0040.00417.38
8.1.70.0000.00717.38
8.1.60.0030.00617.69
8.1.50.0080.00017.41
8.1.40.0080.00017.59
8.1.30.0000.00817.70
8.1.20.0030.00617.66
8.1.10.0050.00317.66
8.1.00.0000.00817.54
8.0.300.0000.00718.77
8.0.290.0000.00816.88
8.0.280.0040.00418.55
8.0.270.0000.00817.37
8.0.260.0000.00617.31
8.0.250.0000.00717.00
8.0.240.0000.00716.95
8.0.230.0000.00816.91
8.0.220.0030.00316.86
8.0.210.0000.00816.89
8.0.200.0000.00716.89
8.0.190.0000.00717.05
8.0.180.0000.00716.96
8.0.170.0000.00716.93
8.0.160.0030.00516.84
8.0.150.0000.00716.84
8.0.140.0000.00716.83
8.0.130.0050.00013.36
8.0.120.0050.00316.87
8.0.110.0080.00016.79
8.0.100.0050.00316.79
8.0.90.0040.00417.00
8.0.80.0080.01116.94
8.0.70.0070.00016.79
8.0.60.0080.00016.85
8.0.50.0000.00716.93
8.0.30.0070.01517.16
8.0.20.0170.00217.40
8.0.10.0000.00717.12
8.0.00.0120.00816.72
7.4.330.0040.00415.03
7.4.320.0060.00016.52
7.4.300.0030.00316.67
7.4.290.0070.00016.49
7.4.280.0000.00716.60
7.4.270.0000.00716.57
7.4.260.0040.00216.65
7.4.250.0000.00716.43
7.4.240.0020.00516.58
7.4.230.0070.00016.73
7.4.220.0120.00616.52
7.4.210.0040.01116.52
7.4.200.0030.00316.60
7.4.160.0100.00616.53
7.4.150.0110.01517.40
7.4.140.0030.01517.86
7.4.130.0110.00716.62
7.4.120.0110.00816.62
7.4.110.0100.00716.39
7.4.100.0030.01416.61
7.4.90.0090.00916.57
7.4.80.0130.00919.39
7.4.70.0060.01216.55
7.4.60.0060.01116.51
7.4.50.0030.00616.59
7.4.40.0070.01116.33
7.4.30.0110.00816.40
7.4.00.0040.01115.23
7.3.330.0040.00413.43
7.3.320.0000.00513.26
7.3.310.0000.00716.27
7.3.300.0030.00316.45
7.3.290.0080.00716.39
7.3.280.0070.00916.39
7.3.270.0040.01417.40
7.3.260.0100.00616.57
7.3.250.0100.00716.52
7.3.240.0030.01316.45
7.3.230.0120.00916.60
7.3.210.0080.00816.57
7.3.200.0060.01119.39
7.3.190.0090.01216.73
7.3.180.0080.00816.23
7.3.170.0090.01216.32
7.3.160.0110.00516.46
7.3.10.0100.00016.32
7.3.00.0030.00716.51
7.2.330.0110.00716.63
7.2.320.0130.00416.54
7.2.310.0100.00616.69
7.2.300.0070.01116.80
7.2.290.0060.01216.69
7.2.130.0040.01116.99
7.2.120.0070.00316.72
7.2.110.0040.00716.85
7.2.100.0030.01116.93
7.2.90.0050.00517.00
7.2.80.0040.01117.04
7.2.70.0060.00316.77
7.2.60.0050.00517.03
7.2.50.0100.00317.11
7.2.40.0070.00317.09
7.2.30.0000.00817.01
7.2.20.0060.00616.97
7.2.10.0030.00616.91
7.2.00.0030.00916.90
7.1.250.0030.00615.76
7.1.200.0070.00715.75
7.1.70.0130.00016.96
7.1.60.0070.01819.46
7.1.50.0030.01716.78
7.1.00.0000.08022.48
7.0.200.0030.00616.75
7.0.140.0070.03021.98
7.0.100.0030.04720.03
7.0.90.0100.05319.88
7.0.80.0070.05319.95
7.0.70.0400.06719.91
7.0.60.0130.06319.93
7.0.50.0070.06720.42
7.0.40.0200.07020.10
7.0.30.0070.04720.00
7.0.20.0100.08320.11
7.0.10.0130.08020.09
7.0.00.0030.06320.14
5.6.280.0030.07320.91
5.6.250.0030.07020.50
5.6.240.0100.08720.65
5.6.230.0030.09320.50
5.6.220.0000.05020.50
5.6.210.0030.05720.65
5.6.200.0170.03721.09
5.6.190.0030.04721.05
5.6.180.0100.08021.07
5.6.170.0030.08321.08
5.6.160.0070.08320.98
5.6.150.0130.07021.09
5.6.140.0130.07721.06
5.6.130.0070.05021.03
5.6.120.0030.09021.00
5.6.110.0070.08720.93
5.6.100.0170.07021.04
5.6.90.0070.07721.01
5.6.80.0000.05320.42
5.6.70.0100.06320.39
5.6.60.0130.04320.50
5.6.50.0030.08320.42
5.6.40.0170.03720.46
5.6.30.0170.05320.49
5.6.20.0000.08320.43
5.6.10.0030.08720.48
5.6.00.0030.07720.38
5.5.380.0070.04720.37
5.5.370.0030.07020.38
5.5.360.0070.05020.39
5.5.350.0130.08020.44
5.5.340.0130.08020.66
5.5.330.0100.04020.71
5.5.320.0100.07320.86
5.5.310.0100.08020.75
5.5.300.0100.04720.92
5.5.290.0130.07320.80
5.5.280.0170.05020.94
5.5.270.0070.08020.88
5.5.260.0100.09020.84
5.5.250.0100.03720.77
5.5.240.0030.04020.27
5.5.230.0030.04720.22
5.5.220.0070.06320.12
5.5.210.0030.06720.22
5.5.200.0070.04320.18
5.5.190.0070.04720.26
5.5.180.0100.04320.28
5.5.160.0100.07320.23
5.5.150.0030.08320.29
5.5.140.0030.07720.01
5.5.130.0070.07720.23
5.5.120.0200.03320.09
5.5.110.0070.08720.09
5.5.100.0030.08320.07
5.5.90.0070.06320.09
5.5.80.0070.06320.12
5.5.70.0130.03720.05
5.5.60.0000.07320.05
5.5.50.0100.07720.13
5.5.40.0000.07319.95
5.5.30.0070.06020.16
5.5.20.0200.07020.11
5.5.10.0130.05320.06
5.5.00.0070.04020.12
5.4.450.0070.06019.48
5.4.440.0130.07019.45
5.4.430.0070.06019.29
5.4.420.0130.07719.37
5.4.410.0070.07719.25
5.4.400.0130.06019.17
5.4.390.0030.06319.14
5.4.380.0070.07319.14
5.4.370.0100.05319.18
5.4.360.0130.07019.14
5.4.350.0070.04018.88
5.4.340.0100.07019.00
5.4.320.0030.07719.20
5.4.310.0130.05719.03
5.4.300.0070.04019.04
5.4.290.0070.07319.03
5.4.280.0070.04719.18
5.4.270.0030.07719.16
5.4.260.0100.06319.09
5.4.250.0070.04319.18
5.4.240.0070.04319.09
5.4.230.0200.04719.17
5.4.220.0030.04719.13
5.4.210.0130.06319.02
5.4.200.0030.05019.05
5.4.190.0100.07318.86
5.4.180.0070.07719.04
5.4.170.0070.07319.08
5.4.160.0100.07319.16
5.4.150.0070.07018.93
5.4.140.0070.07016.39
5.4.130.0100.06016.50
5.4.120.0030.04016.37
5.4.110.0100.07016.49
5.4.100.0070.07016.56
5.4.90.0170.06316.57
5.4.80.0100.06716.53
5.4.70.0000.08016.46
5.4.60.0030.04316.49
5.4.50.0070.07016.41
5.4.40.0100.03016.29
5.4.30.0070.07316.33
5.4.20.0030.04016.33
5.4.10.0030.03716.45
5.4.00.0030.05315.80
5.3.290.0100.04714.75
5.3.280.0100.07314.71
5.3.270.0070.06314.70
5.3.260.0070.07314.66
5.3.250.0030.07714.60
5.3.240.0030.07714.56
5.3.230.0000.08314.65
5.3.220.0070.04014.68
5.3.210.0070.07314.71
5.3.200.0070.08014.70
5.3.190.0030.07714.52
5.3.180.0130.07314.68
5.3.170.0130.03714.68
5.3.160.0030.07714.71
5.3.150.0000.08014.66
5.3.140.0000.05314.67
5.3.130.0070.08014.70
5.3.120.0100.05314.54
5.3.110.0070.07314.68
5.3.100.0000.08014.07
5.3.90.0070.04014.14
5.3.80.0000.07314.05
5.3.70.0100.04314.13
5.3.60.0030.04714.01
5.3.50.0030.04714.09
5.3.40.0100.07014.00
5.3.30.0070.03013.95
5.3.20.0130.06313.82
5.3.10.0070.05013.79
5.3.00.0100.06013.75
5.2.170.0030.04711.26
5.2.160.0070.05711.24
5.2.150.0030.06011.24
5.2.140.0070.06311.15
5.2.130.0200.04311.21
5.2.120.0030.06011.17
5.2.110.0030.06011.10
5.2.100.0000.03311.12
5.2.90.0030.06311.20
5.2.80.0070.06310.98
5.2.70.0100.05011.20
5.2.60.0000.04011.19
5.2.50.0030.03310.94
5.2.40.0070.06011.05
5.2.30.0030.06010.83
5.2.20.0000.06011.04
5.2.10.0030.05010.86
5.2.00.0030.06310.79
5.1.60.0030.05010.06
5.1.50.0000.04710.00
5.1.40.0000.03710.07
5.1.30.0070.04710.26
5.1.20.0000.05310.39
5.1.10.0070.04310.19
5.1.00.0000.0439.96
5.0.50.0030.0408.55
5.0.40.0030.0378.51
5.0.30.0030.0608.34
5.0.20.0070.0408.19
5.0.10.0030.0438.17
5.0.00.0030.0508.17
4.4.90.0000.0408.17
4.4.80.0030.0338.17
4.4.70.0000.0238.17
4.4.60.0030.0178.17
4.4.50.0070.0278.17
4.4.40.0070.0438.17
4.4.30.0030.0138.17
4.4.20.0030.0208.17
4.4.10.0030.0308.17
4.4.00.0030.0538.17
4.3.110.0000.0338.17
4.3.100.0070.0338.17
4.3.90.0030.0208.17
4.3.80.0070.0278.17
4.3.70.0070.0308.17
4.3.60.0070.0238.17
4.3.50.0030.0308.17
4.3.40.0030.0338.17
4.3.30.0000.0208.17
4.3.20.0030.0178.17
4.3.10.0030.0178.17
4.3.00.0030.0308.17

preferences:
47.38 ms | 403 KiB | 5 Q