3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CryptToken { private static $instance; private $crypt; private $token; private $context; public function __construct() { $this->InitCrypt(); } private function InitCrypt() { $this->crypt = (object)array(); $this->crypt->key = hash('sha512', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); } public static function GetInstance() { if(!isset(self::$instance)) { self::$instance = new self(); } return self::$instance; } public function Decrypt($buffer) { return mcrypt_decrypt(MCRYPT_RIJNDAEL_256, pack('H*', substr($this->crypt->key, 0, 64)), base64_decode($buffer), MCRYPT_MODE_OFB, pack('H*', substr($this->crypt->key, -64))); } public function Crypt($buffer) { return base64_encode( mcrypt_encrypt(MCRYPT_RIJNDAEL_256, pack('H*', substr($this->crypt->key, 0, 64)), $buffer, MCRYPT_MODE_OFB, pack('H*', substr($this->crypt->key, -64)))); } public function ParseToken($token) { $this->token = explode('|', $token); $this->ExtractValue(); return $this; } private function ExtractValue() { foreach($this->token as $item) { $current = explode('=', $item); if(count($current) == 2) { $this->context->{$current[0]} = $current[1]; } } } public function TimeStampCheck() { if($this->context->ts >= time()) { return true; } return false; } public function AdminCheck() { if($this->context->user == 'admin') { return true; } return false; } } echo CryptToken::GetInstance()->Crypt('user=admin|ts=' . (time() + 10));

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)
7.4.10.0080.01015.21
7.4.00.0050.01214.97
7.3.130.0100.00814.89
7.3.120.0050.01114.96
7.3.110.0060.01114.78
7.3.100.0080.00615.01
7.3.90.0060.00714.87
7.3.80.0050.00814.83
7.3.70.0020.01014.79
7.3.60.0090.00314.92
7.3.50.0080.00514.88
7.3.40.0090.00714.87
7.3.30.0080.00714.83
7.3.20.0090.00616.75
7.3.10.0040.00716.62
7.3.00.0090.00616.69
7.2.260.0070.01115.21
7.2.250.0110.00615.10
7.2.240.0070.00714.94
7.2.230.0060.01015.07
7.2.220.0090.00415.03
7.2.210.0050.00715.17
7.2.200.0040.00915.11
7.2.190.0050.00815.18
7.2.180.0040.00815.17
7.2.170.0060.01015.19
7.2.160.0070.00714.95
7.2.150.0060.00817.02
7.2.140.0060.00817.01
7.2.130.0090.00716.94
7.2.120.0060.00916.87
7.2.110.0070.00816.98
7.2.100.0040.01117.02
7.2.90.0100.00617.04
7.2.80.0110.00617.06
7.2.70.0100.00517.02
7.2.60.0060.01016.89
7.2.50.0090.00617.04
7.2.40.0090.00516.93
7.2.30.0070.00816.96
7.2.20.0080.00716.87
7.2.10.0060.00816.90
7.2.00.0040.01017.43
7.1.330.0030.01115.66
7.1.320.0030.01115.81
7.1.310.0060.00915.85
7.1.300.0030.00915.66
7.1.290.0120.00515.72
7.1.280.0110.00415.44
7.1.270.0040.00815.71
7.1.260.0090.00615.83
7.1.250.0050.00915.71
7.1.240.0100.00515.82
7.1.230.0070.00715.60
7.1.220.0080.00615.43
7.1.210.0080.01015.82
7.1.200.0060.00915.67
7.1.190.0100.00515.87
7.1.180.0030.00815.76
7.1.170.0070.00815.72
7.1.160.0050.00715.74
7.1.150.0080.00615.83
7.1.140.0100.00315.70
7.1.130.0030.00815.75
7.1.120.0070.00515.80
7.1.110.0060.00515.69
7.1.100.0060.00716.58
7.1.90.0060.00415.66
7.1.80.0050.00715.70
7.1.70.0070.00716.16
7.1.60.0030.01316.96
7.1.50.0060.00916.20
7.1.40.0060.00915.61
7.1.30.0050.01015.64
7.1.20.0050.00915.64
7.1.10.0010.00915.77
7.1.00.0020.02818.06
7.0.330.0110.00515.36
7.0.320.0030.00815.45
7.0.310.0100.00315.54
7.0.300.0020.01315.30
7.0.290.0030.00715.42
7.0.280.0050.01115.54
7.0.270.0010.00815.46
7.0.260.0050.00815.45
7.0.250.0060.00615.31
7.0.240.0100.00315.48
7.0.230.0030.01215.51
7.0.220.0040.00715.27
7.0.210.0060.00615.55
7.0.200.0040.00915.99
7.0.190.0050.00915.44
7.0.180.0060.00615.44
7.0.170.0020.01315.53
7.0.160.0080.00415.46
7.0.150.0070.00515.52
7.0.140.0090.02617.54
7.0.130.0100.00315.58
7.0.120.0060.00515.29
7.0.110.0050.00515.51
7.0.100.0210.02916.94
7.0.90.0020.02016.91
7.0.80.0070.03416.94
7.0.70.0110.02416.91
7.0.60.0040.03216.81
7.0.50.0050.03217.16
7.0.40.0110.02415.70
7.0.30.0060.03415.73
7.0.20.0060.03015.72
7.0.10.0060.02015.71
7.0.00.0020.02915.67
5.6.400.0050.00714.29
5.6.390.0050.00714.34
5.6.380.0050.00614.41
5.6.370.0070.00614.61
5.6.360.0070.00714.48
5.6.350.0050.00614.54
5.6.340.0050.01214.46
5.6.330.0050.00514.15
5.6.320.0050.00914.43
5.6.310.0070.00714.57
5.6.300.0030.00814.51
5.6.290.0060.00714.58
5.6.280.0050.02916.56
5.6.270.0020.00614.44
5.6.260.0020.00914.39
5.6.250.0070.03016.48
5.6.240.0040.03316.41
5.6.230.0070.02016.49
5.6.220.0040.03316.54
5.6.210.0040.02216.54
5.6.200.0060.03116.56
5.6.190.0090.03216.71
5.6.180.0070.02616.59
5.6.170.0040.02916.64
5.6.160.0050.03316.59
5.6.150.0090.03016.50
5.6.140.0070.03316.59
5.6.130.0080.03216.74
5.6.120.0060.03216.59
5.6.110.0070.02716.65
5.6.100.0060.03216.68
5.6.90.0060.02216.67
5.6.80.0060.02816.40
5.6.70.0110.02816.35
5.6.60.0050.02416.48
5.6.50.0050.02916.48
5.6.40.0070.01716.49
5.6.30.0070.03016.51
5.6.20.0040.02216.43
5.6.10.0060.03016.40
5.6.00.0020.02316.28
5.5.380.0080.03016.29
5.5.370.0070.03016.27
5.5.360.0060.01816.47
5.5.350.0030.02016.33
5.5.340.0030.02816.52
5.5.330.0020.03316.55
5.5.320.0050.03316.54
5.5.310.0060.03116.63
5.5.300.0060.02816.56
5.5.290.0100.02816.54
5.5.280.0090.02916.65
5.5.270.0110.02816.56
5.5.260.0060.03116.57
5.5.250.0030.02516.34
5.5.240.0060.02716.19
5.5.230.0080.03116.46
5.5.220.0040.03416.31
5.5.210.0030.02816.38
5.5.200.0070.01916.38
5.5.190.0070.02616.40
5.5.180.0040.03616.44
5.5.170.0060.00614.43
5.5.160.0070.03016.32
5.5.150.0070.03116.29
5.5.140.0070.02816.33
5.5.130.0070.02916.35
5.5.120.0060.02516.26
5.5.110.0050.02316.32
5.5.100.0010.03616.05
5.5.90.0080.03216.25
5.5.80.0080.02616.32
5.5.70.0100.02316.35
5.5.60.0110.02716.27
5.5.50.0040.01816.37
5.5.40.0030.03516.32
5.5.30.0050.02016.07
5.5.20.0100.02416.36
5.5.10.0070.01916.24
5.5.00.0040.03516.18
5.4.450.0060.02014.81
5.4.440.0080.02014.83
5.4.430.0090.01814.82
5.4.420.0060.01914.87
5.4.410.0040.02114.76
5.4.400.0070.02314.69
5.4.390.0030.02314.65
5.4.380.0030.03414.70
5.4.370.0030.02814.69
5.4.360.0030.01814.70
5.4.350.0070.01714.70
5.4.340.0060.02514.65
5.4.330.0050.00712.50
5.4.320.0070.01614.72
5.4.310.0080.01914.65
5.4.300.0070.02414.70
5.4.290.0120.01414.72
5.4.280.0050.02514.76
5.4.270.0040.01614.67
5.4.260.0060.02614.70
5.4.250.0040.01814.73
5.4.240.0030.02914.65
5.4.230.0050.03114.72
5.4.220.0090.02414.65
5.4.210.0040.03014.75
5.4.200.0040.03114.71
5.4.190.0020.02814.71
5.4.180.0010.02314.68
5.4.170.0020.02014.73
5.4.160.0060.02114.71
5.4.150.0070.02014.69
5.4.140.0050.02413.84
5.4.130.0060.02713.84
5.4.120.0080.01913.83
5.4.110.0030.02613.82
5.4.100.0030.02013.82
5.4.90.0070.01213.83
5.4.80.0060.01913.81
5.4.70.0050.01913.87
5.4.60.0020.01913.86
5.4.50.0040.02113.81
5.4.40.0040.02713.86
5.4.30.0040.03013.81
5.4.20.0040.02313.84
5.4.10.0010.02513.81
5.4.00.0080.02613.65
5.3.290.0030.04014.83
5.3.280.0130.03714.83
5.3.270.0030.07714.83
5.3.260.0070.04014.83
5.3.250.0100.06014.83
5.3.240.0070.06714.83
5.3.230.0170.07314.83
5.3.220.0070.04014.83
5.3.210.0030.06314.83
5.3.200.0000.04714.83
5.3.190.0030.04014.83
5.3.180.0100.04714.83
5.3.170.0070.07014.83
5.3.160.0030.08014.83
5.3.150.0100.05014.83
5.3.140.0030.04314.83
5.3.130.0030.04714.83
5.3.120.0070.08714.83
5.3.110.0100.07714.83
5.3.100.0070.06714.83
5.3.90.0000.04314.83
5.3.80.0100.07014.83
5.3.70.0100.07314.83
5.3.60.0100.07314.83
5.3.50.0070.07314.83
5.3.40.0070.05714.83
5.3.30.0000.05714.83
5.3.20.0070.07314.83
5.3.10.0070.03314.83
5.3.00.0070.03714.83
5.2.170.0070.04014.83
5.2.160.0070.04714.83
5.2.150.0070.06314.83
5.2.140.0070.03314.83
5.2.130.0000.06714.83
5.2.120.0030.03014.83
5.2.110.0070.05714.83
5.2.100.0030.05714.83
5.2.90.0070.03014.83
5.2.80.0100.03714.83
5.2.70.0070.05714.83
5.2.60.0100.05014.83
5.2.50.0030.05714.83
5.2.40.0030.06714.83
5.2.30.0070.06014.83
5.2.20.0030.03714.83
5.2.10.0000.03314.83
5.2.00.0030.06014.83
5.1.60.0000.03714.83
5.1.50.0000.02714.83
5.1.40.0070.05014.83
5.1.30.0070.05314.83
5.1.20.0030.05714.83
5.1.10.0070.03714.83
5.1.00.0030.05714.83
5.0.50.0000.03714.83
5.0.40.0000.02314.83
5.0.30.0000.03714.83
5.0.20.0030.04314.83
5.0.10.0100.04014.83
5.0.00.0000.06714.83
4.4.90.0000.03714.83
4.4.80.0000.04014.83
4.4.70.0000.02314.83
4.4.60.0000.03014.83
4.4.50.0030.02014.83
4.4.40.0000.02714.83
4.4.30.0000.03714.83
4.4.20.0000.03714.83
4.4.10.0100.02714.83
4.4.00.0030.05014.83
4.3.110.0100.02714.83
4.3.100.0000.02014.83
4.3.90.0100.02714.83
4.3.80.0000.04314.83
4.3.70.0000.03014.83
4.3.60.0000.02714.83
4.3.50.0070.02714.83
4.3.40.0030.04014.83
4.3.30.0000.03314.83
4.3.20.0030.03714.83
4.3.10.0100.02714.83
4.3.00.0070.03014.83

preferences:
45.81 ms | 401 KiB | 5 Q