3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getBrowser() { $u_agent = $_SERVER['HTTP_USER_AGENT']; $bname = 'Unknown'; $platform = 'Unknown'; $version= ""; //First get the platform? if (preg_match('/linux/i', $u_agent)) { $platform = 'linux'; } elseif (preg_match('/macintosh|mac os x/i', $u_agent)) { $platform = 'mac'; } elseif (preg_match('/windows|win32/i', $u_agent)) { $platform = 'windows'; } // Next get the name of the useragent yes seperately and for good reason if(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent)) { $bname = 'Internet Explorer'; $ub = "MSIE"; } elseif(preg_match('/Firefox/i',$u_agent)) { $bname = 'Mozilla Firefox'; $ub = "Firefox"; } elseif(preg_match('/Chrome/i',$u_agent)) { $bname = 'Google Chrome'; $ub = "Chrome"; } elseif(preg_match('/Safari/i',$u_agent)) { $bname = 'Apple Safari'; $ub = "Safari"; } elseif(preg_match('/Opera/i',$u_agent)) { $bname = 'Opera'; $ub = "Opera"; } elseif(preg_match('/Netscape/i',$u_agent)) { $bname = 'Netscape'; $ub = "Netscape"; } // finally get the correct version number $known = array('Version', $ub, 'other'); $pattern = '#(?<browser>' . join('|', $known) . ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#'; if (!preg_match_all($pattern, $u_agent, $matches)) { // we have no matching number just continue } // see how many we have $i = count($matches['browser']); if ($i != 1) { //we will have two since we are not using 'other' argument yet //see if version is before or after the name if (strripos($u_agent,"Version") < strripos($u_agent,$ub)){ $version= $matches['version'][0]; } else { $version= $matches['version'][1]; } } else { $version= $matches['version'][0]; } // check if we have a number if ($version==null || $version=="") {$version="?";} return array( 'userAgent' => $u_agent, 'name' => $bname, 'version' => $version, 'platform' => $platform, 'pattern' => $pattern ); } // now try it $ua=getBrowser(); $yourbrowser= "Your browser: " . $ua['name'] . " " . $ua['version'] . " on " .$ua['platform'] . " reports: <br >" . $ua['userAgent']; print_r($yourbrowser); ?>

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.0120.00317.13
8.3.50.0130.00823.12
8.3.40.0150.00019.03
8.3.30.0080.00819.27
8.3.20.0040.00420.33
8.3.10.0040.00423.61
8.3.00.0080.00019.63
8.2.180.0140.00718.53
8.2.170.0110.00722.96
8.2.160.0120.00320.47
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0070.00021.02
8.2.110.0030.01422.29
8.2.100.0110.00018.41
8.2.90.0070.00319.19
8.2.80.0090.00018.00
8.2.70.0000.00817.88
8.2.60.0050.00317.93
8.2.50.0040.00418.07
8.2.40.0030.00520.09
8.2.30.0000.00818.22
8.2.20.0030.00617.98
8.2.10.0000.00818.14
8.2.00.0000.00818.00
8.1.280.0160.00625.92
8.1.270.0080.00023.96
8.1.260.0030.00726.35
8.1.250.0000.00828.09
8.1.240.0030.00723.88
8.1.230.0060.00619.28
8.1.220.0050.00318.03
8.1.210.0050.00318.77
8.1.200.0130.00017.72
8.1.190.0050.00317.60
8.1.180.0030.00618.10
8.1.170.0050.00318.81
8.1.160.0040.00422.14
8.1.150.0050.00319.04
8.1.140.0040.00417.71
8.1.130.0070.00018.05
8.1.120.0000.00717.63
8.1.110.0050.00317.55
8.1.100.0000.00817.64
8.1.90.0080.00017.71
8.1.80.0050.00317.62
8.1.70.0050.00317.52
8.1.60.0000.00817.84
8.1.50.0050.00317.65
8.1.40.0030.00617.71
8.1.30.0050.00317.83
8.1.20.0080.00017.77
8.1.10.0050.00317.82
8.1.00.0030.00617.69
8.0.300.0040.00418.77
8.0.290.0000.00717.00
8.0.280.0000.00818.44
8.0.270.0070.00017.24
8.0.260.0030.00317.21
8.0.250.0000.00717.13
8.0.240.0000.00717.13
8.0.230.0000.00717.19
8.0.220.0070.00017.22
8.0.210.0030.00317.04
8.0.200.0070.00017.20
8.0.190.0080.00017.20
8.0.180.0000.00717.08
8.0.170.0040.00417.09
8.0.160.0000.00717.19
8.0.150.0040.00417.05
8.0.140.0040.00417.09
8.0.130.0030.00313.63
8.0.120.0040.00417.16
8.0.110.0080.00017.18
8.0.100.0040.00417.11
8.0.90.0000.00717.14
8.0.80.0080.00817.10
8.0.70.0000.00817.17
8.0.60.0050.00317.00
8.0.50.0050.00317.24
8.0.30.0100.01017.43
8.0.20.0110.00817.40
8.0.10.0000.00817.13
8.0.00.0100.01017.24
7.4.330.0050.00015.25
7.4.320.0040.00416.94
7.4.300.0030.00316.98
7.4.290.0000.00716.84
7.4.280.0040.00416.73
7.4.270.0030.00316.99
7.4.260.0040.00416.95
7.4.250.0000.00916.90
7.4.240.0050.00216.85
7.4.230.0000.00816.82
7.4.220.0040.02216.93
7.4.210.0120.00616.86
7.4.200.0040.00417.02
7.4.160.0090.00616.71
7.4.150.0110.00817.40
7.4.140.0090.00817.86
7.4.130.0100.00716.80
7.4.120.0090.00916.83
7.4.110.0060.01916.65
7.4.100.0140.00316.71
7.4.90.0120.00616.86
7.4.80.0150.00919.39
7.4.70.0080.01116.75
7.4.60.0090.00916.85
7.4.50.0000.00516.54
7.4.40.0060.01316.74
7.4.30.0140.00716.82
7.4.00.0000.01515.04
7.3.330.0060.00013.40
7.3.320.0050.00013.57
7.3.310.0070.00016.52
7.3.300.0040.00416.71
7.3.290.0120.00916.61
7.3.280.0110.00616.63
7.3.270.0120.00617.40
7.3.260.0150.00316.89
7.3.250.0090.01116.76
7.3.240.0060.01216.69
7.3.230.0100.00616.69
7.3.210.0090.00916.62
7.3.200.0040.01319.39
7.3.190.0030.02016.71
7.3.180.0130.00816.64
7.3.170.0100.00716.66
7.3.160.0030.01416.79
7.2.330.0090.00916.96
7.2.320.0070.01316.82
7.2.310.0000.01816.98
7.2.300.0040.01416.84
7.2.290.0150.00916.79
7.2.120.0090.00616.66
7.2.110.0060.00916.88
7.2.100.0100.00616.67
7.2.90.0090.00616.86
7.2.80.0080.00517.07
7.2.70.0060.00616.98
7.2.60.0070.00816.94
7.2.50.0030.01017.15
7.2.40.0110.00417.30
7.2.30.0030.01117.14
7.2.20.0070.01017.14
7.2.10.0000.01617.09
7.2.00.0050.00918.50
7.1.240.0070.00716.23
7.1.230.0030.01016.04
7.1.220.0100.00315.93
7.1.210.0060.00315.94
7.1.200.0110.00915.73
7.1.190.0030.01016.20
7.1.180.0040.00716.02
7.1.170.0030.01316.01
7.1.160.0090.00616.03
7.1.150.0040.00816.15
7.1.140.0000.01415.71
7.1.130.0070.00716.16
7.1.120.0040.01115.80
7.1.110.0100.00615.76
7.1.100.0020.01217.29
7.1.90.0100.00316.01
7.1.80.0090.00316.15
7.1.70.0070.00616.74
7.1.60.0070.01017.77
7.1.50.0070.00716.67
7.1.40.0090.00015.91
7.1.30.0100.00316.13
7.1.20.0030.01015.72
7.1.10.0050.00515.97
7.1.00.0080.03519.21
7.0.320.0060.00315.63
7.0.310.0060.00915.49
7.0.300.0060.00615.70
7.0.290.0090.00615.59
7.0.280.0080.00315.63
7.0.270.0070.00315.64
7.0.260.0040.01115.78
7.0.250.0030.00715.38
7.0.240.0040.00415.55
7.0.230.0030.01215.75
7.0.220.0060.00615.53
7.0.210.0040.00815.52
7.0.200.0050.00516.06
7.0.190.0060.00615.60
7.0.180.0060.00915.31
7.0.170.0090.00615.75
7.0.160.0040.01215.59
7.0.150.0080.00315.79
7.0.140.0070.04018.91
7.0.130.0030.00715.33
7.0.120.0080.00415.53
7.0.110.0000.01515.75
7.0.100.0040.01115.59
7.0.90.0090.00315.77
7.0.80.0090.00615.54
7.0.70.0050.00515.72
7.0.60.0040.03417.59
7.0.50.0050.04516.90
7.0.40.0100.04516.91
7.0.30.0340.03416.90
7.0.20.0180.04417.09
7.0.10.0050.03816.80
7.0.00.0080.04116.89
5.6.380.0030.01014.51
5.6.370.0000.00914.61
5.6.360.0030.01014.78
5.6.350.0060.00614.67
5.6.340.0030.01014.10
5.6.330.0030.01014.74
5.6.320.0030.01014.28
5.6.310.0030.00914.46
5.6.300.0030.00714.73
5.6.290.0030.01014.86
5.6.280.0020.04317.87
5.6.270.0070.00714.46
5.6.260.0070.00414.73
5.6.250.0060.00314.67
5.6.240.0080.00014.38
5.6.230.0090.00614.75
5.6.220.0060.00614.39
5.6.210.0120.04017.54
5.6.200.0020.03416.22
5.6.190.0080.03617.58
5.6.180.2100.02317.51
5.6.170.0170.04317.48
5.6.160.0070.02317.54
5.6.150.0050.03216.44
5.6.140.0080.02716.44
5.6.130.0050.04816.38
5.6.120.0100.04117.74
5.6.110.0130.03917.72
5.6.100.0060.03017.72
5.6.90.0120.03217.75
5.6.80.0080.02817.38
5.6.70.0060.00314.27
5.6.60.0070.00714.52
5.6.50.0060.00614.14
5.6.40.0030.00914.22
5.6.30.0030.00914.38
5.6.20.0110.00414.16
5.6.10.0100.00314.41
5.6.00.0000.01414.37
5.5.380.0030.00711.29
5.5.370.0120.00011.48
5.5.360.0000.00611.07
5.5.350.0140.04215.92
5.5.340.0090.04314.66
5.5.330.0050.04615.85
5.5.320.0240.01915.78
5.5.310.0130.03515.88
5.5.300.0050.04714.61
5.5.290.0050.02214.66
5.5.280.0100.03216.03
5.5.270.0030.02216.05
5.5.260.0020.02416.00
5.5.250.0050.04316.01
5.5.240.0150.03715.79
5.5.230.0030.00911.29
5.5.220.0030.00311.42
5.5.210.0000.00611.40
5.5.200.0000.00611.34
5.5.190.0060.00311.25
5.5.180.0000.01111.36
5.5.170.0120.00314.26
5.5.160.0070.00711.16
5.5.150.0060.00611.36
5.5.140.0030.00311.35
5.5.130.0030.00711.18
5.5.120.0030.00611.21
5.5.110.0060.00011.34
5.5.100.0100.00011.07
5.5.90.0030.00311.07
5.5.80.0000.01111.07
5.5.70.0080.00311.29
5.5.60.0070.00311.07
5.5.50.0070.00011.19
5.5.40.0000.00911.32
5.5.30.0030.00311.07
5.5.20.0000.00611.17
5.5.10.0030.00711.53
5.5.00.0030.00311.07
5.4.450.0180.02315.47
5.4.440.0230.02515.32
5.4.430.0180.02815.38
5.4.420.0090.02815.48
5.4.410.0260.02315.30
5.4.400.0140.02015.15
5.4.390.0210.02415.08
5.4.380.0260.02314.97
5.4.370.0400.03314.94
5.4.360.0280.03115.02
5.4.350.0270.03515.07
5.4.340.0140.03414.94
5.4.330.0070.00411.37
5.4.320.0070.02111.80
5.4.310.0090.01911.89
5.4.300.0080.01911.96
5.4.290.0070.02311.88
5.4.280.0070.02111.91
5.4.270.0070.02011.75
5.4.260.0080.02111.84
5.4.250.0080.02211.82
5.4.240.0040.02211.84
5.4.230.0050.02411.84
5.4.220.0080.02011.74
5.4.210.0070.02011.85
5.4.200.0090.02311.74
5.4.190.0060.02211.90
5.4.180.0050.02211.74
5.4.170.0050.02211.81
5.4.160.0070.02111.74
5.4.150.0060.02111.74
5.4.140.0090.02111.74
5.4.130.0060.02411.59
5.4.120.0070.02011.57
5.4.110.0110.02011.66
5.4.100.0080.02111.55
5.4.90.0060.02111.55
5.4.80.0070.02411.55
5.4.70.0090.01811.66
5.4.60.0040.02211.57
5.4.50.0060.02511.55
5.4.40.0080.01911.55
5.4.30.0070.02311.61
5.4.20.0080.02211.54
5.4.10.0050.02311.55
5.4.00.0070.02111.29
5.3.290.0070.02111.94
5.3.280.0060.02211.89
5.3.270.0070.02111.90
5.3.260.0090.02011.90
5.3.250.0080.02211.90
5.3.240.0070.02011.90
5.3.230.0050.02311.89
5.3.220.0080.02011.88
5.3.210.0060.02311.88
5.3.200.0080.02111.88
5.3.190.0050.02211.88
5.3.180.0080.02011.88
5.3.170.0070.02111.88
5.3.160.0070.02311.88
5.3.150.0060.01911.88
5.3.140.0080.01911.87
5.3.130.0060.02311.87
5.3.120.0090.02111.87
5.3.110.0040.02511.87
5.3.100.0080.02011.61
5.3.90.0070.01811.60
5.3.80.0050.02111.60
5.3.70.0070.01911.60
5.3.60.0080.01911.59
5.3.50.0070.02011.56
5.3.40.0080.02011.56
5.3.30.0060.02111.55
5.3.20.0080.01911.43
5.3.10.0080.02011.42
5.3.00.0070.02111.41
5.2.170.0070.01810.16
5.2.160.0080.01810.16
5.2.150.0020.02110.16
5.2.140.0050.01910.16
5.2.130.0060.01910.14
5.2.120.0120.01310.14
5.2.110.0090.01610.15
5.2.100.0070.01710.14
5.2.90.0050.01810.14
5.2.80.0040.01910.14
5.2.70.0070.02010.14
5.2.60.0060.01810.12
5.2.50.0030.01810.10
5.2.40.0050.01710.10
5.2.30.0070.01610.08
5.2.20.0040.01810.07
5.2.10.0040.01910.02
5.2.00.0070.0159.95
5.1.60.0020.0159.59
5.1.50.0060.0159.59
5.1.40.0050.0159.58
5.1.30.0040.0189.75
5.1.20.0040.0229.77
5.1.10.0050.0159.63
5.1.00.0050.0169.63
5.0.50.0070.0108.87
5.0.40.0080.0128.80
5.0.30.0060.0168.71
5.0.20.0070.0108.69
5.0.10.0040.0118.68
5.0.00.0050.0168.67
4.4.90.0020.0117.93
4.4.80.0040.0117.92
4.4.70.0010.0137.91
4.4.60.0030.0087.92
4.4.50.0020.0117.92
4.4.40.0030.0147.89
4.4.30.0040.0087.92
4.4.20.0010.0107.96
4.4.10.0020.0117.96
4.4.00.0030.0147.92
4.3.110.0040.0107.87
4.3.100.0020.0127.87
4.3.90.0030.0107.85
4.3.80.0020.0157.83
4.3.70.0020.0127.85
4.3.60.0040.0097.85
4.3.50.0030.0117.85
4.3.40.0020.0177.80
4.3.30.0010.0157.21
4.3.20.0040.0087.20
4.3.10.0030.0077.17
4.3.00.0030.01213.36

preferences:
42.21 ms | 401 KiB | 5 Q