3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ '"test"', 'test', '\'te\'st"\'', '\'test\'', '\'"test"\'', '\'"te"st"\'', 'This is a test"""""".', 'test\'\'\'\'\'""""""""', 'test\'\'\'\'\'""""""""', '\'\'\'\'"""\'\'\'test\'\'"""\'\'\'', '\'\'\'\'\'""""\'\'' ]; $pattern = "/^['\"]*(.*?)['\"]*$/"; foreach ($strings as $string) { echo preg_replace($pattern, '$1', $string) . PHP_EOL; }

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.5.10.0120.00518.38
8.5.00.0140.00720.18
8.4.160.0130.00919.92
8.4.150.0020.00014.05
8.4.140.0100.01217.95
8.4.130.0130.00717.95
8.4.120.0120.00820.41
8.4.110.0100.01020.54
8.4.100.0070.00319.21
8.4.90.0070.00518.87
8.4.80.0130.00718.79
8.4.70.0040.00418.21
8.4.60.0110.01218.87
8.4.50.0100.00818.70
8.4.40.0150.00317.89
8.4.30.0100.01017.83
8.4.20.0070.01520.49
8.4.10.0090.00019.71
8.3.280.0150.01018.61
8.3.270.0120.00816.66
8.3.260.0110.00716.68
8.3.250.0100.01019.10
8.3.240.0060.00316.86
8.3.230.0070.00516.92
8.3.220.0110.00418.87
8.3.210.0100.00516.89
8.3.200.0120.00716.61
8.3.190.0050.00517.22
8.3.180.0060.00216.59
8.3.170.0150.00420.68
8.3.160.0150.00317.32
8.3.150.0150.00316.74
8.3.140.0030.00516.70
8.3.130.0040.00418.61
8.3.120.0060.00920.52
8.3.110.0040.00718.46
8.3.100.0040.00416.89
8.3.90.0110.00826.77
8.3.80.0060.00317.97
8.3.70.0160.00618.43
8.3.60.0100.01018.81
8.3.50.0070.00918.40
8.3.40.0080.00819.15
8.3.30.0110.00718.88
8.3.20.0080.00020.84
8.3.10.0040.00423.66
8.3.00.0040.00419.91
8.2.290.0080.01120.53
8.2.280.0130.00518.43
8.2.270.0110.00717.29
8.2.260.0040.00417.27
8.2.250.0120.00318.67
8.2.240.0070.00417.20
8.2.230.0090.00020.94
8.2.220.0090.00016.45
8.2.210.0030.00726.77
8.2.200.0000.00916.88
8.2.190.0100.00618.54
8.2.180.0190.00020.11
8.2.170.0090.00622.96
8.2.160.0110.00422.08
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0020.00519.33
8.2.120.0080.00026.35
8.2.110.0000.00922.33
8.2.100.0060.00617.97
8.2.90.0040.00418.28
8.2.80.0040.00418.05
8.2.70.0040.00417.80
8.2.60.0030.00517.89
8.2.50.0060.00318.10
8.2.40.0070.00020.46
8.2.30.0040.00419.39
8.2.20.0000.00718.02
8.2.10.0040.00418.16
8.2.00.0040.00418.25
8.1.330.0110.00922.37
8.1.320.0110.00816.44
8.1.310.0080.00018.41
8.1.300.0000.00819.49
8.1.290.0060.00630.84
8.1.280.0060.01225.92
8.1.270.0040.00420.30
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00322.15
8.1.230.0040.00823.89
8.1.220.0060.00317.74
8.1.210.0030.00518.89
8.1.200.0060.00317.47
8.1.190.0060.00317.35
8.1.180.0110.00318.10
8.1.170.0080.00018.55
8.1.160.0020.00518.86
8.1.150.0000.00720.19
8.1.140.0030.00617.83
8.1.130.0030.00319.10
8.1.120.0000.00817.63
8.1.110.0000.00717.48
8.1.100.0050.00317.51
8.1.90.0040.00417.59
8.1.80.0050.00217.49
8.1.70.0030.00517.50
8.1.60.0040.00417.70
8.1.50.0040.00417.67
8.1.40.0000.00817.63
8.1.30.0040.00417.79
8.1.20.0050.00417.72
8.1.10.0030.00517.55
8.1.00.0050.00417.47
8.0.300.0020.00519.82
8.0.290.0000.00716.75
8.0.280.0080.00018.36
8.0.270.0070.00017.27
8.0.260.0040.00416.95
8.0.250.0000.00617.11
8.0.240.0030.00617.12
8.0.230.0000.00717.11
8.0.220.0000.00717.06
8.0.210.0040.00417.07
8.0.200.0060.00017.00
8.0.190.0080.00317.08
8.0.180.0000.00817.09
8.0.170.0030.00617.05
8.0.160.0040.00416.92
8.0.150.0170.00416.96
8.0.140.0070.00216.89
8.0.130.0090.00015.21
8.0.120.0070.00416.94
8.0.110.0030.00717.00
8.0.100.0050.00617.02
8.0.90.0060.00517.11
8.0.80.0100.00817.04
8.0.70.0050.00617.06
8.0.60.0100.00117.03
8.0.50.0060.00517.00
8.0.30.0110.00817.15
8.0.20.0100.00817.32
8.0.10.0100.00517.14
8.0.00.0130.00317.03
7.4.330.0000.00415.55
7.4.320.0070.00016.66
7.4.300.0000.00616.92
7.4.290.0040.00416.71
7.4.280.0040.00416.90
7.4.270.0060.00616.74
7.4.260.0040.00516.77
7.4.250.0080.00616.69
7.4.240.0070.00616.69
7.4.230.0060.00716.90
7.4.220.0030.01016.82
7.4.210.0140.00516.70
7.4.200.0080.00516.70
7.4.190.0120.00516.78
7.4.180.0170.00016.64
7.4.160.0100.00816.60
7.4.150.0090.00716.89
7.4.140.0100.00917.47
7.4.130.0130.00416.70
7.4.120.0100.00916.74
7.4.110.0130.00416.64
7.4.100.0120.00516.76
7.4.90.0070.00816.68
7.4.80.0080.00817.54
7.4.70.0110.00516.61
7.4.60.0090.00616.67
7.4.50.0100.00516.56
7.4.40.0110.00416.56
7.4.30.0080.00716.66
7.4.20.0070.00916.45
7.4.10.0110.00716.56
7.4.00.0080.00816.08
7.3.330.0050.00714.80
7.3.320.0120.00014.96
7.3.310.0100.00316.35
7.3.300.0070.00616.31
7.3.290.0110.00216.29
7.3.280.0110.00616.41
7.3.270.0080.00816.68
7.3.260.0120.00616.37
7.3.250.0070.01016.43
7.3.240.0090.00816.42
7.3.230.0090.01016.43
7.3.220.0120.00416.24
7.3.210.0090.00716.39
7.3.200.0130.00616.34
7.3.190.0080.00816.39
7.3.180.0100.00716.35
7.3.170.0080.00816.41
7.3.160.0070.00916.36
7.3.150.0130.00316.29
7.3.140.0060.01116.30
7.3.130.0110.00616.38
7.3.120.0070.00916.42
7.3.110.0100.00716.26
7.3.100.0110.00616.22
7.3.90.0100.00616.74
7.3.80.0070.00916.38
7.3.70.0130.00416.39
7.3.60.0110.00616.49
7.3.50.0140.00316.46
7.3.40.0130.00516.39
7.3.30.0120.00516.51
7.3.20.0110.00817.45
7.3.10.0120.00717.36
7.3.00.0130.00717.37
7.2.340.0160.00716.66
7.2.330.0130.00916.65
7.2.320.0140.00716.60
7.2.310.0160.00616.57
7.2.300.0170.00616.63
7.2.290.0130.01016.67
7.2.280.0220.00316.65
7.2.270.0200.00616.52
7.2.260.0180.00616.56
7.2.250.0180.00516.50
7.2.240.0190.00416.62
7.2.230.0170.00616.59
7.2.220.0180.00416.64
7.2.210.0180.00716.59
7.2.200.0180.00716.78
7.2.190.0210.00416.61
7.2.180.0190.00416.62
7.2.170.0140.01116.69
7.2.160.0130.01116.67
7.2.150.0200.00617.60
7.2.140.0160.00817.54
7.2.130.0140.01017.82
7.2.120.0230.00217.57
7.2.110.0180.00817.73
7.2.100.0170.00617.70
7.2.90.0240.00317.56
7.2.80.0170.01017.56
7.2.70.0130.01117.62
7.2.60.0110.00817.39
7.2.50.0170.00617.55
7.2.40.0150.00817.61
7.2.30.0180.01317.73
7.2.20.0280.01017.65
7.2.10.0220.01117.82
7.2.00.0240.00917.84
7.1.330.0160.00316.66
7.1.320.0180.00416.67
7.1.310.0230.00516.47
7.1.300.0120.00816.40
7.1.290.0170.00316.51
7.1.280.0150.00616.44
7.1.270.0210.00616.42
7.1.260.0170.00416.43
7.1.250.0190.00516.41
7.1.240.0120.01016.49
7.1.230.0170.00416.35
7.1.220.0150.00816.41
7.1.210.0170.00516.46
7.1.200.0140.00616.25
7.1.190.0170.00516.37
7.1.180.0150.00616.36
7.1.170.0140.00616.31
7.1.160.0190.00216.52
7.1.150.0150.00816.43
7.1.140.0250.00216.58
7.1.130.0230.00816.60
7.1.120.0260.01016.75
7.1.110.0220.00716.55
7.1.100.0240.00816.47
7.1.90.0160.00716.46
7.1.80.0310.00316.54
7.1.70.0320.00616.05
7.1.60.0320.00922.30
7.1.50.0340.00722.14
7.1.40.0370.00622.00
7.1.30.0360.01222.10
7.1.20.0330.00822.05
7.1.10.0310.00816.01
7.1.00.0290.00516.09
7.0.330.0120.00716.27
7.0.320.0260.00816.27
7.0.310.0120.00816.26
7.0.300.0150.00616.15
7.0.290.0120.01116.11
7.0.280.0170.00316.18
7.0.270.0150.00616.24
7.0.260.0120.00916.26
7.0.250.0180.00216.32
7.0.240.0130.00816.28
7.0.230.0170.00416.38
7.0.220.0160.00416.31
7.0.210.0110.01116.29
7.0.200.0130.00816.37
7.0.190.0150.00516.36
7.0.180.0170.00416.34
7.0.170.0130.00816.43
7.0.160.0170.00516.21
7.0.150.0170.00316.18
7.0.140.0170.00316.19
7.0.130.0140.00616.32
7.0.120.0170.00916.39
7.0.110.0150.00616.18
7.0.100.0140.00716.24
7.0.90.0110.00916.09
7.0.80.0170.00616.07
7.0.70.0170.00316.05
7.0.60.0170.00316.12
7.0.50.0190.00215.96
7.0.40.0120.01016.07
7.0.30.0190.00716.10
7.0.20.0200.00316.09
7.0.10.0120.00916.04
7.0.00.0160.00416.15
5.6.400.0150.00715.74
5.6.390.0120.00815.91
5.6.380.0160.00615.76
5.6.370.0160.00715.82
5.6.360.0140.00715.79
5.6.350.0140.01415.85
5.6.340.0140.00515.75
5.6.330.0130.00715.76
5.6.320.0170.00415.75
5.6.310.0150.00715.86
5.6.300.0200.00015.64
5.6.290.0170.00515.78
5.6.280.0180.00615.84
5.6.270.0100.01015.85
5.6.260.0160.00615.85
5.6.250.0130.00915.94
5.6.240.0130.00715.93
5.6.230.0120.00815.98
5.6.220.0170.00615.90
5.6.210.0140.00815.76
5.6.200.0140.00616.03
5.6.190.0140.00616.02
5.6.180.0170.00715.90
5.6.170.0170.00816.14
5.6.160.0170.00415.99
5.6.150.0170.00516.08
5.6.140.0160.00715.86
5.6.130.0170.00516.08
5.6.120.0150.00516.05
5.6.110.0210.00415.79
5.6.100.0160.00515.79
5.6.90.0140.00715.93
5.6.80.0120.00715.65
5.6.70.0120.00715.94
5.6.60.0140.00515.92
5.6.50.0180.00215.81
5.6.40.0210.00015.80
5.6.30.0130.00615.84
5.6.20.0080.01115.78
5.6.10.0110.00915.75
5.6.00.0120.00615.75

preferences:
53.45 ms | 403 KiB | 5 Q