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; } } return 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.00.0090.00915.20
7.3.120.0120.00614.89
7.3.110.0060.01014.86
7.3.100.0080.00814.70
7.3.90.0120.00314.90
7.3.80.0040.01114.79
7.3.70.0060.00914.91
7.3.60.0040.01114.80
7.3.50.0000.00914.88
7.3.40.0080.00614.85
7.3.30.0100.00714.66
7.3.20.0100.00016.79
7.3.10.0080.00916.48
7.3.00.0070.01116.48
7.2.250.0030.01714.85
7.2.240.0130.00715.27
7.2.230.0000.01415.26
7.2.220.0070.00714.77
7.2.210.0090.00615.00
7.2.200.0040.00815.08
7.2.190.0000.01515.16
7.2.180.0030.01415.05
7.2.170.0000.01415.25
7.2.130.0210.00016.15
7.2.120.0140.00616.16
7.2.110.0080.01416.51
7.2.100.0120.00616.89
7.2.90.0170.00816.22
7.2.80.0100.00716.85
7.2.70.0200.00416.68
7.2.60.0120.00816.83
7.2.50.0210.00816.71
7.2.40.0160.00516.81
7.2.30.0130.00316.58
7.2.20.0160.00416.47
7.2.10.0170.01016.79
7.2.00.0060.00918.06
7.1.330.0030.01315.61
7.1.320.0080.00415.41
7.1.310.0030.00715.78
7.1.300.0030.01315.78
7.1.290.0060.00915.75
7.1.280.0070.01115.45
7.1.270.0100.00715.88
7.1.260.0090.00615.78
7.1.250.0160.00315.19
7.1.200.0060.00615.46
7.1.100.0040.00717.82
7.1.70.0040.00717.11
7.1.60.0120.01219.24
7.1.50.0120.00616.77
7.1.00.0000.03722.37
7.0.200.0000.00716.52
7.0.140.0000.07022.01
7.0.100.0100.05719.97
7.0.90.0130.09020.02
7.0.80.0130.06319.96
7.0.70.0030.04319.88
7.0.60.0300.08019.92
7.0.50.0130.09020.28
7.0.40.0070.05020.18
7.0.30.0130.07720.25
7.0.20.0070.08020.07
7.0.10.0030.04720.17
7.0.00.0070.08020.21
5.6.280.0000.07720.99
5.6.250.0070.08020.71
5.6.240.0100.05020.62
5.6.230.0100.07720.61
5.6.220.0100.04320.72
5.6.210.0200.04320.54
5.6.200.0070.05721.18
5.6.190.0100.04721.14
5.6.180.0030.08321.06
5.6.170.0170.07321.17
5.6.160.0100.04721.17
5.6.150.0030.04721.25
5.6.140.0130.06721.18
5.6.130.0100.05021.22
5.6.120.0130.04321.11
5.6.110.0170.06021.24
5.6.100.0030.08321.09
5.6.90.0000.05721.11
5.6.80.0100.06320.48
5.6.70.0030.04020.52
5.6.60.0030.08020.52
5.6.50.0000.04020.54
5.6.40.0070.08020.50
5.6.30.0030.06020.53
5.6.20.0030.05720.50
5.6.10.0030.04020.52
5.6.00.0070.07020.55
5.5.380.0000.07020.41
5.5.370.0070.07320.41
5.5.360.0070.08320.36
5.5.350.0100.09020.39
5.5.340.0100.06020.98
5.5.330.0100.07020.92
5.5.320.0230.07020.98
5.5.310.0170.03320.90
5.5.300.0030.04720.74
5.5.290.0100.06320.98
5.5.280.0070.10020.87
5.5.270.0070.08321.00
5.5.260.0130.07720.73
5.5.250.0030.05020.64
5.5.240.0070.04320.31
5.5.230.0130.03720.37
5.5.220.0000.04720.23
5.5.210.0030.07720.30
5.5.200.0000.04020.25
5.5.190.0100.03720.26
5.5.180.0070.05020.27
5.5.160.0030.07020.25
5.5.150.0030.08720.23
5.5.140.0170.06320.25
5.5.130.0000.07020.22
5.5.120.0130.04320.36
5.5.110.0030.06020.32
5.5.100.0000.04320.21
5.5.90.0030.08020.16
5.5.80.0030.07720.14
5.5.70.0100.05720.07
5.5.60.0100.07320.25
5.5.50.0030.07720.20
5.5.40.0070.08020.13
5.5.30.0030.04720.14
5.5.20.0070.04320.14
5.5.10.0130.07320.07
5.5.00.0100.05720.09
5.4.450.0100.07719.39
5.4.440.0070.08319.51
5.4.430.0030.08719.38
5.4.420.0070.07719.55
5.4.410.0130.06319.36
5.4.400.0070.04019.11
5.4.390.0030.04019.15
5.4.380.0070.04319.24
5.4.370.0100.07319.13
5.4.360.0100.05718.96
5.4.350.0130.06319.08
5.4.340.0070.07719.10
5.4.320.0030.04019.20
5.4.310.0030.03719.07
5.4.300.0100.06319.23
5.4.290.0070.03319.08
5.4.280.0030.08019.17
5.4.270.0130.05718.97
5.4.260.0030.04018.99
5.4.250.0130.05018.95
5.4.240.0030.05019.17
5.4.230.0100.04719.08
5.4.220.0030.08019.16
5.4.210.0170.03319.19
5.4.200.0070.07019.14
5.4.190.0130.05319.05
5.4.180.0030.05019.18
5.4.170.0130.04718.96
5.4.160.0030.04319.17
5.4.150.0100.06019.09
5.4.140.0070.04016.51
5.4.130.0200.05716.65
5.4.120.0130.05716.48
5.4.110.0100.06716.54
5.4.100.0100.06016.56
5.4.90.0100.06016.45
5.4.80.0070.06716.54
5.4.70.0030.05016.43
5.4.60.0100.06716.45
5.4.50.0030.06316.57
5.4.40.0000.04716.50
5.4.30.0100.03016.46
5.4.20.0070.06716.47
5.4.10.0000.05716.43
5.4.00.0070.06016.06
5.3.290.0070.08014.75
5.3.280.0100.06314.68
5.3.270.0230.02714.68
5.3.260.0100.05314.64
5.3.250.0000.07314.72
5.3.240.0070.04314.58
5.3.230.0000.07314.71
5.3.220.0230.02714.62
5.3.210.0070.06014.59
5.3.200.0130.03314.60
5.3.190.0100.04314.57
5.3.180.0030.04314.71
5.3.170.0070.07314.73
5.3.160.0100.06314.55
5.3.150.0030.03714.65
5.3.140.0070.04314.59
5.3.130.0070.07714.55
5.3.120.0070.07314.68
5.3.110.0000.04714.56
5.3.100.0030.04314.00
5.3.90.0130.06714.00
5.3.80.0070.07014.04
5.3.70.0070.04314.10
5.3.60.0030.04713.95
5.3.50.0030.04014.10
5.3.40.0100.04314.00
5.3.30.0030.07314.02
5.3.20.0000.04313.62
5.3.10.0100.04313.77
5.3.00.0070.05013.80
5.2.170.0170.05311.30
5.2.160.0100.05711.30
5.2.150.0070.05311.30
5.2.140.0030.06011.30
5.2.130.0030.06311.30
5.2.120.0070.05711.30
5.2.110.0000.05711.30
5.2.100.0000.04311.30
5.2.90.0100.04011.30
5.2.80.0030.04011.30
5.2.70.0070.04311.30
5.2.60.0070.04711.30
5.2.50.0070.05311.30
5.2.40.0100.05711.30
5.2.30.0070.05311.30
5.2.20.0030.04011.30
5.2.10.0000.04011.30
5.2.00.0000.05711.30
5.1.60.0030.03311.30
5.1.50.0030.04011.30
5.1.40.0000.04311.30
5.1.30.0030.06011.30
5.1.20.0070.04011.30
5.1.10.0000.03011.30
5.1.00.0000.03011.30
5.0.50.0030.02311.30
5.0.40.0000.02011.30
5.0.30.0030.05011.30
5.0.20.0000.02011.30
5.0.10.0000.03011.30
5.0.00.0030.05011.30
4.4.90.0030.03311.30
4.4.80.0070.03011.30
4.4.70.0000.01711.30
4.4.60.0000.04011.30
4.4.50.0030.02311.30
4.4.40.0030.05011.30
4.4.30.0030.02011.30
4.4.20.0000.02011.30
4.4.10.0000.03711.30
4.4.00.0000.02711.30
4.3.110.0100.01711.30
4.3.100.0000.01711.30
4.3.90.0000.02011.30
4.3.80.0000.02711.30
4.3.70.0000.01711.30
4.3.60.0000.02711.30
4.3.50.0000.02311.30
4.3.40.0070.01711.30
4.3.30.0000.03011.30
4.3.20.0030.02011.30
4.3.10.0070.01711.30
4.3.00.0030.03311.30

preferences:
40.8 ms | 400 KiB | 5 Q