3v4l.org

run code in 300+ PHP versions simultaneously
<?php class KZ_Crypt { public $_text = ''; //Chìa khoá để mở kho báu ^^ public $_key = 'f_pk_ZingTV_1_@z'; public $_iv = 'f_iv_ZingTV_1_@z'; //Kết quả trả về public $_result = ''; /** * Hàm mã hoá **/ public function _encrypt(){ if($this->_text != ''){ $cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, ''); $iv_size = mcrypt_enc_get_iv_size($cipher); if (mcrypt_generic_init($cipher, $this->_key, $this->_iv) != -1){ $cipherText = mcrypt_generic($cipher,$this->_text); mcrypt_generic_deinit($cipher); $this->_result = bin2hex($cipherText); return true; } }else{ return false; } } /** * Hàm giải mã **/ public function _decrypt(){ if($this->_text != ''){ $cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, ''); $iv_size = mcrypt_enc_get_iv_size($cipher); if(mcrypt_generic_init($cipher, $this->_key, $this->_iv) != -1){ $cipherText = mdecrypt_generic($cipher,$this->_hexToString($this->_text)); mcrypt_generic_deinit($cipher); $this->_result = $cipherText; return true; }else{ return false; } } } /** * Hàm chuyển đổi từ mã hex sang chuỗi. **/ protected function _hexToString($hex){ if(!is_string($hex)){ return null; } $char = ''; for($i=0; $i<strlen($hex);$i+=2){ $char .= chr(hexdec($hex{$i}.$hex{($i+1)})); } return $char; } }

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.40.0110.01118.85
8.3.30.0160.00018.68
8.3.20.0070.00020.01
8.3.10.0000.00823.52
8.3.00.0050.00219.21
8.2.170.0080.00522.96
8.2.160.0000.01422.17
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0090.00020.95
8.2.110.0000.01019.20
8.2.100.0040.00817.59
8.2.90.0040.00417.63
8.2.80.0040.00418.61
8.2.70.0040.00417.92
8.2.60.0050.00617.89
8.2.50.0030.00618.10
8.2.40.0040.00719.16
8.2.30.0000.00819.23
8.2.20.0040.00417.55
8.2.10.0040.00417.93
8.2.00.0040.00417.57
8.1.270.0040.00418.69
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0080.00019.03
8.1.230.0070.00420.75
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0060.00317.23
8.1.190.0030.00617.00
8.1.180.0000.00818.95
8.1.170.0040.00418.51
8.1.160.0050.00218.87
8.1.150.0040.00418.77
8.1.140.0040.00417.22
8.1.130.0000.00717.68
8.1.120.0040.00417.31
8.1.110.0030.00617.18
8.1.100.0030.00517.27
8.1.90.0040.00417.31
8.1.80.0000.00717.31
8.1.70.0000.00717.34
8.1.60.0000.00917.47
8.1.50.0050.00517.30
8.1.40.0060.00317.27
8.1.30.0000.00817.39
8.1.20.0040.00417.41
8.1.10.0000.00917.39
8.1.00.0070.00017.32
8.0.300.0100.00018.77
8.0.290.0090.00016.75
8.0.280.0070.00018.27
8.0.270.0070.00017.04
8.0.260.0030.00316.99
8.0.250.0040.00416.77
8.0.240.0030.00316.90
8.0.230.0070.00016.88
8.0.220.0070.00016.75
8.0.210.0030.00516.72
8.0.200.0040.00416.88
8.0.190.0040.00416.85
8.0.180.0040.00416.82
8.0.170.0030.00516.73
8.0.160.0070.00016.88
8.0.150.0060.00316.85
8.0.140.0050.00316.81
8.0.130.0000.00513.34
8.0.120.0030.00516.81
8.0.110.0040.00416.64
8.0.100.0000.00716.79
8.0.90.0000.00716.88
8.0.80.0080.00816.89
8.0.70.0070.00016.70
8.0.60.0000.00816.89
8.0.50.0050.00316.79
8.0.30.0150.00616.84
8.0.20.0140.00817.40
8.0.10.0040.00416.84
8.0.00.0090.00916.63
7.4.330.0020.00315.03
7.4.320.0000.00616.38
7.4.300.0060.00016.41
7.4.290.0000.00716.48
7.4.280.0050.00216.31
7.4.270.0060.00316.38
7.4.260.0000.00816.39
7.4.250.0070.00016.43
7.4.240.0030.00316.42
7.4.230.0050.00316.59
7.4.220.0140.00416.35
7.4.210.0040.01116.47
7.4.200.0000.00816.37
7.4.160.0130.00616.38
7.4.150.0130.01017.40
7.4.140.0080.01217.86
7.4.130.0150.00716.52
7.4.120.0100.00616.38
7.4.110.0130.01016.48
7.4.100.0030.01316.37
7.4.90.0190.00316.43
7.4.80.0120.00619.39
7.4.70.0040.01216.41
7.4.60.0080.01216.54
7.4.50.0090.00016.30
7.4.40.0100.01116.34
7.4.30.0100.00716.34
7.4.00.0100.00514.95
7.3.330.0000.00513.26
7.3.320.0000.00513.06
7.3.310.0070.00016.15
7.3.300.0070.00016.20
7.3.290.0080.00716.20
7.3.280.0070.01216.17
7.3.270.0110.00717.40
7.3.260.0120.00416.38
7.3.250.0130.00516.30
7.3.240.0130.00316.19
7.3.230.0170.00016.39
7.3.210.0140.00416.46
7.3.200.0080.00819.39
7.3.190.0130.00316.32
7.3.180.0070.01016.17
7.3.170.0130.00316.44
7.3.160.0130.00316.20
7.3.120.0130.00614.60
7.3.110.0040.01514.54
7.3.100.0030.01014.80
7.3.90.0070.00714.88
7.3.80.0040.00414.92
7.3.70.0000.01414.60
7.3.60.0060.00914.70
7.3.50.0070.00714.82
7.3.40.0040.01114.79
7.3.30.0030.01014.57
7.3.20.0040.01116.52
7.3.10.0040.01116.30
7.3.00.0030.00616.32
7.2.330.0120.00616.60
7.2.320.0160.00716.57
7.2.310.0070.01116.54
7.2.300.0100.01416.54
7.2.290.0030.01516.26
7.2.250.0070.01414.96
7.2.240.0030.01314.88
7.2.230.0090.00614.87
7.2.220.0070.00714.89
7.2.210.0070.00314.98
7.2.200.0000.01514.65
7.2.190.0090.00614.81
7.2.180.0070.01014.80
7.2.170.0060.00615.02
7.2.00.0130.01019.05
7.1.330.0030.01215.52
7.1.320.0060.00915.37
7.1.310.0040.01115.73
7.1.300.0100.00315.70
7.1.290.0030.01015.73
7.1.280.0080.00615.58
7.1.270.0000.01515.50
7.1.260.0060.00815.37
7.1.100.0560.00715.34
7.1.70.0050.00316.85
7.1.60.0160.00719.22
7.1.50.0030.00916.80
7.1.00.0030.07722.31
7.0.200.0000.00716.82
7.0.140.0030.03321.92
7.0.60.0100.06719.93
7.0.50.0070.08018.01
7.0.40.0000.04720.24
7.0.30.0200.04320.10
7.0.20.0330.03720.26
7.0.10.0270.07320.19
7.0.00.0000.05020.24
5.6.280.0130.06021.09
5.6.210.0130.07320.66
5.6.200.0070.05018.24
5.6.190.0070.07020.48
5.6.180.4200.03320.77
5.6.170.0400.04020.47
5.6.160.0100.08020.54
5.6.150.0200.05318.16
5.6.140.0100.04018.14
5.6.130.0100.07718.14
5.6.120.0030.04321.13
5.6.110.0070.08021.02
5.6.100.0000.04721.12
5.6.90.0070.08020.98
5.6.80.0070.07320.42
5.6.70.0270.07020.36
5.5.350.0330.07020.48
5.5.340.0070.05017.95
5.5.330.0030.04720.35
5.5.320.0300.04320.51
5.5.310.0230.06320.18
5.5.300.0130.07317.96
5.5.290.0100.07018.05
5.5.280.0170.08020.66
5.5.270.0070.07020.88
5.5.260.0070.08020.99
5.5.250.0000.09020.76
5.5.240.0300.06720.08
5.4.450.0630.06019.61
5.4.440.0030.07019.62
5.4.430.0200.05019.23
5.4.420.0200.04719.49
5.4.410.0170.05319.40
5.4.400.0130.05319.24
5.4.390.0230.07018.50
5.4.380.0130.05718.62
5.4.370.0270.04318.54
5.4.360.0130.05318.54
5.4.350.0200.05318.72
5.4.340.0130.05718.52
5.4.320.0230.05018.57
5.4.310.0200.04718.58
5.4.300.0100.05718.47
5.4.290.0130.05318.72
5.4.280.0170.05018.69
5.4.270.0130.06318.57
5.4.260.0200.05018.68
5.4.250.0230.04718.77
5.4.240.0300.04318.69
5.4.230.0200.04718.83
5.4.220.0130.05318.62
5.4.210.0100.05718.52
5.4.200.0170.04716.53
5.4.190.0200.04718.59
5.4.180.0170.05018.78
5.4.170.0200.05018.75
5.4.160.0230.04318.73
5.4.150.0130.05318.81
5.4.140.0230.04316.31
5.4.130.0130.05016.31
5.4.120.0170.04716.23
5.4.110.0130.05016.23
5.4.100.0130.05316.21
5.4.90.0170.05016.15
5.4.80.0100.05716.17
5.4.70.0100.06016.27
5.4.60.0130.05016.18
5.4.50.0130.04716.17
5.4.40.0270.03716.19
5.4.30.0200.04316.26
5.4.20.0200.05016.18
5.4.10.0230.04316.29
5.4.00.0130.05315.72
5.3.290.0100.06314.73
5.3.280.0230.06314.63
5.3.270.0230.04714.65
5.3.260.0130.06314.80
5.3.250.0170.05314.60
5.3.240.0170.05014.79
5.3.230.0200.04714.78
5.3.220.0200.04714.79
5.3.210.0070.06014.64
5.3.200.0170.05014.68
5.3.190.0170.04714.57
5.3.180.0230.04314.61
5.3.170.0270.04014.56
5.3.160.0130.05014.74
5.3.150.0170.05014.80
5.3.140.0130.05314.79
5.3.130.0030.06314.58
5.3.120.0170.05714.77
5.3.110.0100.06014.77
5.3.100.0370.03014.28
5.3.90.0070.06014.06
5.3.80.0270.03714.07
5.3.70.0100.06014.07
5.3.60.0230.04314.14
5.3.50.0200.04313.99
5.3.40.0200.05314.06
5.3.30.0070.06014.02
5.3.20.0200.04313.73
5.3.10.0170.05013.65
5.3.00.0170.05313.78
5.2.170.0230.03311.36
5.2.160.0100.04311.18
5.2.150.0170.04011.18
5.2.140.0200.03711.19
5.2.130.0170.04311.34
5.2.120.0200.03311.20
5.2.110.0100.04311.16
5.2.100.0170.03711.22
5.2.90.0100.04311.23
5.2.80.0070.04711.14
5.2.70.0170.03711.17
5.2.60.0170.04011.20
5.2.50.0100.04311.16
5.2.40.0170.04011.22
5.2.30.0170.03711.19
5.2.20.0200.03011.07
5.2.10.0130.03710.93
5.2.00.0100.04010.79
5.1.60.0100.03310.20
5.1.50.0170.03310.04
5.1.40.0100.03310.02
5.1.30.0130.03310.46
5.1.20.0100.03710.35
5.1.10.0100.03710.07
5.1.00.0200.02710.11
5.0.50.0230.0178.75
5.0.40.0030.0308.56
5.0.30.0070.0438.42
5.0.20.0130.0238.35
5.0.10.0070.0308.39
5.0.00.0070.0438.31
4.4.90.0100.0236.02
4.4.80.0100.0205.91
4.4.70.0170.0135.98
4.4.60.0070.0205.91
4.4.50.0030.0235.89
4.4.40.0100.0305.97
4.4.30.0070.0205.88
4.4.20.0070.0205.94
4.4.10.0030.0235.96
4.4.00.0130.0276.04
4.3.110.0070.0305.80
4.3.100.0100.0235.80
4.3.90.0070.0305.83
4.3.80.0070.0335.77
4.3.70.0070.0205.89
4.3.60.0030.0235.79
4.3.50.0100.0175.79
4.3.40.0030.0375.82
4.3.30.0030.0235.10
4.3.20.0030.0235.10
4.3.10.0100.0175.10
4.3.00.0170.0307.34

preferences:
43.19 ms | 400 KiB | 5 Q