3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cryptArray = array( "a"=>"xyz","b"=>"256"); $string = "aab"; function cryptit($string,$cryptArray){ $temp = ""; $length = strlen($string); for($i=0; $i<$length; $i++){ $temp .= $cryptArray[$string[$i]]; } return $temp; } function decryptit($string,$cryptArray){ $temp = ""; $length = strlen($string); $cryptArray = array_flip($cryptArray); for($i =0; $i<$length; $i = $i+3){ $temp .= $cryptArray[$string[$i].$string[$i+1].$string[$i+2]]; } return $temp; } $crypted = cryptit($string,$cryptArray); echo $crypted; $decrypted = decryptit($crypted,$cryptArray); echo $decrypted;

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.70.0090.00918.05
8.3.60.0110.00718.55
8.3.50.0100.01017.59
8.3.40.0040.01118.97
8.3.30.0120.00318.66
8.3.20.0080.00020.34
8.3.10.0090.00021.81
8.3.00.0080.00019.38
8.2.190.0160.00916.58
8.2.180.0110.00716.50
8.2.170.0040.01122.96
8.2.160.0070.00722.13
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0040.00422.25
8.2.120.0040.00426.16
8.2.110.0090.00020.52
8.2.100.0090.00317.78
8.2.90.0070.00317.98
8.2.80.0050.00319.20
8.2.70.0000.00818.03
8.2.60.0030.00617.63
8.2.50.0030.00518.10
8.2.40.0080.00022.36
8.2.30.0050.00219.47
8.2.20.0070.00018.02
8.2.10.0040.00418.20
8.2.00.0040.00418.38
8.1.280.0120.00625.92
8.1.270.0070.01322.18
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00322.55
8.1.230.0040.00820.89
8.1.220.0000.00817.79
8.1.210.0040.00418.90
8.1.200.0030.00517.35
8.1.190.0060.00317.22
8.1.180.0050.00318.10
8.1.170.0090.00018.59
8.1.160.0000.00718.90
8.1.150.0040.00418.58
8.1.140.0000.00717.67
8.1.130.0000.00719.02
8.1.120.0030.00317.48
8.1.110.0000.00817.35
8.1.100.0030.00617.37
8.1.90.0040.00417.39
8.1.80.0040.00417.36
8.1.70.0030.00317.39
8.1.60.0040.00417.60
8.1.50.0040.00417.42
8.1.40.0000.00817.55
8.1.30.0000.00817.71
8.1.20.0040.00417.58
8.1.10.0030.00517.51
8.1.00.0060.00317.49
8.0.300.0000.00720.08
8.0.290.0000.00816.75
8.0.280.0030.00318.46
8.0.270.0080.00017.14
8.0.260.0000.00717.29
8.0.250.0030.00316.86
8.0.240.0030.00716.83
8.0.230.0000.00716.99
8.0.220.0040.00416.86
8.0.210.0040.00416.94
8.0.200.0030.00316.83
8.0.190.0040.00416.88
8.0.180.0000.00716.97
8.0.170.0060.00316.90
8.0.160.0000.00816.86
8.0.150.0030.00516.74
8.0.140.0030.00316.75
8.0.130.0000.00613.29
8.0.120.0000.00716.85
8.0.110.0070.00016.79
8.0.100.0040.00416.89
8.0.90.0000.00716.74
8.0.80.0030.01316.95
8.0.70.0000.00716.80
8.0.60.0000.00716.79
8.0.50.0050.00316.95
8.0.30.0100.00817.32
8.0.20.0090.01017.40
8.0.10.0040.00416.95
8.0.00.0100.01016.89
7.4.330.0000.00515.55
7.4.320.0000.00616.50
7.4.300.0000.00616.66
7.4.290.0030.00316.51
7.4.280.0070.00016.56
7.4.270.0000.00716.61
7.4.260.0060.00316.64
7.4.250.0040.00416.45
7.4.240.0040.00416.54
7.4.230.0030.00316.52
7.4.220.0040.00416.52
7.4.210.0110.00816.63
7.4.200.0030.00316.43
7.4.160.0100.01016.41
7.4.150.0070.01017.40
7.4.140.0110.00817.86
7.4.130.0070.01016.66
7.4.120.0130.00716.46
7.4.110.0090.00916.41
7.4.100.0130.00716.50
7.4.90.0110.01116.41
7.4.80.0100.01019.39
7.4.70.0140.00716.50
7.4.60.0070.01016.38
7.4.50.0070.00716.46
7.4.40.0180.00016.72
7.4.00.0100.00715.04
7.3.330.0020.00213.15
7.3.320.0030.00313.33
7.3.310.0000.00716.35
7.3.300.0070.00016.38
7.3.290.0030.00316.25
7.3.280.0070.00916.40
7.3.270.0070.01017.40
7.3.260.0110.00816.58
7.3.250.0080.01116.60
7.3.240.0130.00816.37
7.3.230.0060.01316.41
7.3.210.0080.00816.39
7.3.200.0100.00716.36
7.3.190.0090.00616.31
7.3.180.0080.00816.57
7.3.170.0100.00616.52
7.3.160.0000.01816.40
7.3.120.0040.01414.74
7.3.110.0050.01214.79
7.3.100.0090.00714.94
7.3.90.0120.00314.73
7.3.80.0030.01115.00
7.3.70.0040.00614.70
7.3.60.0030.01114.93
7.3.50.0080.00514.74
7.3.40.0050.00614.64
7.3.30.0080.00514.76
7.3.20.0070.01016.73
7.3.10.0030.01316.64
7.3.00.0050.00816.53
7.2.330.0160.00316.80
7.2.320.0060.01016.85
7.2.310.0150.00416.45
7.2.300.0110.00416.68
7.2.290.0060.01016.61
7.2.250.0100.00915.20
7.2.240.0100.00815.08
7.2.230.0080.00715.01
7.2.220.0090.00615.29
7.2.210.0070.00615.17
7.2.200.0050.01015.09
7.2.190.0050.01015.08
7.2.180.0040.01115.07
7.2.170.0040.00615.05
7.2.80.0000.01516.52
7.2.60.0060.00616.98
7.2.10.0470.01418.13
7.2.00.0660.01118.14
7.1.330.0040.01115.88
7.1.320.0050.00815.97
7.1.310.0110.00215.71
7.1.300.0040.00715.75
7.1.290.0030.01015.75
7.1.280.0090.00415.68
7.1.270.0090.00615.84
7.1.260.0040.00415.87
7.1.200.0080.00315.91
7.1.130.0510.02217.12
7.1.120.0320.01016.80
7.1.110.0460.00316.04
7.1.100.0320.01416.52
7.1.90.0380.00716.37
7.1.80.0490.00916.17
7.1.70.0060.01215.23
7.1.60.0340.01233.31
7.1.50.0560.00633.05
7.1.40.0200.01332.50
7.1.30.0280.01632.68
7.1.20.0650.01032.52
7.1.10.0620.00714.84
7.1.00.0290.00614.79

preferences:
17.57 ms | 401 KiB | 5 Q