3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "[spoiler]Test\ntesting[/spoiler]."; $text = preg_replace_callback("/\[spoiler\](.*?)\[\/spoiler\]/", function($match){ $lines = explode("\n", str_rot13(substr($match[0]))); echo "test"; $output = ""; foreach ($lines as $line) { $output .= "[spoiler]".$line."[/spoiler]"; } return $output; }, $text ); echo $text; ?>

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.0070.01116.50
8.3.50.0130.00222.12
8.3.40.0070.00718.83
8.3.30.0100.00319.13
8.3.20.0060.00320.16
8.3.10.0060.00323.52
8.3.00.0080.00020.71
8.2.180.0060.00916.63
8.2.170.0120.00622.96
8.2.160.0030.01020.40
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0040.00419.48
8.2.110.0070.00419.21
8.2.100.0080.00417.84
8.2.90.0050.00319.23
8.2.80.0000.00817.97
8.2.70.0040.00417.75
8.2.60.0000.00917.80
8.2.50.0040.00418.07
8.2.40.0040.00420.07
8.2.30.0040.00418.34
8.2.20.0040.00417.87
8.2.10.0000.00718.23
8.2.00.0040.00419.55
8.1.280.0150.00625.92
8.1.270.0060.00323.92
8.1.260.0000.00726.35
8.1.250.0020.00528.09
8.1.240.0060.00322.02
8.1.230.0070.00419.01
8.1.220.0030.00617.74
8.1.210.0000.00818.77
8.1.200.0090.00017.47
8.1.190.0080.00017.35
8.1.180.0050.00318.10
8.1.170.0040.00418.77
8.1.160.0000.00722.05
8.1.150.0040.00418.68
8.1.140.0040.00417.63
8.1.130.0030.00317.83
8.1.120.0040.00717.70
8.1.110.0030.00617.64
8.1.100.0080.00017.66
8.1.90.0000.00817.55
8.1.80.0060.00317.59
8.1.70.0030.00317.60
8.1.60.0030.00517.72
8.1.50.0040.00417.64
8.1.40.0030.00617.63
8.1.30.0060.00317.71
8.1.20.0050.00317.79
8.1.10.0040.00417.74
8.1.00.0040.00417.58
8.0.300.0080.00018.77
8.0.290.0000.00716.75
8.0.280.0030.00318.43
8.0.270.0000.00717.28
8.0.260.0000.00717.28
8.0.250.0040.00417.15
8.0.240.0000.00717.02
8.0.230.0000.00716.97
8.0.220.0030.00317.02
8.0.210.0030.00516.90
8.0.200.0040.00417.09
8.0.190.0000.00717.04
8.0.180.0020.00817.08
8.0.170.0040.00417.10
8.0.160.0070.00017.03
8.0.150.0000.00717.00
8.0.140.0000.00716.89
8.0.130.0030.00313.47
8.0.120.0060.00316.96
8.0.110.0070.00017.00
8.0.100.0040.00417.11
8.0.90.0050.00216.99
8.0.80.0070.01417.03
8.0.70.0030.00517.04
8.0.60.0040.00417.00
8.0.50.0040.00416.86
8.0.30.0060.01517.24
8.0.20.0100.00817.48
8.0.10.0000.00717.16
8.0.00.0130.00317.05
7.4.330.0050.00015.23
7.4.320.0040.00416.86
7.4.300.0030.00316.82
7.4.290.0000.00716.82
7.4.280.0070.00016.63
7.4.270.0070.00016.71
7.4.260.0000.00916.70
7.4.250.0000.00816.77
7.4.240.0040.00416.73
7.4.230.0000.00716.93
7.4.220.0070.01016.68
7.4.210.0030.01016.81
7.4.200.0030.00316.82
7.4.160.0130.00416.77
7.4.150.0110.00717.40
7.4.140.0080.00917.86
7.4.130.0070.01016.79
7.4.120.0090.00816.69
7.4.110.0100.00616.66
7.4.100.0030.01316.61
7.4.90.0110.00616.53
7.4.80.0100.01019.39
7.4.70.0030.01316.75
7.4.60.0030.01316.56
7.4.50.0000.00416.75
7.4.40.0060.01016.69
7.4.30.0130.00316.45
7.4.00.0040.01415.00
7.3.330.0030.00313.31
7.3.320.0030.00213.48
7.3.310.0030.00316.49
7.3.300.0000.00716.46
7.3.290.0120.00316.48
7.3.280.0120.00716.45
7.3.270.0040.01317.40
7.3.260.0120.00616.73
7.3.250.0100.00716.66
7.3.240.0110.00416.48
7.3.230.0080.00816.69
7.3.210.0030.01416.43
7.3.200.0160.00019.39
7.3.190.0100.01316.73
7.3.180.0090.00916.47
7.3.170.0060.01116.79
7.3.160.0070.01316.62
7.3.120.0000.01515.18
7.3.10.0000.01716.93
7.3.00.0060.00316.88
7.2.330.0180.00016.88
7.2.320.0130.00316.78
7.2.310.0070.01016.88
7.2.300.0060.01016.93
7.2.290.0130.00316.96
7.2.130.0090.00917.27
7.2.120.0130.00017.09
7.2.110.0070.00717.09
7.2.100.0070.00317.07
7.2.90.0030.01216.82
7.2.80.0080.00817.22
7.2.70.0060.00617.20
7.2.60.0040.01116.98
7.2.50.0030.00716.99
7.2.40.0130.00017.07
7.2.30.0030.01216.87
7.2.20.0060.00616.86
7.2.10.0060.00916.70
7.2.00.0070.00717.14
7.1.250.0090.00416.06
7.1.70.0070.00017.28
7.1.60.0140.01019.70
7.1.50.0070.01417.09
7.1.00.0000.08022.46
7.0.200.0040.00416.98
7.0.140.0030.07322.15
7.0.60.0130.06020.08
7.0.50.0200.06717.94
7.0.40.0030.08020.26
7.0.30.0200.07020.14
7.0.20.0230.04020.13
7.0.10.0100.04320.25
7.0.00.0030.08320.09
5.6.280.0000.07721.11
5.6.210.0070.07720.61
5.6.200.0100.08318.15
5.6.190.0070.04320.64
5.6.180.2970.04720.39
5.6.170.0130.04320.47
5.6.160.0130.08320.47
5.6.150.0130.07318.15
5.6.140.0130.07318.13
5.6.130.0130.03318.14
5.6.120.0100.08021.00
5.6.110.0030.08720.89
5.6.100.0130.06321.00
5.6.90.0130.07720.95
5.6.80.0030.07320.38
5.5.350.0030.03020.41
5.5.340.0100.03317.99
5.5.330.0030.04320.31
5.5.320.0370.06320.34
5.5.310.0230.06320.26
5.5.300.0000.04017.98
5.5.290.0000.05018.07
5.5.280.0070.08320.88
5.5.270.0070.03720.79
5.5.260.0000.05020.68
5.5.250.0100.04720.58
5.5.240.4100.04020.34
5.4.450.0330.04319.81
5.4.440.0130.05019.55
5.4.430.0300.04319.54
5.4.420.0400.03719.45
5.4.410.0170.04319.35
5.4.400.0230.04019.25
5.4.390.0200.05019.14
5.4.380.0130.06718.62
5.4.370.0270.04318.73
5.4.360.0200.05018.48
5.4.350.0130.05718.82
5.4.340.0200.05318.51
5.4.320.0070.03712.50
5.4.310.0060.05112.50
5.4.300.0070.04012.50
5.4.290.0070.03812.50
5.4.280.0080.03512.40
5.4.270.0040.03912.39
5.4.260.0060.03712.40
5.4.250.0050.04112.39
5.4.240.0060.03912.39
5.4.230.0090.04912.39
5.4.220.0060.03812.39
5.4.210.0060.03612.39
5.4.200.0030.04212.39
5.4.190.0090.03712.39
5.4.180.0050.04612.38
5.4.170.0060.03712.40
5.4.160.0080.03812.39
5.4.150.0130.04412.38
5.4.140.0070.04012.07
5.4.130.0110.04612.06
5.4.120.0090.05012.02
5.4.110.0080.04012.01
5.4.100.0070.04112.02
5.4.90.0130.04312.01
5.4.80.0070.04012.02
5.4.70.0100.05012.01
5.4.60.0040.05812.01
5.4.50.0070.05412.00
5.4.40.0030.05712.00
5.4.30.0060.05311.99
5.4.20.0040.05711.99
5.4.10.0100.05112.00
5.4.00.0100.03811.48
5.3.290.0040.04112.80
5.3.280.0130.05112.71
5.3.270.0050.04612.72
5.3.260.0070.06012.72
5.3.250.0090.04012.72
5.3.240.0060.04212.71
5.3.230.0060.04312.71
5.3.220.0050.04112.68
5.3.210.0080.04012.68
5.3.200.0130.04812.68
5.3.190.0110.04712.68
5.3.180.0080.03912.67
5.3.170.0090.05312.67
5.3.160.0070.04212.67
5.3.150.0100.03512.67
5.3.140.0100.04512.66
5.3.130.0080.04312.66
5.3.120.0030.04412.66
5.3.110.0050.04112.66
5.3.100.0100.03412.13
5.3.90.0040.03812.11
5.3.80.0080.03412.11
5.3.70.0070.03512.11
5.3.60.0060.03612.09
5.3.50.0060.03712.04
5.3.40.0080.04512.04
5.3.30.0090.05011.99
5.3.20.0080.05111.77
5.3.10.0100.04711.74
5.3.00.0110.04811.73
5.2.170.0060.0429.19
5.2.160.0060.0389.18
5.2.150.0060.0329.18
5.2.140.0040.0429.18
5.2.130.0070.0279.14
5.2.120.0040.0299.14
5.2.110.0050.0369.15
5.2.100.0050.0409.14
5.2.90.0020.0439.14
5.2.80.0100.0329.14
5.2.70.0070.0359.14
5.2.60.0080.0399.09
5.2.50.0080.0319.05
5.2.40.0050.0299.04
5.2.30.0050.0319.01
5.2.20.0060.0299.00
5.2.10.0040.0308.93
5.2.00.0020.0338.79
5.1.60.0030.0258.07
5.1.50.0060.0248.07
5.1.40.0030.0268.05
5.1.30.0020.0288.40
5.1.20.0050.0268.42
5.1.10.0040.0268.14
5.1.00.0010.0298.14
5.0.50.0050.0206.63
5.0.40.0090.0216.48
5.0.30.0030.0366.29
5.0.20.0030.0286.27
5.0.10.0040.0296.24
5.0.00.0030.0426.23
4.4.90.0040.0224.78
4.4.80.0060.0214.76
4.4.70.0020.0244.75
4.4.60.0030.0224.75
4.4.50.0030.0234.77
4.4.40.0040.0344.71
4.4.30.0030.0224.76
4.4.20.0020.0224.84
4.4.10.0020.0234.85
4.4.00.0050.0314.76
4.3.110.0020.0194.67
4.3.100.0040.0154.66
4.3.90.0060.0304.63
4.3.80.0030.0304.58
4.3.70.0010.0174.63
4.3.60.0070.0154.63
4.3.50.0040.0194.63
4.3.40.0040.0294.54
4.3.30.0020.0223.29
4.3.20.0010.0223.26
4.3.10.0010.0223.22
4.3.00.0000.02014.97

preferences:
32.96 ms | 401 KiB | 5 Q