3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "PHP:\n"; // echo "1: \", "\n"; - syntax error echo "2: \\", "\n"; // outputs \ // echo "3: \\\", "\n"; - syntax error echo "4: \\\\", "\n"; // outputs \\ // echo "5: \\\\\", "\n"; - syntax error echo "6: \\\\\\", "\n"; // outputs \\\ // echo "7: \\\\\\\", "\n"; - syntax error echo "8: \\\\\\\\", "\n"; // outputs \\\\ echo "\nPHP + PCRE:\n"; // skipping odd counts because they're all syntax errors echo "2: ", preg_replace('/^/', '\\', ""), "\n"; // PCRE receives \ and allows it as a lone \ -> output \ echo "4: ", preg_replace('/^/', '\\\\', ""), "\n"; // PCRE receives \\ and interprets it as \ -> output \ echo "6: ", preg_replace('/^/', '\\\\\\', ""), "\n"; // PCRE receives \\\ and interprets it as \ + lone \ -> output \\ echo "8: ", preg_replace('/^/', '\\\\\\\\', ""), "\n"; // PCRE receives \\\\ and interprets it as \\ -> output \\

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.0220.00016.75
8.3.50.0120.00918.45
8.3.40.0120.00318.89
8.3.30.0120.00618.81
8.3.20.0040.00420.16
8.3.10.0050.00321.95
8.3.00.0030.00522.44
8.2.180.0140.01018.54
8.2.170.0110.00422.96
8.2.160.0110.00419.34
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00022.14
8.2.120.0040.00426.35
8.2.110.0090.00020.52
8.2.100.0040.00817.91
8.2.90.0000.00818.96
8.2.80.0000.00817.97
8.2.70.0050.00317.25
8.2.60.0080.00017.80
8.2.50.0040.00418.10
8.2.40.0000.00822.40
8.2.30.0030.00619.18
8.2.20.0000.00717.80
8.2.10.0040.00418.03
8.2.00.0040.00417.65
8.1.280.0110.00725.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0130.00322.18
8.1.230.0110.00022.16
8.1.220.0060.00317.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0000.00819.19
8.1.180.0000.00818.10
8.1.170.0030.00618.66
8.1.160.0050.00322.17
8.1.150.0030.00318.78
8.1.140.0000.00719.51
8.1.130.0080.00017.45
8.1.120.0000.00817.54
8.1.110.0000.00817.47
8.1.100.0030.00517.45
8.1.90.0080.00017.41
8.1.80.0040.00417.52
8.1.70.0030.00317.55
8.1.60.0000.01117.49
8.1.50.0060.00317.46
8.1.40.0030.00517.54
8.1.30.0040.00417.67
8.1.20.0050.00317.75
8.1.10.0000.00717.51
8.1.00.0000.00717.52
8.0.300.0000.00819.03
8.0.290.0080.00016.88
8.0.280.0080.00018.31
8.0.270.0080.00017.22
8.0.260.0000.00816.97
8.0.250.0000.00717.09
8.0.240.0070.00017.00
8.0.230.0000.00717.08
8.0.220.0060.00316.87
8.0.210.0030.00316.83
8.0.200.0000.00617.05
8.0.190.0050.00317.06
8.0.180.0000.00716.97
8.0.170.0000.00716.91
8.0.160.0000.00717.00
8.0.150.0050.00216.97
8.0.140.0000.00716.96
8.0.130.0030.00313.34
8.0.120.0030.00516.84
8.0.110.0000.00717.02
8.0.100.0070.00016.85
8.0.90.0030.00617.01
8.0.80.0080.00817.04
8.0.70.0030.00616.96
8.0.60.0070.00016.77
8.0.50.0000.00717.02
8.0.30.0110.00817.25
8.0.20.0120.00917.40
8.0.10.0040.00416.84
8.0.00.0160.00716.86
7.4.330.0050.00015.08
7.4.320.0000.00716.62
7.4.300.0030.00316.65
7.4.290.0000.01116.61
7.4.280.0060.00316.68
7.4.270.0000.00716.66
7.4.260.0000.00716.68
7.4.250.0040.00416.63
7.4.240.0000.00716.49
7.4.230.0000.00716.60
7.4.220.0160.00616.76
7.4.210.0110.00416.66
7.4.200.0000.00716.48
7.4.160.0080.00616.52
7.4.150.0120.00917.40
7.4.140.0090.00917.86
7.4.130.0090.00916.55
7.4.120.0120.00516.52
7.4.110.0130.00316.60
7.4.100.0150.00816.59
7.4.90.0060.01316.68
7.4.80.0140.00319.39
7.4.70.0130.00416.72
7.4.60.0070.01016.55
7.4.50.0090.00316.74
7.4.40.0070.01116.79
7.4.30.0070.01116.69
7.4.00.0100.00614.71
7.3.330.0070.00013.28
7.3.320.0050.00013.26
7.3.310.0040.00516.38
7.3.300.0030.00316.45
7.3.290.0060.00916.32
7.3.280.0080.00816.32
7.3.270.0060.01117.40
7.3.260.0120.00516.48
7.3.250.0080.01316.46
7.3.240.0090.01016.56
7.3.230.0110.00716.39
7.3.210.0090.00916.57
7.3.200.0120.00316.64
7.3.190.0130.00316.38
7.3.180.0130.01016.30
7.3.170.0090.01016.40
7.3.160.0090.01616.80
7.2.330.0140.00316.72
7.2.320.0110.00716.45
7.2.310.0000.01616.70
7.2.300.0080.00816.56
7.2.290.0100.00916.64
7.2.60.0030.01017.04
7.2.00.0120.00419.35
7.1.200.0040.01116.02
7.1.70.0130.00017.40
7.1.60.0030.01017.37
7.1.00.0030.07722.59
7.0.200.0110.00416.97
7.0.100.0930.05319.96
7.0.90.0830.06019.90
7.0.80.0900.05319.88
7.0.70.0100.05720.00
7.0.60.0130.05320.01
7.0.50.0930.06720.30
7.0.40.1030.05020.39
7.0.30.0970.07320.39
7.0.20.0830.05320.37
7.0.10.0900.05020.27
7.0.00.0870.06020.43
5.6.250.0130.05320.59
5.6.240.0170.05020.63
5.6.230.0130.05320.65
5.6.220.0200.05320.54
5.6.210.0170.05020.60
5.6.200.0100.06021.05
5.6.190.0170.05021.06
5.6.180.0170.05321.05
5.6.170.0170.05021.15
5.6.160.0070.06721.02
5.6.150.0070.06021.16
5.6.140.0130.05321.01
5.6.130.0170.05321.08
5.6.120.0230.05321.06
5.6.110.0200.05321.16
5.6.100.0200.05021.16
5.6.90.0100.06320.93
5.6.80.0170.04720.43
5.6.70.0170.05020.49
5.6.60.0070.06020.38
5.6.50.0130.05020.50
5.6.40.0100.05320.48
5.6.30.0070.06320.53
5.6.20.0070.05720.37
5.6.10.0200.04320.35
5.6.00.0100.05020.41

preferences:
62.93 ms | 401 KiB | 5 Q