3v4l.org

run code in 300+ PHP versions simultaneously
<?php function pkcs7_pad($str) { $len = mb_strlen($str, '8bit'); $c = 16 - ($len % 16); $str .= str_repeat(chr($c), $c); return $str; } $message = 'test'; $key = openssl_random_pseudo_bytes(16); $iv = openssl_random_pseudo_bytes(16); $cipher = mcrypt_encrypt( MCRYPT_RIJNDAEL_128, $key, pkcs7_pad($message), 'ctr', $iv ); $plain = openssl_decrypt( $cipher, 'aes-128-ctr', $key, OPENSSL_RAW_DATA, $iv ); var_dump( $message, bin2hex($cipher), $plain, mb_strlen($message, '8bit'), mb_strlen($plain, '8bit'), $message === $plain );

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.0130.00716.75
8.3.50.0130.00716.52
8.3.40.0080.00818.74
8.3.30.0090.00618.54
8.3.20.0000.00820.77
8.3.10.0040.00421.77
8.3.00.0040.00419.54
8.2.180.0140.00716.75
8.2.170.0110.00422.96
8.2.160.0110.00320.34
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00422.16
8.2.120.0080.00026.35
8.2.110.0000.01020.47
8.2.100.0090.00317.91
8.2.90.0040.00419.11
8.2.80.0030.00617.97
8.2.70.0030.00517.50
8.2.60.0040.00417.78
8.2.50.0030.00518.10
8.2.40.0000.00920.67
8.2.30.0000.00820.94
8.2.20.0030.00617.98
8.2.10.0050.00318.07
8.2.00.0000.00718.12
8.1.280.0070.01025.92
8.1.270.0040.00422.08
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0030.00620.72
8.1.230.0090.00319.15
8.1.220.0050.00317.76
8.1.210.0000.00818.77
8.1.200.0000.01217.35
8.1.190.0000.00817.10
8.1.180.0040.00418.10
8.1.170.0080.00018.72
8.1.160.0070.00019.05
8.1.150.0000.00720.66
8.1.140.0070.00319.55
8.1.130.0030.00618.83
8.1.120.0000.00817.46
8.1.110.0040.00417.39
8.1.100.0040.00417.39
8.1.90.0080.00017.44
8.1.80.0070.00017.29
8.1.70.0030.00317.37
8.1.60.0040.00417.43
8.1.50.0040.00417.41
8.1.40.0040.00717.57
8.1.30.0040.00417.57
8.1.20.0050.00217.66
8.1.10.0000.00817.57
8.1.00.0030.00517.49
8.0.300.0060.00318.77
8.0.290.0040.00416.58
8.0.280.0000.00718.46
8.0.270.0030.00617.25
8.0.260.0000.00616.83
8.0.250.0000.00716.98
8.0.240.0070.00016.93
8.0.230.0030.00516.98
8.0.220.0040.00316.91
8.0.210.0000.00916.79
8.0.200.0040.00416.95
8.0.190.0040.00716.93
8.0.180.0050.00316.95
8.0.170.0060.00316.95
8.0.160.0000.00716.92
8.0.150.0000.00716.93
8.0.140.0000.00716.82
8.0.130.0000.00513.32
8.0.120.0000.00716.85
8.0.110.0070.00016.77
8.0.100.0080.00016.89
8.0.90.0040.00416.94
8.0.80.0040.01116.94
8.0.70.0050.00216.93
8.0.60.0050.00216.83
8.0.50.0000.00716.89
8.0.30.0070.01216.95
8.0.20.0130.00717.40
8.0.10.0080.00016.89
8.0.00.0120.00616.88
7.4.330.0000.00515.55
7.4.320.0000.00716.52
7.4.300.0040.00416.50
7.4.290.0000.00716.59
7.4.280.0000.00816.52
7.4.270.0060.00316.60
7.4.260.0000.00513.39
7.4.250.0040.00416.45
7.4.240.0050.00316.59
7.4.230.0030.00316.68
7.4.220.0130.00616.62
7.4.210.0070.01116.47
7.4.200.0000.00716.40
7.4.160.0120.00616.45
7.4.150.0040.01517.40
7.4.140.0110.01017.86
7.4.130.0030.01516.45
7.4.120.0120.00716.52
7.4.110.0080.01216.50
7.4.100.0060.01316.50
7.4.90.0070.01016.68
7.4.80.0130.00519.39
7.4.70.0030.01316.49
7.4.60.0150.00716.55
7.4.50.0060.00916.44
7.4.40.0060.01616.65
7.4.30.0140.00316.54
7.4.00.0120.00615.00
7.3.330.0030.00313.22
7.3.320.0030.00313.33
7.3.310.0000.00816.16
7.3.300.0060.00016.25
7.3.290.0030.01116.29
7.3.280.0080.00816.31
7.3.270.0100.00717.40
7.3.260.0160.00916.48
7.3.250.0100.01016.46
7.3.240.0140.00616.29
7.3.230.0100.00716.48
7.3.210.0080.01216.49
7.3.200.0110.01216.45
7.3.190.0080.00816.25
7.3.180.0070.01016.27
7.3.170.0160.00616.25
7.3.160.0060.01216.52
7.3.120.0030.01014.71
7.3.110.0030.01314.82
7.3.100.0060.00314.73
7.3.90.0030.01014.85
7.3.80.0050.00514.79
7.3.70.0030.00714.78
7.3.60.0100.00314.85
7.3.50.0040.00414.73
7.3.40.0120.00314.85
7.3.30.0090.00614.76
7.3.20.0100.00316.63
7.3.10.0100.00016.43
7.3.00.0070.00716.58
7.2.330.0000.01716.37
7.2.320.0030.01316.30
7.2.310.0100.00616.69
7.2.300.0190.01316.70
7.2.290.0130.00416.46
7.2.250.0060.00914.95
7.2.240.0000.01615.12
7.2.230.0070.00714.89
7.2.220.0130.00315.07
7.2.210.0000.01315.23
7.2.200.0070.00715.02
7.2.190.0060.00615.01
7.2.180.0040.01114.91
7.2.170.0110.00414.69
7.2.60.0000.00716.53
7.2.00.0100.00319.20
7.1.330.0060.01015.59
7.1.320.0030.01015.68
7.1.310.0000.01515.66
7.1.300.0070.01015.66
7.1.290.0050.00515.61
7.1.280.0070.00715.63
7.1.270.0060.00315.59
7.1.260.0000.01215.35
7.1.100.0040.00718.19
7.1.70.0000.00816.99
7.1.60.4400.01333.34
7.1.50.2470.01733.17
7.1.40.2030.01032.52
7.1.30.2130.01032.77
7.1.20.2070.01732.87
7.1.10.1700.01014.75
7.1.00.2770.01714.93
7.0.200.4270.01715.06
7.0.190.2700.01015.06
7.0.180.2070.01714.44
7.0.170.2370.00314.45
7.0.160.2900.01314.31
7.0.150.1800.01014.30
7.0.140.2330.01314.48
7.0.130.2400.01014.54
7.0.120.2570.01014.66
7.0.110.0030.01314.55
7.0.100.0070.01014.46
7.0.90.2970.00314.50
7.0.80.2670.01314.48
7.0.70.2970.00714.48
7.0.60.0070.01014.32
7.0.50.2700.01014.36
7.0.40.2830.01014.66
7.0.30.2870.00314.65
7.0.20.2970.00714.70
7.0.10.2870.02014.63
7.0.00.2730.00714.54

preferences:
48.78 ms | 400 KiB | 5 Q