3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "[spoiler]Test\ntesting[/spoiler]."; $text = preg_replace_callback("/\[(.*?)\]/", function($match){ echo "test"; $lines = explode("\n", str_rot13($match[0])); $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.0170.00316.75
8.3.50.0020.01822.26
8.3.40.0080.00818.92
8.3.30.0120.00319.01
8.3.20.0070.00020.38
8.3.10.0080.00023.66
8.3.00.0040.00420.94
8.2.180.0090.00918.41
8.2.170.0110.00422.96
8.2.160.0100.00320.21
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0090.00019.51
8.2.110.0050.00519.31
8.2.100.0080.00318.03
8.2.90.0050.00319.26
8.2.80.0040.00417.97
8.2.70.0000.00817.88
8.2.60.0000.00918.04
8.2.50.0040.00418.07
8.2.40.0040.00420.14
8.2.30.0040.00418.17
8.2.20.0040.00417.79
8.2.10.0040.00418.21
8.2.00.0030.00519.68
8.1.280.0100.00325.92
8.1.270.0050.00323.95
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00322.73
8.1.230.0040.00819.07
8.1.220.0000.00817.79
8.1.210.0000.00818.77
8.1.200.0060.00317.61
8.1.190.0000.00817.35
8.1.180.0050.00318.10
8.1.170.0030.00518.78
8.1.160.0050.00218.92
8.1.150.0000.00718.68
8.1.140.0030.00617.52
8.1.130.0070.00017.91
8.1.120.0040.00417.61
8.1.110.0020.00517.63
8.1.100.0050.00217.52
8.1.90.0070.00017.64
8.1.80.0080.00017.58
8.1.70.0040.00417.58
8.1.60.0040.00417.75
8.1.50.0030.00517.64
8.1.40.0000.00817.57
8.1.30.0000.00917.65
8.1.20.0060.00317.75
8.1.10.0060.00317.65
8.1.00.0040.00817.73
8.0.300.0000.00818.90
8.0.290.0000.01016.75
8.0.280.0000.00718.49
8.0.270.0070.00017.17
8.0.260.0070.00017.29
8.0.250.0030.00317.13
8.0.240.0070.00316.99
8.0.230.0030.00317.13
8.0.220.0070.00017.04
8.0.210.0030.00317.02
8.0.200.0030.00317.18
8.0.190.0040.00417.11
8.0.180.0060.00317.07
8.0.170.0060.00317.01
8.0.160.0040.00417.11
8.0.150.0000.00717.06
8.0.140.0070.00017.02
8.0.130.0030.00313.50
8.0.120.0040.00417.00
8.0.110.0000.00816.90
8.0.100.0000.00717.12
8.0.90.0040.00417.12
8.0.80.0120.00917.11
8.0.70.0040.00416.94
8.0.60.0040.00417.02
8.0.50.0000.00816.83
8.0.30.0050.01717.16
8.0.20.0090.01117.47
8.0.10.0040.00417.03
8.0.00.0060.01116.85
7.4.330.0050.00015.11
7.4.320.0000.00616.82
7.4.300.0030.00316.82
7.4.290.0070.00016.79
7.4.280.0040.00416.73
7.4.270.0050.00316.74
7.4.260.0030.00316.80
7.4.250.0050.00316.62
7.4.240.0020.00616.82
7.4.230.0030.00316.67
7.4.220.0070.01016.69
7.4.210.0070.00816.93
7.4.200.0000.00816.57
7.4.160.0040.01316.62
7.4.150.0060.01217.40
7.4.140.0130.00817.86
7.4.130.0070.01316.78
7.4.120.0110.00616.84
7.4.110.0070.01016.62
7.4.100.0140.00316.86
7.4.90.0070.01116.69
7.4.80.0140.00419.39
7.4.70.0030.01216.57
7.4.60.0150.00916.64
7.4.50.0000.00816.72
7.4.40.0070.01016.59
7.4.30.0160.00016.61
7.4.00.0090.00915.13
7.3.330.0000.00713.51
7.3.320.0060.00013.49
7.3.310.0030.00316.62
7.3.300.0070.00016.57
7.3.290.0030.01116.43
7.3.280.0030.01316.43
7.3.270.0130.00317.40
7.3.260.0070.01716.80
7.3.250.0040.01216.70
7.3.240.0000.01716.43
7.3.230.0000.01716.54
7.3.210.0060.01016.57
7.3.200.0040.01219.39
7.3.190.0030.01616.78
7.3.180.0100.00916.60
7.3.170.0090.00616.83
7.3.160.0080.00816.49
7.3.120.0040.01115.10
7.3.10.0090.00616.63
7.3.00.0060.00316.73
7.2.330.0060.01316.80
7.2.320.0060.01116.84
7.2.310.0090.00916.91
7.2.300.0170.00616.67
7.2.290.0100.00716.82
7.2.130.0100.00616.98
7.2.120.0100.00717.18
7.2.110.0040.01116.89
7.2.100.0000.01216.92
7.2.90.0030.00717.30
7.2.80.0060.00917.04
7.2.70.0030.01117.34
7.2.60.0060.00317.13
7.2.50.0060.00917.15
7.2.40.0090.00617.09
7.2.30.0100.00717.27
7.2.20.0070.00717.25
7.2.10.0130.00616.78
7.2.00.0090.00917.00
7.1.250.0100.00015.96
7.1.100.0000.01017.99
7.1.70.0040.00417.43
7.1.60.0070.01719.70
7.1.50.0200.01435.05
7.1.00.0030.07722.45
7.0.200.0000.00717.07
7.0.140.0070.07321.92
7.0.60.0070.08020.08
7.0.50.0100.04717.86
7.0.40.0070.08720.29
7.0.30.0300.05020.12
7.0.20.0230.05720.18
7.0.10.0100.07720.12
7.0.00.0070.08320.11
5.6.280.0030.07020.81
5.6.210.0030.08320.52
5.6.200.0070.04018.14
5.6.190.0030.05720.58
5.6.180.4170.04320.48
5.6.170.0230.04320.59
5.6.160.0070.08720.46
5.6.150.0030.07018.18
5.6.140.0070.04718.28
5.6.130.0030.08018.19
5.6.120.0070.08721.14
5.6.110.0130.07721.01
5.6.100.0100.08020.96
5.6.90.0130.06020.98
5.6.80.0030.07720.44
5.6.70.4430.04020.37
5.5.350.0030.03320.43
5.5.340.0030.04717.98
5.5.330.0000.04720.21
5.5.320.0400.06720.19
5.5.310.0400.06320.34
5.5.300.0100.07018.08
5.5.290.0070.07717.92
5.5.280.0100.08320.78
5.5.270.0030.06020.87
5.5.260.0070.07720.84
5.5.250.0100.07020.68
5.5.240.0330.06720.04
5.4.450.0430.04319.92
5.4.440.0300.04319.43
5.4.430.0230.04319.56
5.4.420.0230.04719.64
5.4.410.0870.04319.21
5.4.400.0430.03718.85
5.4.390.0270.05019.06
5.4.380.0330.04018.68
5.4.370.0130.06318.63
5.4.360.0470.05018.73
5.4.350.0300.04318.72
5.4.340.0170.05318.74
5.4.320.0060.04112.50
5.4.310.0070.04512.50
5.4.300.0040.03912.51
5.4.290.0090.03712.50
5.4.280.0080.04012.39
5.4.270.0090.03512.40
5.4.260.0050.03912.39
5.4.250.0040.04012.39
5.4.240.0050.03812.39
5.4.230.0040.04112.39
5.4.220.0050.03812.38
5.4.210.0050.03612.39
5.4.200.0080.03512.38
5.4.190.0070.03412.38
5.4.180.0060.03612.39
5.4.170.0070.03512.40
5.4.160.0080.03312.39
5.4.150.0080.03412.39
5.4.140.0040.03912.07
5.4.130.0060.03512.06
5.4.120.0060.03512.02
5.4.110.0060.03512.01
5.4.100.0100.04412.01
5.4.90.0090.03412.02
5.4.80.0050.03912.01
5.4.70.0080.03212.01
5.4.60.0060.03412.01
5.4.50.0090.03112.01
5.4.40.0040.03612.00
5.4.30.0050.03612.00
5.4.20.0060.03711.99
5.4.10.0050.03511.99
5.4.00.0130.03511.48
5.3.290.0100.04112.80
5.3.280.0110.04712.70
5.3.270.0100.04812.73
5.3.260.0070.03912.71
5.3.250.0090.03512.72
5.3.240.0060.03812.72
5.3.230.0090.03612.71
5.3.220.0070.03612.68
5.3.210.0050.04112.68
5.3.200.0050.03812.68
5.3.190.0050.04012.68
5.3.180.0090.03412.67
5.3.170.0070.03512.67
5.3.160.0060.04012.67
5.3.150.0080.03512.67
5.3.140.0070.03512.66
5.3.130.0080.03612.66
5.3.120.0030.04212.66
5.3.110.0070.04212.66
5.3.100.0100.03312.13
5.3.90.0060.03612.11
5.3.80.0070.03612.10
5.3.70.0120.03112.10
5.3.60.0070.04512.09
5.3.50.0040.03812.04
5.3.40.0050.03812.04
5.3.30.0030.04011.99
5.3.20.0050.03611.77
5.3.10.0040.03811.74
5.3.00.0080.03411.73
5.2.170.0060.0299.18
5.2.160.0040.0329.18
5.2.150.0090.0319.18
5.2.140.0040.0319.17
5.2.130.0020.0329.13
5.2.120.0020.0319.14
5.2.110.0020.0329.14
5.2.100.0100.0259.14
5.2.90.0030.0319.14
5.2.80.0030.0329.14
5.2.70.0020.0329.14
5.2.60.0050.0309.09
5.2.50.0050.0309.05
5.2.40.0030.0319.04
5.2.30.0050.0299.02
5.2.20.0050.0289.00
5.2.10.0040.0318.93
5.2.00.0020.0318.79
5.1.60.0040.0268.07
5.1.50.0070.0228.06
5.1.40.0030.0258.05
5.1.30.0060.0248.40
5.1.20.0030.0278.41
5.1.10.0040.0258.14
5.1.00.0080.0218.14
5.0.50.0030.0216.63
5.0.40.0020.0206.48
5.0.30.0030.0316.29
5.0.20.0070.0166.27
5.0.10.0020.0216.24
5.0.00.0080.0336.23
4.4.90.0040.0144.78
4.4.80.0060.0154.75
4.4.70.0030.0154.76
4.4.60.0010.0174.75
4.4.50.0030.0154.77
4.4.40.0010.0264.70
4.4.30.0010.0174.76
4.4.20.0020.0164.84
4.4.10.0030.0154.85
4.4.00.0030.0244.76
4.3.110.0040.0204.66
4.3.100.0050.0184.67
4.3.90.0030.0144.63
4.3.80.0000.0274.58
4.3.70.0020.0154.63
4.3.60.0020.0154.63
4.3.50.0020.0174.63
4.3.40.0020.0254.54
4.3.30.0030.0153.28
4.3.20.0010.0173.26
4.3.10.0010.0173.22
4.3.00.0030.02015.21

preferences:
39.24 ms | 401 KiB | 5 Q