3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encrypt($string) { $pad = 'abcde'; $encrypted_string = ""; for ($i = 0; $i < strlen($string); $i++) { $char = $string[$i]; if ($i < strlen($pad) && preg_match("/[a-z]/i", $char)) { $shift_char = $pad[$i]; $ord_shift = ctype_upper($shift_char) ? 65 : 97; $shift_amount = ord($shift_char) - $ord_shift; if ($shift_amount) { $ord_char = ord($char) + $shift_amount; while ($ord_char > $ord_shift + 26) { $ord_char -= 26; } $char = chr($ord_char); } } $encrypted_string .= $char; } return $encrypted_string; } echo encrypt('thiS is a test');

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.0150.00016.88
8.3.50.0140.00916.67
8.3.40.0110.00419.07
8.3.30.0130.00318.92
8.3.20.0040.00418.88
8.3.10.0040.00420.82
8.3.00.0060.00319.38
8.2.180.0070.00716.74
8.2.170.0110.00422.96
8.2.160.0070.00721.39
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0020.00519.95
8.2.110.0090.00022.15
8.2.100.0060.00618.16
8.2.90.0030.00518.03
8.2.80.0090.00017.97
8.2.70.0050.00317.75
8.2.60.0040.00417.93
8.2.50.0060.00318.07
8.2.40.0000.00818.22
8.2.30.0000.00718.03
8.2.20.0030.00517.93
8.2.10.0050.00317.89
8.2.00.0030.00817.89
8.1.280.0040.01125.92
8.1.270.0000.00724.66
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0050.00522.06
8.1.230.0060.00620.99
8.1.220.0040.00417.76
8.1.210.0090.00018.85
8.1.200.0060.00317.47
8.1.190.0040.00417.51
8.1.180.0030.00618.10
8.1.170.0040.00418.77
8.1.160.0040.00418.93
8.1.150.0000.00818.79
8.1.140.0040.00417.60
8.1.130.0030.00317.96
8.1.120.0040.00417.65
8.1.110.0070.00017.63
8.1.100.0040.00417.55
8.1.90.0000.00717.59
8.1.80.0040.00417.54
8.1.70.0000.00817.50
8.1.60.0080.00017.79
8.1.50.0000.00717.52
8.1.40.0050.00317.59
8.1.30.0040.00417.78
8.1.20.0030.00917.79
8.1.10.0080.00017.63
8.1.00.0000.00817.68
8.0.300.0040.00419.98
8.0.290.0030.00516.75
8.0.280.0000.00718.34
8.0.270.0040.00417.24
8.0.260.0000.00717.04
8.0.250.0070.00016.98
8.0.240.0100.00017.13
8.0.230.0000.00717.07
8.0.220.0000.00717.00
8.0.210.0070.00017.06
8.0.200.0040.00417.13
8.0.190.0070.00017.07
8.0.180.0020.00517.09
8.0.170.0040.00416.95
8.0.160.0000.00717.01
8.0.150.0040.00416.88
8.0.140.0040.00417.05
8.0.130.0000.00713.49
8.0.120.0020.00516.89
8.0.110.0030.00617.07
8.0.100.0040.00416.86
8.0.90.0030.00517.02
8.0.80.0110.00817.01
8.0.70.0000.00717.02
8.0.60.0000.00717.03
8.0.50.0000.00817.05
8.0.30.0110.00817.05
8.0.20.0100.00817.41
8.0.10.0000.00717.00
8.0.00.0090.01117.22
7.4.330.0050.00013.20
7.4.320.0060.00016.73
7.4.300.0000.00616.67
7.4.290.0000.00716.62
7.4.280.0000.00916.79
7.4.270.0070.00016.86
7.4.260.0050.00013.45
7.4.250.0000.00816.81
7.4.240.0000.00816.82
7.4.230.0030.00316.74
7.4.220.0130.01016.76
7.4.210.0090.00716.80
7.4.200.0000.00716.70
7.4.190.0040.00416.86
7.4.160.0070.00716.77
7.4.150.0090.00916.74
7.4.140.0050.01216.73
7.4.130.0070.01316.64
7.4.120.0100.00716.75
7.4.110.0100.00716.68
7.4.100.0150.00316.91
7.4.90.0090.01216.72
7.4.80.0080.00816.67
7.4.70.0060.01216.61
7.4.60.0050.01816.48
7.4.50.0030.00316.38
7.4.40.0140.00316.71
7.4.30.0000.01616.52
7.4.10.0030.01216.70
7.4.00.0050.01415.94
7.3.330.0060.00013.32
7.3.320.0030.00313.46
7.3.310.0030.00516.51
7.3.300.0000.00716.52
7.3.290.0030.01216.52
7.3.280.0070.00916.50
7.3.270.0120.00616.52
7.3.260.0130.00616.52
7.3.250.0090.01216.65
7.3.240.0110.00716.49
7.3.230.0100.00616.64
7.3.210.0060.01216.50
7.3.200.0070.01019.39
7.3.190.0140.00716.50
7.3.180.0070.01016.50
7.3.170.0070.01016.62
7.3.160.0130.00316.72
7.3.130.0090.00916.66
7.3.120.0090.00915.98
7.3.110.0080.01116.70
7.3.100.0100.00316.39
7.3.90.0040.01116.64
7.3.80.0060.01116.61
7.3.70.0130.00616.54
7.3.60.0100.00716.61
7.3.50.0050.00516.55
7.3.40.0040.00716.64
7.3.30.0070.00716.31
7.3.20.0000.01318.54
7.3.10.0080.01017.23
7.3.00.0090.00817.47
7.2.330.0060.01216.98
7.2.320.0110.00716.88
7.2.310.0200.00016.80
7.2.300.0090.00917.03
7.2.290.0060.01016.67
7.2.260.0110.00716.62
7.2.250.0030.01516.90
7.2.240.0080.01117.04
7.2.230.0070.01116.88
7.2.220.0070.01016.78
7.2.210.0080.01116.74
7.2.200.0130.00316.79
7.2.190.0090.00616.76
7.2.180.0140.00416.70
7.2.170.0040.00716.77
7.2.160.0120.00316.71
7.2.150.0030.01218.59
7.2.140.0040.00818.54
7.2.130.0050.01317.75
7.2.120.0090.00617.70
7.2.110.0080.00817.73
7.2.100.0070.00917.55
7.2.90.0100.00817.78
7.2.80.0090.01017.73
7.2.70.0100.00717.48
7.2.60.0100.00917.81
7.2.50.0080.01117.72
7.2.40.0120.00717.57
7.2.30.0140.00617.67
7.2.20.0100.01017.83
7.2.10.0120.00917.61
7.2.00.0100.00718.41
7.1.330.0040.01017.50
7.1.320.0060.01217.80
7.1.310.0030.01417.49
7.1.300.0090.00617.34
7.1.290.0100.00717.69
7.1.280.0080.00417.40
7.1.270.0090.00617.56
7.1.260.0090.00917.54
7.1.250.0070.00716.67
7.1.240.0070.00417.39
7.1.230.0040.00817.50
7.1.220.0040.00417.53
7.1.210.0110.00417.53
7.1.200.0040.01117.53
7.1.190.0100.00717.53
7.1.180.0040.01217.66
7.1.170.0100.00317.40
7.1.160.0000.01617.58
7.1.150.0110.00317.34
7.1.140.0030.01117.49
7.1.130.0060.00917.39
7.1.120.0100.00317.32
7.1.110.0140.00017.63
7.1.100.0050.00918.10
7.1.90.0030.01217.48
7.1.80.0070.00317.52
7.1.70.0040.00517.47
7.1.60.0050.01318.48
7.1.50.0110.00617.35
7.1.40.0060.00917.70
7.1.30.0000.01117.50
7.1.20.0060.00917.55
7.1.10.0140.00317.67
7.1.00.0050.03819.93
7.0.330.0060.00616.96
7.0.320.0040.01116.89
7.0.310.0060.00917.38
7.0.300.0120.00017.32
7.0.290.0070.00617.06
7.0.280.0130.00317.21
7.0.270.0000.01517.39
7.0.260.0070.00717.33
7.0.250.0030.01417.21
7.0.240.0080.00817.17
7.0.230.0070.00717.16
7.0.220.0030.01417.09
7.0.210.0090.00317.21
7.0.200.0180.00715.93
7.0.190.0070.01017.36
7.0.180.0060.00917.36
7.0.170.0000.01217.36
7.0.160.0060.00617.28
7.0.150.0000.00917.34
7.0.140.0100.03719.75
7.0.130.0070.00717.22
7.0.120.0050.04019.69
7.0.110.0070.01017.30
7.0.100.0070.01417.13
7.0.90.0080.00417.36
7.0.80.0040.01117.04
7.0.70.0130.00717.24
7.0.60.0030.03318.54
7.0.50.0100.02817.50
7.0.40.0080.02517.75
7.0.30.0210.03817.66
7.0.20.0220.04217.55
7.0.10.0070.04617.64
7.0.00.0100.04517.61
5.6.400.0060.00916.34
5.6.390.0100.00316.13
5.6.380.0040.01116.18
5.6.370.0030.00616.41
5.6.360.0060.00615.68
5.6.350.0000.01416.37
5.6.340.0000.01616.12
5.6.330.0050.00516.19
5.6.320.0060.00316.22
5.6.310.0100.00616.22
5.6.300.0000.01615.91
5.6.290.0080.00316.30
5.6.280.0070.04118.51
5.6.270.0070.01016.02
5.6.260.0090.00616.14
5.6.250.0070.00716.00
5.6.240.0040.01215.96
5.6.230.0100.01315.98
5.6.220.0030.01415.82
5.6.210.0050.04918.24
5.6.200.0050.04517.02
5.6.190.0050.03118.38
5.6.180.0280.02518.34
5.6.170.0150.04518.40
5.6.160.0140.03918.16
5.6.150.0080.02316.96
5.6.140.0070.02317.15
5.6.130.0080.04717.09
5.6.120.0110.03318.52
5.6.110.0120.04518.54
5.6.100.0080.04518.43
5.6.90.0120.03518.40
5.6.80.0100.03918.22
5.6.70.0040.01115.78
5.6.60.0070.01416.12
5.6.50.0070.00716.05
5.6.40.0100.00315.76
5.6.30.0030.01016.13
5.6.20.0080.00315.91
5.6.10.0090.00615.89
5.6.00.0040.01415.95
5.5.380.0040.01816.06
5.5.370.0060.01216.23
5.5.360.0060.00816.03
5.5.350.0140.04718.24
5.5.340.0050.02717.03
5.5.330.0060.03818.02
5.5.320.0170.04218.17
5.5.310.0220.04118.22
5.5.300.0070.02516.91
5.5.290.0070.04716.88
5.5.280.0060.04818.42
5.5.270.0090.02318.44
5.5.260.0050.04518.53
5.5.250.0060.04918.17
5.5.240.0130.03518.05
5.5.230.0120.00815.91
5.5.220.0060.00616.00
5.5.210.0040.01115.93
5.5.200.0040.00915.93
5.5.190.0030.01015.78
5.5.180.0000.01815.66
5.5.170.0070.00315.87
5.5.160.0140.00416.04
5.5.150.0120.00615.86
5.5.140.0090.00915.93
5.5.130.0070.01015.87
5.5.120.0000.01616.07
5.5.110.0070.00715.78
5.5.100.0060.00615.99
5.5.90.0030.01316.00
5.5.80.0100.00715.67
5.5.70.0070.01115.88
5.5.60.0040.01515.83
5.5.50.0070.01015.67
5.5.40.0030.01015.77
5.5.30.0090.00615.90
5.5.20.0110.01115.83
5.5.10.0110.00716.04
5.5.00.0080.00915.76
5.4.450.0120.02316.23
5.4.440.0170.02816.07
5.4.430.0080.02616.19
5.4.420.0080.04916.08
5.4.410.0080.03316.09
5.4.400.0140.02815.77
5.4.390.0150.02615.97
5.4.380.0090.02615.99
5.4.370.0100.02916.04
5.4.360.0080.02515.99
5.4.350.0130.02615.98
5.4.340.0140.02615.82
5.4.330.0030.00912.74
5.4.320.0130.02516.00
5.4.310.0130.02616.01
5.4.300.0080.03615.91
5.4.290.0170.02116.10
5.4.280.0150.02515.97
5.4.270.0120.03515.84
5.4.260.0110.03815.86
5.4.250.0130.02715.84
5.4.240.0130.02315.97
5.4.230.0150.02715.95
5.4.220.0100.03715.92
5.4.210.0170.02515.86
5.4.200.0120.03415.93
5.4.190.0110.02815.85
5.4.180.0120.03216.01
5.4.170.0030.02715.74
5.4.160.0100.02815.85
5.4.150.0120.02915.95
5.4.140.0130.02214.51
5.4.130.0100.02214.61
5.4.120.0100.02214.58
5.4.110.0130.02214.63
5.4.100.0140.01714.68
5.4.90.0150.02314.53
5.4.80.0140.02014.67
5.4.70.0130.02514.62
5.4.60.0130.03014.61
5.4.50.0130.02014.35
5.4.40.0210.01814.73
5.4.30.0180.03014.48
5.4.20.0130.02014.68
5.4.10.0120.02314.68
5.4.00.0130.02814.31
5.3.290.0130.02913.89
5.3.280.0110.02213.80
5.3.270.0140.02713.86
5.3.260.0120.02813.96
5.3.250.0140.02013.88
5.3.240.0150.04713.90
5.3.230.0140.02013.75
5.3.220.0180.03413.80
5.3.210.0150.03313.72
5.3.200.0130.02113.80
5.3.190.0150.03513.94
5.3.180.0120.02813.93
5.3.170.0080.03913.79
5.3.160.0100.03013.96
5.3.150.0170.03813.87
5.3.140.0090.02313.85
5.3.130.0120.02613.85
5.3.120.0140.02213.82
5.3.110.0190.03513.86
5.3.100.0150.01713.49
5.3.90.0110.02313.59
5.3.80.0130.02813.60
5.3.70.0090.02513.48
5.3.60.0180.02313.58
5.3.50.0190.03713.50
5.3.40.0130.02713.43
5.3.30.0130.02013.51
5.3.20.0110.02313.32
5.3.10.0120.02813.27
5.3.00.0100.02713.25
5.2.170.0170.04011.22
5.2.160.0230.04011.37
5.2.150.0200.03711.07
5.2.140.0030.05711.10
5.2.130.0070.04011.09
5.2.120.0000.05711.00
5.2.110.0000.03711.02
5.2.100.0830.03011.03
5.2.90.1370.02711.08
5.2.80.1500.04011.32
5.2.70.0430.03011.07
5.2.60.0070.05710.98
5.2.50.0100.04011.13
5.2.40.0500.05010.93
5.2.30.1300.03710.89
5.2.20.1330.02310.87
5.2.10.1270.03310.79
5.2.00.1330.03010.67
5.1.60.1070.02010.05
5.1.50.0970.03010.08
5.1.40.1070.02010.20
5.1.30.1000.03010.48
5.1.20.0970.03010.40
5.1.10.0970.0309.96
5.1.00.0970.0309.96
5.0.50.0700.0309.41
5.0.40.0530.0209.41
5.0.30.0630.0439.41
5.0.20.0600.0209.41
5.0.10.0500.0209.41
5.0.00.0570.0279.41
4.4.90.0130.0179.41
4.4.80.0070.0339.41
4.4.70.0070.0239.41
4.4.60.0000.0279.41
4.4.50.0030.0179.41
4.4.40.0030.0509.41
4.4.30.0000.0409.41
4.4.20.0030.0279.41
4.4.10.0030.0179.41
4.4.00.0500.0239.41
4.3.110.0770.0209.41
4.3.100.0600.0139.41
4.3.90.0570.0179.41
4.3.80.0570.0209.41
4.3.70.0770.0179.41
4.3.60.0600.0179.41
4.3.50.0670.0279.41
4.3.40.0670.0379.41
4.3.30.0300.0139.41
4.3.20.0230.0179.41
4.3.10.0330.0279.41
4.3.00.0270.0209.41

preferences:
39.88 ms | 401 KiB | 5 Q