3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "01", "1001111", "010011111", "0100111110001110", "0100111011001110", "0100111110011110", "0100111111111111110001110", "0100111011001110", "1011010111", "0100111011001110", ]; $pattern = '/^0*\K(?:[01]*?((?(1)\1)1))+/m'; foreach ($strings as $s) { if (preg_match($pattern, $s, $match)) { echo "$s --> " . $match[0] . 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.00816.89
8.5.00.0100.01220.23
8.4.150.0020.00014.05
8.4.140.0160.00717.86
8.4.130.0090.00418.08
8.4.120.0110.01020.82
8.4.110.0070.01122.52
8.4.100.0130.00817.94
8.4.90.0150.00518.69
8.4.80.0050.00418.06
8.4.70.0120.00618.24
8.4.60.0070.00220.33
8.4.50.0110.01019.81
8.4.40.0100.01019.98
8.4.30.0060.00320.47
8.4.20.0100.01018.74
8.4.10.0120.00818.14
8.3.280.0100.01018.49
8.3.270.0080.01116.77
8.3.260.0060.00616.58
8.3.250.0110.00818.96
8.3.240.0060.00216.68
8.3.230.0120.00716.92
8.3.220.0090.00917.29
8.3.210.0070.00116.95
8.3.200.0080.00216.79
8.3.190.0070.00217.21
8.3.180.0030.00518.33
8.3.170.0040.01419.12
8.3.160.0110.00716.81
8.3.150.0100.00720.61
8.3.140.0150.00417.13
8.3.130.0080.00017.17
8.3.120.0070.00719.24
8.3.110.0120.00620.94
8.3.100.0040.00424.06
8.3.90.0130.00626.77
8.3.80.0070.00416.88
8.3.70.0120.00316.58
8.3.60.0090.00618.55
8.3.50.0110.00416.54
8.3.40.0120.00618.83
8.3.30.0120.00319.14
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0100.00920.80
8.2.280.0080.00218.84
8.2.270.0030.01617.12
8.2.260.0160.00320.11
8.2.250.0120.00617.09
8.2.240.0030.00618.82
8.2.230.0030.01022.58
8.2.220.0030.00637.54
8.2.210.0080.00026.77
8.2.200.0000.00916.75
8.2.190.0210.00016.88
8.2.180.0120.00425.92
8.2.170.0120.00319.11
8.2.160.0000.01422.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.89
8.2.110.0030.00722.21
8.2.100.0090.00318.09
8.2.90.0000.00818.13
8.2.80.0040.00419.03
8.2.70.0030.00518.04
8.2.60.0000.00818.22
8.2.50.0060.00318.10
8.2.40.0040.00421.36
8.2.30.0050.00219.53
8.2.20.0080.00018.10
8.2.10.0030.00519.22
8.2.00.0070.00019.35
8.1.330.0060.00422.14
8.1.320.0100.00716.68
8.1.310.0030.00616.97
8.1.300.0110.00016.30
8.1.290.0030.00618.88
8.1.280.0100.00725.92
8.1.270.0080.00023.99
8.1.260.0060.00328.09
8.1.250.0040.00428.09
8.1.240.0060.00322.14
8.1.230.0000.01117.79
8.1.220.0000.00817.74
8.1.210.0030.00518.77
8.1.200.0090.00017.47
8.1.190.0040.00417.11
8.1.180.0060.00318.10
8.1.170.0000.00918.59
8.1.160.0000.00820.77
8.1.150.0030.00818.98
8.1.140.0040.00418.99
8.1.130.0040.00420.18
8.1.120.0030.00517.59
8.1.110.0040.00417.61
8.1.100.0050.00217.63
8.1.90.0050.00317.50
8.1.80.0040.00417.53
8.1.70.0020.00717.64
8.1.60.0040.00417.76
8.1.50.0040.00417.61
8.1.40.0000.01017.57
8.1.30.0030.00617.71
8.1.20.0030.00517.81
8.1.10.0060.00317.72
8.1.00.0080.00017.61
8.0.300.0060.00318.77
8.0.290.0040.00416.88
8.0.280.0040.00418.48
8.0.270.0030.00318.16
8.0.260.0060.00018.51
8.0.250.0070.00017.08
8.0.240.0070.00017.00
8.0.230.0000.00817.21
8.0.220.0000.00717.17
8.0.210.0000.00716.88
8.0.200.0030.00717.15
8.0.190.0040.00417.13
8.0.180.0000.00716.91
8.0.170.0090.00017.04
8.0.160.0040.00416.98
8.0.150.0000.00817.07
8.0.140.0000.00717.00
8.0.130.0030.00313.57
8.0.120.0030.00516.95
8.0.110.0050.00217.02
8.0.100.0050.00217.08
8.0.90.0050.00216.89
8.0.80.0070.00817.12
8.0.70.0000.00717.15
8.0.60.0080.00017.16
8.0.50.0090.00017.06
8.0.30.0100.01417.05
8.0.20.0100.01017.14
8.0.10.0000.01517.28
8.0.00.0030.01317.25
7.4.330.0000.00515.55
7.4.320.0070.00016.78
7.4.300.0070.00016.89
7.4.290.0000.00716.66
7.4.280.0040.00416.73
7.4.270.0080.00016.91
7.4.260.0030.00313.60
7.4.250.0040.00416.66
7.4.240.0060.00116.89
7.4.230.0040.00416.68
7.4.220.0040.00316.63
7.4.210.0060.01116.86
7.4.200.0030.00316.87
7.4.160.0180.00416.75
7.4.150.0140.00816.89
7.4.140.0030.01416.72
7.4.130.0060.00916.85
7.4.120.0150.00916.69
7.4.110.0060.00916.52
7.4.100.0070.01516.84
7.4.90.0120.00816.78
7.4.80.0120.00616.79
7.4.70.0120.00316.86
7.4.60.0040.01816.67
7.4.50.0060.00916.56
7.4.40.0030.01416.63
7.4.30.0080.00816.71
7.4.20.0140.00416.65
7.4.10.0070.01016.72
7.4.00.0110.00716.69
7.3.330.0070.00016.57
7.3.320.0050.00013.32
7.3.310.0070.00016.40
7.3.300.0050.00216.59
7.3.290.0080.01216.41
7.3.280.0060.01316.48
7.3.270.0070.00716.49
7.3.260.0120.00316.38
7.3.250.0030.01016.37
7.3.240.0050.01616.41
7.3.230.0100.01016.36
7.3.220.0120.00616.36
7.3.210.0130.00716.38
7.3.200.0070.00716.41
7.3.190.0060.01316.45
7.3.180.0100.01016.45
7.3.170.0080.00616.36
7.3.160.0000.01516.41
7.3.150.0030.01616.41
7.3.140.0090.00616.44
7.3.130.0060.01316.39
7.3.120.0140.00416.46
7.3.110.0130.00316.34
7.3.100.0000.01516.35
7.3.90.0100.01016.76
7.3.80.0070.01416.41
7.3.70.0070.00716.64
7.3.60.0060.00916.61
7.3.50.0030.01516.64
7.3.40.0100.00716.61
7.3.30.0140.00416.57
7.3.20.0120.00816.63
7.3.10.0060.01216.56
7.3.00.0030.01516.52

preferences:
34.91 ms | 403 KiB | 5 Q