3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getUserAgent() { $agent = null; if ( empty($agent) ) { $agent = $_SERVER['HTTP_USER_AGENT']; if ( stripos($agent, 'Firefox') !== false ) { $agent = 'firefox'; } elseif ( stripos($agent, 'MSIE') !== false ) { $agent = 'ie'; } elseif ( stripos($agent, 'iPad') !== false ) { $agent = 'ipad'; } elseif ( stripos($agent, 'Android') !== false ) { $agent = 'android'; } elseif ( stripos($agent, 'Chrome') !== false ) { $agent = 'chrome'; } elseif ( stripos($agent, 'Safari') !== false ) { $agent = 'safari'; } elseif ( stripos($agent, 'AIR') !== false ) { $agent = 'air'; } elseif ( stripos($agent, 'Fluid') !== false ) { $agent = 'fluid'; } } return $agent; } echo getUserAgent(); ?>

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.40.0110.00418.83
8.3.30.0120.00919.09
8.3.20.0040.00420.16
8.3.10.0040.00421.92
8.3.00.0040.00422.31
8.2.170.0070.00722.96
8.2.160.0130.00318.95
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0080.00019.38
8.2.110.0000.00922.26
8.2.100.0040.00817.84
8.2.90.0050.00318.16
8.2.80.0030.00517.97
8.2.70.0000.00917.75
8.2.60.0040.00418.04
8.2.50.0040.00418.07
8.2.40.0050.00318.28
8.2.30.0040.00418.09
8.2.20.0040.00417.73
8.2.10.0000.00819.64
8.2.00.0060.00317.82
8.1.270.0040.00422.14
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00322.64
8.1.230.0040.00820.86
8.1.220.0040.00417.74
8.1.210.0050.00318.78
8.1.200.0030.00717.36
8.1.190.0080.00017.39
8.1.180.0000.00918.60
8.1.170.0090.00018.51
8.1.160.0050.00322.01
8.1.150.0040.00418.68
8.1.140.0040.00417.43
8.1.130.0000.00717.88
8.1.120.0040.00317.37
8.1.110.0040.00417.37
8.1.100.0070.00017.50
8.1.90.0040.00417.49
8.1.80.0070.00017.52
8.1.70.0060.00017.45
8.1.60.0030.00617.50
8.1.50.0040.00417.48
8.1.40.0000.00817.50
8.1.30.0040.00417.48
8.1.20.0040.00417.51
8.1.10.0040.00417.52
8.1.00.0040.00417.41
8.0.300.0040.00420.04
8.0.290.0000.00717.05
8.0.280.0030.00318.45
8.0.270.0000.00717.27
8.0.260.0030.00316.96
8.0.250.0070.00016.97
8.0.240.0050.00317.05
8.0.230.0040.00416.92
8.0.220.0040.00317.00
8.0.210.0030.00316.86
8.0.200.0000.00717.01
8.0.190.0040.00417.02
8.0.180.0000.00716.84
8.0.170.0080.00016.96
8.0.160.0000.00916.81
8.0.150.0030.00316.86
8.0.140.0000.00716.81
8.0.130.0050.00213.39
8.0.120.0040.00416.89
8.0.110.0040.00416.92
8.0.100.0030.00617.00
8.0.90.0040.00416.79
8.0.80.0120.00417.03
8.0.70.0040.00416.96
8.0.60.0050.00316.80
8.0.50.0000.00717.07
8.0.30.0110.00817.14
8.0.20.0070.01217.40
8.0.10.0040.00416.92
8.0.00.0150.00816.81
7.4.330.0020.00215.00
7.4.320.0030.00316.52
7.4.300.0000.00616.58
7.4.290.0040.00416.48
7.4.280.0070.00016.47
7.4.270.0060.00016.55
7.4.260.0040.00416.65
7.4.250.0000.00816.55
7.4.240.0020.00616.50
7.4.230.0070.00016.58
7.4.220.0060.01216.64
7.4.210.0110.00716.62
7.4.200.0000.00716.46
7.4.190.0000.00716.53
7.4.160.0120.00316.42
7.4.150.0060.01217.40
7.4.140.0170.00617.86
7.4.130.0140.00316.53
7.4.120.0070.01016.55
7.4.110.0090.00816.46
7.4.100.0070.01716.70
7.4.90.0130.01016.63
7.4.80.0060.01119.39
7.4.70.0040.01316.62
7.4.60.0130.00316.47
7.4.50.0030.00616.39
7.4.40.0030.01322.77
7.4.30.0060.01016.36
7.4.10.0080.00814.71
7.4.00.0060.01115.03
7.3.330.0000.00513.22
7.3.320.0030.00213.25
7.3.310.0000.00716.45
7.3.300.0030.00316.38
7.3.290.0100.00916.43
7.3.280.0090.00716.32
7.3.270.0100.00717.40
7.3.260.0060.01216.44
7.3.250.0120.00816.46
7.3.240.0060.01016.33
7.3.230.0080.00816.39
7.3.210.0160.00716.50
7.3.200.0090.01219.39
7.3.190.0150.00016.45
7.3.180.0090.00616.48
7.3.170.0160.00016.50
7.3.160.0110.00516.36
7.3.130.0090.00914.87
7.3.120.0070.00814.84
7.3.110.0050.01114.80
7.3.100.0050.00914.73
7.3.90.0060.00914.88
7.3.80.0080.00514.69
7.3.70.0060.00414.86
7.3.60.0020.01414.75
7.3.50.0080.00814.65
7.3.40.0030.00714.63
7.3.30.0100.00514.72
7.3.20.0050.00816.69
7.3.10.0060.00616.54
7.3.00.0060.00716.62
7.2.330.0090.00916.68
7.2.320.0130.01016.86
7.2.310.0090.00616.46
7.2.300.0030.01316.77
7.2.290.0070.01016.76
7.2.260.0070.01115.14
7.2.250.0050.01114.92
7.2.240.0070.00914.92
7.2.230.0100.00614.91
7.2.220.0050.01015.08
7.2.210.0030.01014.82
7.2.200.0070.00315.12
7.2.190.0080.00814.91
7.2.180.0070.00614.95
7.2.170.0060.00814.82
7.2.160.0030.00714.89
7.2.150.0110.00417.07
7.2.140.0080.00516.71
7.2.130.0070.00716.79
7.2.120.0090.00616.94
7.2.110.0030.01016.55
7.2.100.0040.00916.99
7.2.90.0070.00717.06
7.2.80.0110.00717.06
7.2.70.0070.00717.05
7.2.60.0090.00716.89
7.2.50.0070.00717.04
7.2.40.0030.00916.72
7.2.30.0070.00716.93
7.2.20.0070.01116.94
7.2.10.0030.01016.98
7.2.00.0060.00918.25
7.1.330.0050.00715.76
7.1.320.0020.01115.64
7.1.310.0030.01115.57
7.1.300.0090.00715.71
7.1.290.0040.01215.83
7.1.280.0020.01115.70
7.1.270.0050.00915.79
7.1.260.0070.00515.81
7.1.250.0100.00615.61
7.1.240.0040.01115.84
7.1.230.0070.00315.75
7.1.220.0030.00615.88
7.1.210.0090.00915.55
7.1.200.0060.00815.76
7.1.190.0090.00415.75
7.1.180.0070.00715.73
7.1.170.0090.00316.04
7.1.160.0090.00015.74
7.1.150.0000.01415.80
7.1.140.0040.00815.93
7.1.130.0030.00915.86
7.1.120.0040.01115.67
7.1.110.0100.00015.79
7.1.100.0040.00717.02
7.1.90.0110.00315.63
7.1.80.0030.00715.79
7.1.70.0020.01016.28
7.1.60.0040.01317.84
7.1.50.0110.00916.36
7.1.40.0090.00915.91
7.1.30.0040.01115.82
7.1.20.0000.01815.68
7.1.10.0000.01415.86
7.1.00.0070.04218.93
7.0.330.0070.00415.45
7.0.320.0030.00915.33
7.0.310.0030.00615.38
7.0.300.0100.00315.25
7.0.290.0040.00415.39
7.0.280.0060.00915.16
7.0.270.0070.00415.47
7.0.260.0000.01115.42
7.0.250.0070.01015.23
7.0.240.0030.01015.38
7.0.230.0060.00315.32
7.0.220.0040.00815.46
7.0.210.0040.00415.27
7.0.200.0060.00715.89
7.0.190.0090.00915.41
7.0.180.0030.01215.53
7.0.170.0000.01715.02
7.0.160.0040.00415.32
7.0.150.0030.00915.16
7.0.140.0060.03918.66
7.0.130.0040.00415.14
7.0.120.0030.00915.23
7.0.110.0060.00615.30
7.0.100.0000.00915.54
7.0.90.0040.00415.38
7.0.80.0060.00915.43
7.0.70.0060.00615.38
7.0.60.0070.04017.67
7.0.50.0060.02516.72
7.0.40.0050.04216.91
7.0.30.0160.03916.81
7.0.20.0100.02616.83
7.0.10.0030.03016.68
7.0.00.0030.05016.86
5.6.400.0100.00314.30
5.6.390.0070.00314.64
5.6.380.0070.00714.00
5.6.370.0030.00514.41
5.6.360.0030.01014.20
5.6.350.0100.00714.03
5.6.340.0160.00014.33
5.6.330.0000.01014.32
5.6.320.0090.00614.66
5.6.310.0100.00314.71
5.6.300.0030.00814.45
5.6.290.0030.01314.27
5.6.280.0020.04217.71
5.6.270.0030.00614.50
5.6.260.0000.00914.40
5.6.250.0030.00914.39
5.6.240.0000.01214.44
5.6.230.0080.00314.28
5.6.220.0040.01114.45
5.6.210.0060.04417.51
5.6.200.0020.03216.33
5.6.190.0080.02717.52
5.6.180.0110.01817.53
5.6.170.0150.02017.46
5.6.160.0100.04317.53
5.6.150.0080.02416.11
5.6.140.0080.02316.21
5.6.130.0110.03616.41
5.6.120.0080.03617.71
5.6.110.0050.04817.58
5.6.100.0060.03417.66
5.6.90.0120.04017.87
5.6.80.0020.03717.46
5.6.70.0090.00014.02
5.6.60.0070.00714.39
5.6.50.0070.00314.46
5.6.40.0000.01214.48
5.6.30.0030.01014.49
5.6.20.0000.01214.34
5.6.10.0040.00714.27
5.6.00.0030.01014.09
5.5.380.0040.00813.94
5.5.370.0070.00314.27
5.5.360.0070.00713.73
5.5.350.0080.04317.20
5.5.340.0110.04016.09
5.5.330.0050.03717.31
5.5.320.0150.02517.25
5.5.310.0220.02417.28
5.5.300.0030.03916.07
5.5.290.0080.02115.98
5.5.280.0060.04117.61
5.5.270.0070.04217.56
5.5.260.0020.02917.63
5.5.250.0090.04317.46
5.5.240.0090.01817.17
5.5.230.0070.00714.04
5.5.220.0110.00413.74
5.5.210.0040.00713.94
5.5.200.0000.01314.00
5.5.190.0030.00714.37
5.5.180.0100.00313.99
5.5.170.0070.00314.50
5.5.160.0030.00714.33
5.5.150.0060.00614.29
5.5.140.0050.00514.11
5.5.130.0030.00714.44
5.5.120.0070.00714.21
5.5.110.0070.01114.04
5.5.100.0040.01114.24
5.5.90.0140.00014.21
5.5.80.0060.00614.28
5.5.70.0090.00314.33
5.5.60.0030.01213.98
5.5.50.0060.01014.39
5.5.40.0070.01014.36
5.5.30.0070.01014.09
5.5.20.0070.00713.92
5.5.10.0080.00814.13
5.5.00.0090.00314.05
5.4.450.0280.03415.92
5.4.440.0250.03615.94
5.4.430.0130.03715.83
5.4.420.0040.03415.89
5.4.410.0080.02715.78
5.4.400.0480.00015.40
5.4.390.0430.00515.52
5.4.380.0480.03515.51
5.4.370.0480.03315.37
5.4.360.0540.03215.52
5.4.350.0650.02215.41
5.4.340.0520.02815.50
5.4.330.0000.00912.24
5.4.320.0070.02012.38
5.4.310.0050.02112.38
5.4.300.0070.02012.38
5.4.290.0050.02412.37
5.4.280.0050.02012.32
5.4.270.0070.02915.55
5.4.260.0100.03515.52
5.4.250.0030.03115.62
5.4.240.0060.03315.52
5.4.230.0020.04315.59
5.4.220.0080.03115.43
5.4.210.0070.03115.60
5.4.200.0080.03015.62
5.4.190.0020.03515.51
5.4.180.0050.03015.63
5.4.170.0150.02215.59
5.4.160.0130.03215.50
5.4.150.0150.02715.51
5.4.140.0120.03514.29
5.4.130.0070.02714.30
5.4.120.0080.02314.40
5.4.110.0070.02514.41
5.4.100.0050.02814.35
5.4.90.0100.03214.37
5.4.80.0030.03814.38
5.4.70.0030.02814.32
5.4.60.0030.03614.36
5.4.50.0090.03314.35
5.4.40.0090.02814.33
5.4.30.0050.03714.36
5.4.20.0110.03314.37
5.4.10.0070.03514.36
5.4.00.0070.03714.04
5.3.290.0040.02412.52
5.3.280.0090.03213.43
5.3.270.0100.03613.43
5.3.260.0070.02713.38
5.3.250.0120.03313.52
5.3.240.0100.02513.54
5.3.230.0110.02813.34
5.3.220.0100.02613.40
5.3.210.0070.04113.45
5.3.200.0100.03613.49
5.3.190.0070.03013.45
5.3.180.0080.02213.48
5.3.170.0070.03113.52
5.3.160.0070.03713.40
5.3.150.0050.03013.32
5.3.140.0050.02813.41
5.3.130.0050.03013.39
5.3.120.0060.02913.40
5.3.110.0050.03113.40
5.3.100.0070.02313.22
5.3.90.0060.02613.25
5.3.80.0060.02813.18
5.3.70.0080.02613.22
5.3.60.0120.03213.23
5.3.50.0030.03113.05
5.3.40.0070.03313.12
5.3.30.0070.03213.16
5.3.20.0080.02212.99
5.3.10.0030.02912.95
5.3.00.0070.02512.98
5.2.170.0100.05711.21
5.2.160.0170.04311.22
5.2.150.0030.04011.23
5.2.140.0070.04011.23
5.2.130.0130.03311.19
5.2.120.0100.05311.14
5.2.110.0000.04711.19
5.2.100.0030.05711.19
5.2.90.0070.04011.19
5.2.80.0000.05011.07
5.2.70.0030.04011.19
5.2.60.0030.04311.16
5.2.50.0070.04010.94
5.2.40.0000.04311.10
5.2.30.0130.05011.20
5.2.20.0130.03010.95
5.2.10.0070.05010.82
5.2.00.0070.03710.90
5.1.60.0130.03710.00
5.1.50.0030.0379.96
5.1.40.0070.04310.08
5.1.30.0200.02010.41
5.1.20.0070.05010.27
5.1.10.0130.04010.04
5.1.00.0030.0409.91
5.0.50.0070.0378.65
5.0.40.0030.0408.39
5.0.30.0070.0408.29
5.0.20.0070.0338.27
5.0.10.0100.0278.26
5.0.00.0070.0508.27
4.4.90.0030.0236.59
4.4.80.0000.0236.59
4.4.70.0000.0306.59
4.4.60.0000.0336.59
4.4.50.0000.0306.59
4.4.40.0070.0306.59
4.4.30.0000.0306.59
4.4.20.0100.0236.59
4.4.10.0070.0206.58
4.4.00.0100.0276.58
4.3.110.0030.0236.58
4.3.100.0030.0206.58
4.3.90.0100.0236.58
4.3.80.0070.0406.58
4.3.70.0030.0276.58
4.3.60.0000.0236.58
4.3.50.0070.0276.58
4.3.40.0030.0476.58
4.3.30.0030.0206.58
4.3.20.0000.0236.57
4.3.10.0070.0176.58
4.3.00.0100.0207.12

preferences:
44.14 ms | 400 KiB | 5 Q