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() + 100));

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.0030.01515.09
7.4.00.0080.01015.15
7.3.130.0030.01314.81
7.3.120.0090.01014.65
7.3.110.0070.00714.93
7.3.100.0070.00914.81
7.3.90.0060.00814.78
7.3.80.0080.00314.87
7.3.70.0050.00914.69
7.3.60.0100.00314.83
7.3.50.0070.00514.76
7.3.40.0030.00914.64
7.3.30.0060.00814.89
7.3.20.0040.01016.69
7.3.10.0060.00816.59
7.3.00.0090.00616.55
7.2.260.0030.01614.90
7.2.250.0090.00915.13
7.2.240.0060.00815.21
7.2.230.0060.00614.87
7.2.220.0050.01015.03
7.2.210.0050.00714.92
7.2.200.0070.00715.29
7.2.190.0050.01015.10
7.2.180.0060.00815.04
7.2.170.0070.00514.85
7.2.160.0030.01315.23
7.2.150.0030.00916.78
7.2.140.0090.00017.09
7.2.130.0100.00416.84
7.2.120.0090.00316.74
7.2.110.0080.00516.75
7.2.100.0030.01216.76
7.2.90.0070.00916.68
7.2.80.0090.00516.74
7.2.70.0040.00716.96
7.2.60.0030.01516.88
7.2.50.0030.01416.99
7.2.40.0040.00816.74
7.2.30.0050.01116.53
7.2.20.0110.00516.76
7.2.10.0030.01016.68
7.2.00.0030.00817.83
7.1.330.0070.00715.64
7.1.320.0070.00715.70
7.1.310.0030.01115.84
7.1.300.0040.00915.66
7.1.290.0070.00215.51
7.1.280.0050.00915.63
7.1.270.0030.01015.52
7.1.260.0060.00615.67
7.1.250.0060.00815.55
7.1.240.0070.00315.77
7.1.230.0100.00715.77
7.1.220.0100.00715.78
7.1.210.0060.00915.80
7.1.200.0060.00915.68
7.1.190.0070.00715.70
7.1.180.0060.01215.79
7.1.170.0060.01215.81
7.1.160.0070.00315.83
7.1.150.0030.01015.56
7.1.140.0030.00615.77
7.1.130.0090.00615.75
7.1.120.0120.00315.74
7.1.110.0040.00715.77
7.1.100.0050.00517.14
7.1.90.0000.01415.95
7.1.80.0090.00315.67
7.1.70.0010.00916.38
7.1.60.0030.01317.48
7.1.50.0050.01216.34
7.1.40.0000.01415.79
7.1.30.0040.00815.86
7.1.20.0130.00315.67
7.1.10.0090.00615.54
7.1.00.0090.01718.99
7.0.330.0070.00715.32
7.0.320.0060.00915.30
7.0.310.0060.00315.41
7.0.300.0090.00315.19
7.0.290.0100.00315.44
7.0.280.0100.00315.21
7.0.270.0090.00615.43
7.0.260.0060.00615.48
7.0.250.0100.00315.55
7.0.240.0000.01215.39
7.0.230.0030.01415.35
7.0.220.0060.00615.30
7.0.210.0030.01015.26
7.0.200.0030.00815.94
7.0.190.0080.00415.09
7.0.180.0040.01115.33
7.0.170.0060.00615.38
7.0.160.0030.01015.50
7.0.150.0000.01415.20
7.0.140.0070.03918.77
7.0.130.0030.01315.32
7.0.120.0000.01015.36
7.0.110.0000.01215.02
7.0.100.0120.00615.40
7.0.90.0000.01415.48
7.0.80.0230.02817.64
7.0.70.0100.04517.72
7.0.60.0110.03617.60
7.0.50.0030.03517.98
7.0.40.0100.03716.75
7.0.30.0030.04416.71
7.0.20.0050.03216.76
7.0.10.0040.02616.77
7.0.00.0050.03916.82
5.6.400.0000.00914.53
5.6.390.0030.01014.62
5.6.380.0070.01014.55
5.6.370.0090.00614.34
5.6.360.0110.00414.33
5.6.350.0040.01114.21
5.6.340.0040.00814.64
5.6.330.0110.00314.45
5.6.320.0120.00414.21
5.6.310.0000.01414.42
5.6.300.0100.00314.20
5.6.290.0000.01314.29
5.6.280.0050.04117.56
5.6.270.0100.00314.16
5.6.260.0080.00314.07
5.6.250.0120.00614.14
5.6.240.0000.01214.73
5.6.230.0110.03917.59
5.6.220.0100.04017.41
5.6.210.0070.02417.40
5.6.200.0070.04717.74
5.6.190.0040.03717.81
5.6.180.0080.03717.74
5.6.170.0120.04217.62
5.6.160.0050.03317.75
5.6.150.0040.02817.77
5.6.140.0040.03117.84
5.6.130.0050.04317.83
5.6.120.0100.04317.88
5.6.110.0100.04017.74
5.6.100.0070.04217.73
5.6.90.0100.04317.81
5.6.80.0080.04517.48
5.6.70.0120.02917.34
5.6.60.0070.03317.45
5.6.50.0080.02817.48
5.6.40.0120.04017.40
5.6.30.0050.02617.44
5.6.20.0080.02317.39
5.6.10.0050.04417.28
5.6.00.0100.04117.36
5.5.380.0030.01314.05
5.5.370.0050.02417.50
5.5.360.0020.04417.25
5.5.350.0080.02517.40
5.5.340.0020.02817.75
5.5.330.0060.04817.78
5.5.320.0050.03217.58
5.5.310.0080.02817.70
5.5.300.0070.04617.50
5.5.290.0020.03217.49
5.5.280.0100.03717.39
5.5.270.0080.02917.64
5.5.260.0050.02717.69
5.5.250.0020.03117.61
5.5.240.0110.04317.26
5.5.230.0060.02517.28
5.5.220.0120.03817.34
5.5.210.0070.02517.38
5.5.200.0030.03217.20
5.5.190.0030.02717.33
5.5.180.0070.04317.38
5.5.170.0060.00914.27
5.5.160.0050.04317.24
5.5.150.0100.02217.22
5.5.140.0070.02717.31
5.5.130.0020.02517.26
5.5.120.0020.03217.23
5.5.110.0060.02717.30
5.5.100.0050.04317.30
5.5.90.0050.04517.29
5.5.80.0080.02517.24
5.5.70.0020.05017.21
5.5.60.0060.04417.30
5.5.50.0090.03917.19
5.5.40.0080.04017.17
5.5.30.0000.03917.24
5.5.20.0070.02817.14
5.5.10.0070.03017.22
5.5.00.0080.02217.16
5.4.450.0060.02815.39
5.4.440.0050.04015.40
5.4.430.0050.04415.22
5.4.420.0070.02515.21
5.4.410.0050.02914.97
5.4.400.0090.03315.11
5.4.390.0060.03615.15
5.4.380.0030.04715.11
5.4.370.0090.03715.19
5.4.360.0070.02815.01
5.4.350.0050.03415.18
5.4.340.0050.03414.93
5.4.330.0000.00711.14
5.4.320.0080.04015.29
5.4.310.0030.03115.00
5.4.300.0050.04215.01
5.4.290.0050.02215.17
5.4.280.0060.03415.01
5.4.270.0030.03015.18
5.4.260.0080.01815.11
5.4.250.0080.04315.03
5.4.240.0130.03514.78
5.4.230.0100.03715.09
5.4.220.0030.02515.05
5.4.210.0100.03515.28
5.4.200.0070.04114.84
5.4.190.0100.02515.17
5.4.180.0030.02714.97
5.4.170.0030.02615.01
5.4.160.0070.03715.18
5.4.150.0080.03915.23
5.4.140.0020.03113.90
5.4.130.0050.02513.83
5.4.120.0070.03813.78
5.4.110.0050.03513.67
5.4.100.0030.04013.71
5.4.90.0110.01813.68
5.4.80.0060.02813.91
5.4.70.0050.04113.87
5.4.60.0070.03713.71
5.4.50.0060.03513.88
5.4.40.0060.02513.75
5.4.30.0030.03813.74
5.4.20.0050.03913.84
5.4.10.0000.02713.75
5.4.00.0090.01513.47
5.3.290.0020.04612.69
5.3.280.0050.04312.48
5.3.270.0020.03912.73
5.3.260.0020.02312.64
5.3.250.0050.04712.68
5.3.240.0020.03612.59
5.3.230.0070.02812.58
5.3.220.0090.03812.48
5.3.210.0060.03612.56
5.3.200.0050.02212.50
5.3.190.0050.02112.70
5.3.180.0070.03912.73
5.3.170.0070.03812.62
5.3.160.0030.03812.72
5.3.150.0100.03712.55
5.3.140.0070.04312.65
5.3.130.0020.03912.60
5.3.120.0050.04112.61
5.3.110.0050.04212.61
5.3.100.0050.03712.25
5.3.90.0030.03312.43
5.3.80.0080.03112.26
5.3.70.0050.04312.27
5.3.60.0080.02812.38
5.3.50.0050.02712.14
5.3.40.0000.03612.34
5.3.30.0010.04312.24
5.3.20.0060.03512.15
5.3.10.0080.03012.01
5.3.00.0050.02312.05
5.2.170.0170.03311.23
5.2.160.0070.05311.23
5.2.150.0000.06711.16
5.2.140.0130.04311.09
5.2.130.0070.05311.19
5.2.120.0070.06011.03
5.2.110.0100.05311.02
5.2.100.0000.04311.16
5.2.90.0170.03011.00
5.2.80.0000.06711.13
5.2.70.0070.05711.15
5.2.60.0030.05311.00
5.2.50.0000.04311.11
5.2.40.0000.05711.04
5.2.30.0070.06010.93
5.2.20.0030.04311.05
5.2.10.0030.05010.81
5.2.00.0030.05710.85
5.1.60.0000.04710.81
5.1.50.0030.05010.81
5.1.40.0070.05010.81
5.1.30.0030.05710.81
5.1.20.0100.05010.81
5.1.10.0030.05010.81
5.1.00.0270.03310.81
5.0.50.0030.03710.81
5.0.40.0100.02010.81
5.0.30.0030.05310.81
5.0.20.0000.03010.81
5.0.10.0000.04710.81
5.0.00.0030.06710.81
4.4.90.0000.03310.81
4.4.80.0030.02310.81
4.4.70.0030.03710.81
4.4.60.0000.02310.81
4.4.50.0000.03710.81
4.4.40.0000.05310.81
4.4.30.0030.02710.81
4.4.20.0000.03710.81
4.4.10.0000.03710.81
4.4.00.0000.04710.81
4.3.110.0100.02710.81
4.3.100.0070.03010.81
4.3.90.0000.02010.81
4.3.80.0100.03310.81
4.3.70.0000.03710.81
4.3.60.0030.02710.81
4.3.50.0030.03010.81
4.3.40.0070.03010.81
4.3.30.0000.03710.81
4.3.20.0030.03310.81
4.3.10.0000.03710.81
4.3.00.0070.03010.81

preferences:
31.8 ms | 401 KiB | 5 Q