3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Wems; class Session { const AUTH_HTTPUSERS = 0; const AUTH_PAM = 1; public static function validate( $sessionId ) { return wemshttpauth_validateSession($sessionId); } public static function authenticate($username, $password, $method=self::AUTH_HTTPUSERS) { return wemshttpauth_verifyUser($username, $password); } public static function createSession($username, $userLevel, $ipAddress="N/A") { return wemshttpauth_createSession($username, $ipAddress, $userLevel); } public static function getRoleName($userLevel) { /* TODO: Needs implementing properly */ switch ($userLevel) { case 0: return 'View'; break; case 1: return 'User'; break; case 2: return 'Admin'; break; case 3: return 'Robot'; break; default: return 'Unknown'; break; } } public static function getPrivileges($username) { /* TODO: Implement Privileges correctly */ return array('all','test');; } }

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.0140.00718.43
8.3.50.0090.01021.01
8.3.40.0090.01518.50
8.3.30.0070.00718.93
8.3.20.0040.00420.22
8.3.10.0050.00322.16
8.3.00.0000.00722.46
8.2.180.0150.00616.50
8.2.170.0070.00722.96
8.2.160.0070.00719.04
8.2.150.0030.00624.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00019.52
8.2.110.0000.00920.52
8.2.100.0070.00419.42
8.2.90.0070.00019.09
8.2.80.0030.00517.97
8.2.70.0040.00417.50
8.2.60.0030.00717.80
8.2.50.0070.00318.07
8.2.40.0000.00718.22
8.2.30.0000.00717.88
8.2.20.0040.00417.43
8.2.10.0040.00417.69
8.2.00.0090.00017.45
8.1.280.0070.00725.92
8.1.270.0040.00418.38
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0090.00023.92
8.1.230.0070.00319.00
8.1.220.0030.00617.74
8.1.210.0060.00318.77
8.1.200.0060.00317.23
8.1.190.0080.00017.40
8.1.180.0000.00818.49
8.1.170.0040.00418.66
8.1.160.0070.00022.22
8.1.150.0040.00418.53
8.1.140.0050.00317.21
8.1.130.0030.00617.80
8.1.120.0050.00317.32
8.1.110.0110.00017.41
8.1.100.0050.00317.38
8.1.90.0050.00217.38
8.1.80.0050.00317.38
8.1.70.0050.00317.23
8.1.60.0050.00317.52
8.1.50.0070.00017.39
8.1.40.0000.00717.40
8.1.30.0000.00817.35
8.1.20.0050.00317.54
8.1.10.0000.00717.50
8.1.00.0090.00317.23
8.0.300.0000.00718.77
8.0.290.0000.00717.05
8.0.280.0040.00418.35
8.0.270.0030.00317.22
8.0.260.0030.00316.73
8.0.250.0030.00316.86
8.0.240.0000.00816.74
8.0.230.0000.00716.85
8.0.220.0000.00716.75
8.0.210.0000.00716.77
8.0.200.0030.00316.90
8.0.190.0030.00316.77
8.0.180.0050.00316.75
8.0.170.0040.00416.72
8.0.160.0020.00516.76
8.0.150.0000.00716.71
8.0.140.0050.00316.70
8.0.130.0050.00013.16
8.0.120.0000.00816.72
8.0.110.0000.00816.76
8.0.100.0000.00716.73
8.0.90.0000.00716.86
8.0.80.0060.00916.69
8.0.70.0040.00416.77
8.0.60.0040.00416.86
8.0.50.0000.00716.57
8.0.30.0140.00416.98
8.0.20.0090.01017.40
8.0.10.0000.00716.86
8.0.00.0120.00516.72
7.4.330.0040.00015.00
7.4.320.0040.00416.41
7.4.300.0000.00616.50
7.4.290.0030.00316.55
7.4.280.0060.00316.37
7.4.270.0000.00716.50
7.4.260.0030.00316.43
7.4.250.0000.00716.38
7.4.240.0070.00016.49
7.4.230.0000.00716.14
7.4.220.0090.00616.27
7.4.210.0090.00616.44
7.4.200.0030.00316.48
7.4.190.0000.00716.55
7.4.160.0060.00916.56
7.4.150.0110.00617.40
7.4.140.0150.00817.86
7.4.130.0130.00716.28
7.4.120.0140.00316.42
7.4.110.0100.00716.31
7.4.100.0070.01016.21
7.4.90.0150.00716.50
7.4.80.0180.00419.39
7.4.70.0100.00716.46
7.4.60.0070.01116.45
7.4.50.0000.00516.37
7.4.40.0140.00322.77
7.4.30.0110.00516.44
7.4.00.0080.00515.00
7.3.330.0030.00313.19
7.3.320.0000.00513.15
7.3.310.0030.00316.22
7.3.300.0000.00716.14
7.3.290.0070.01316.16
7.3.280.0080.01116.21
7.3.270.0120.00417.40
7.3.260.0070.01316.14
7.3.250.0130.00916.21
7.3.240.0090.00816.13
7.3.230.0100.01016.43
7.3.210.0110.00516.35
7.3.200.0150.00819.39
7.3.190.0120.00616.20
7.3.180.0100.01316.45
7.3.170.0070.01016.29
7.3.160.0080.00816.16
7.3.120.0060.00614.77
7.2.330.0070.01016.25
7.2.320.0150.00316.24
7.2.310.0140.00316.46
7.2.300.0210.00316.52
7.2.290.0170.00016.61
7.2.00.0110.00719.00
7.1.100.0070.00417.78
7.1.70.0030.01216.72
7.1.60.0170.00719.82
7.1.50.0030.01016.95
7.1.00.0030.06322.45
7.0.200.0090.00316.65
7.0.140.0030.07021.96
7.0.60.0070.05019.96
7.0.50.0070.08317.87
7.0.40.0070.07320.09
7.0.30.0270.06720.11
7.0.20.0370.05320.08
7.0.10.0070.07320.16
7.0.00.0000.07720.14
5.6.280.0100.06721.16
5.6.210.0100.07720.48
5.6.200.0070.06018.21
5.6.190.0070.08720.58
5.6.180.0200.04320.34
5.6.170.0130.06020.55
5.6.160.0030.04320.44
5.6.150.0030.04018.19
5.6.140.0100.04318.15
5.6.130.0000.04718.18
5.6.120.0000.08021.00
5.6.110.0000.04721.12
5.6.100.0130.07721.04
5.6.90.0030.04021.04
5.6.80.0000.07320.39
5.5.350.0200.03720.44
5.5.340.0100.06717.99
5.5.330.0070.07720.31
5.5.320.0300.07020.34
5.5.310.0230.03720.19
5.5.300.0030.08318.04
5.5.290.0030.08718.05
5.5.280.0130.07020.89
5.5.270.0130.07720.68
5.5.260.0170.06720.67
5.5.250.0100.07720.59
5.5.240.0000.08720.30
5.4.450.0200.05319.46
5.4.440.0770.06019.48
5.4.430.0730.04719.60
5.4.420.0800.05319.54
5.4.410.0070.05718.73
5.4.400.0170.04718.54
5.4.390.0200.06318.74
5.4.380.0100.05318.75
5.4.370.0170.04318.80
5.4.360.0070.04018.77
5.4.350.0090.04512.03
5.4.340.0070.04212.02
5.4.320.0040.03712.51
5.4.310.0040.04112.50
5.4.300.0050.04012.51
5.4.290.0090.03912.51
5.4.280.0080.04112.40
5.4.270.0090.03812.40
5.4.260.0080.04112.41
5.4.250.0200.04018.98
5.4.240.0030.05018.79
5.4.230.0070.06319.09
5.4.220.0030.06718.64
5.4.210.0070.06318.91
5.4.200.0130.06718.79
5.4.190.0170.05718.98
5.4.180.0070.05718.75
5.4.170.0000.07319.01
5.4.160.0100.05018.80
5.4.150.0030.05718.77
5.4.140.0000.07316.47
5.4.130.0030.05016.46
5.4.120.0130.05316.56
5.4.110.0100.06716.43
5.4.100.0070.04716.50
5.4.90.0030.07316.33
5.4.80.0170.04316.40
5.4.70.0100.06016.39
5.4.60.0100.04716.39
5.4.50.0100.05016.46
5.4.40.0030.07016.43
5.4.30.0030.06316.62
5.4.20.0030.06016.30
5.4.10.0170.05716.53
5.4.00.0130.06015.90
5.3.290.0050.04112.80
5.3.280.0100.04714.74
5.3.270.0030.05714.45
5.3.260.0100.05014.66
5.3.250.0070.06714.80
5.3.240.0100.07014.70
5.3.230.0100.04714.70
5.3.220.0030.05014.41
5.3.210.0070.05314.58
5.3.200.0100.05014.71
5.3.190.0030.05014.60
5.3.180.0130.04014.74
5.3.170.0100.04314.71
5.3.160.0130.04314.48
5.3.150.0030.05014.56
5.3.140.0100.04714.55
5.3.130.0070.04714.64
5.3.120.0070.07314.48
5.3.110.0070.06714.73
5.3.100.0070.06714.03
5.3.90.0170.04714.19
5.3.80.0030.05314.09
5.3.70.0000.06314.25
5.3.60.0130.05714.09
5.3.50.0200.05314.12
5.3.40.0000.05713.97
5.3.30.0000.05713.89
5.3.20.0070.05313.67
5.3.10.0070.04313.64
5.3.00.0000.07713.73
5.2.170.0130.04711.14
5.2.160.0000.04011.13
5.2.150.0100.03711.03
5.2.140.0100.05311.04
5.2.130.0000.04711.11
5.2.120.0000.04011.11
5.2.110.0030.03711.11
5.2.100.0070.03711.09
5.2.90.0030.03711.25
5.2.80.0030.05310.99
5.2.70.0100.03310.99
5.2.60.0070.03711.07
5.2.50.0030.04311.03
5.2.40.0030.04711.09
5.2.30.0030.05010.73
5.2.20.0070.03710.71
5.2.10.0030.03710.62
5.2.00.0070.03710.70
5.1.60.0030.0339.76
5.1.50.0000.0339.76
5.1.40.0070.0339.86
5.1.30.0070.03710.17
5.1.20.0130.03010.27
5.1.10.0000.04710.25
5.1.00.0030.0379.95
5.0.50.0130.0208.57
5.0.40.0070.0238.43
5.0.30.0030.0408.11
5.0.20.0030.0238.28
5.0.10.0030.0278.00
5.0.00.0070.0478.24
4.4.90.0000.0307.12
4.4.80.0030.0207.12
4.4.70.0000.0237.12
4.4.60.0030.0207.12
4.4.50.0030.0207.12
4.4.40.0070.0277.12
4.4.30.0000.0237.12
4.4.20.0030.0207.12
4.4.10.0000.0207.12
4.4.00.0000.0407.12
4.3.110.0030.0207.12
4.3.100.0000.0207.12
4.3.90.0030.0277.12
4.3.80.0000.0337.12
4.3.70.0000.0237.12
4.3.60.0000.0307.12
4.3.50.0000.0307.12
4.3.40.0000.0337.12
4.3.30.0100.0137.12
4.3.20.0000.0237.12
4.3.10.0000.0237.12
4.3.00.0070.0177.12

preferences:
37.48 ms | 401 KiB | 5 Q