3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '+1 (214) 662-2590'; $pattern = '/^[0-9,+]+$/i'; $strlen = strlen($string); $iterations = pow(2, $strlen); for ($i = 0; $i < $iterations; $i++) { $tmp_string = $string; $number = $i; $k = 1; while ($number) { if ($number % 2) $tmp_string = substr_replace($tmp_string, '', $strlen - $k, 1); $number = (int) ($number / 2); $k++; } if (preg_match($pattern, $tmp_string)) { var_dump($tmp_string); break; } }

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.04718.43
8.3.50.0070.04921.27
8.3.40.0100.03318.96
8.3.30.0130.02820.21
8.3.20.0000.02320.13
8.3.10.0030.01922.09
8.3.00.0030.02222.58
8.2.180.0100.03316.75
8.2.170.0100.03322.96
8.2.160.0030.03822.20
8.2.150.0060.01624.18
8.2.140.0070.01624.66
8.2.130.0060.02926.16
8.2.120.0000.02221.24
8.2.110.0000.03422.10
8.2.100.0030.03217.84
8.2.90.0070.02719.27
8.2.80.0060.02319.32
8.2.70.0000.03517.75
8.2.60.0030.03117.80
8.2.50.0030.03218.07
8.2.40.0030.02919.95
8.2.30.0030.03219.51
8.2.20.0100.02317.76
8.2.10.0060.02817.91
8.2.00.0030.03017.89
8.1.280.0130.04225.92
8.1.270.0030.01824.02
8.1.260.0040.01826.35
8.1.250.0100.01328.09
8.1.240.0100.02323.89
8.1.230.0100.02619.13
8.1.220.0090.03017.74
8.1.210.0070.02718.77
8.1.200.0100.02717.35
8.1.190.0000.03517.53
8.1.180.0040.02918.10
8.1.170.0000.03118.71
8.1.160.0000.03318.86
8.1.150.0040.02818.63
8.1.140.0000.03417.59
8.1.130.0030.02817.82
8.1.120.0060.02617.62
8.1.110.0000.03317.48
8.1.100.0000.03317.63
8.1.90.0030.03117.59
8.1.80.0030.02817.64
8.1.70.0030.02917.60
8.1.60.0000.03917.76
8.1.50.0070.02717.64
8.1.40.0030.03117.69
8.1.30.0070.02617.71
8.1.20.0000.03417.76
8.1.10.0030.03117.65
8.1.00.0040.03217.53
8.0.300.0000.03018.77
8.0.290.0030.03017.16
8.0.280.0040.02818.47
8.0.270.0030.02917.21
8.0.260.0000.03117.02
8.0.250.0060.02517.11
8.0.240.0100.02317.10
8.0.230.0000.03317.02
8.0.220.0000.03717.02
8.0.210.0000.03316.91
8.0.200.0030.03017.13
8.0.190.0090.02417.15
8.0.180.0000.03317.07
8.0.170.0060.02716.93
8.0.160.0070.02716.93
8.0.150.0000.03516.89
8.0.140.0000.03317.01
8.0.130.0030.02813.56
8.0.120.0030.03117.02
8.0.110.0000.03417.02
8.0.100.0040.02916.88
8.0.90.0000.03417.17
8.0.80.0030.05317.02
8.0.70.0060.02817.11
8.0.60.0000.03317.15
8.0.50.0000.03417.07
8.0.30.0150.05417.32
8.0.20.0080.05117.43
8.0.10.0030.03017.18
8.0.00.0080.05216.87
7.4.330.0030.02815.00
7.4.320.0070.02616.84
7.4.300.0060.02916.64
7.4.290.0030.03216.73
7.4.280.0030.03316.79
7.4.270.0000.03516.83
7.4.260.0030.03713.41
7.4.250.0030.03416.73
7.4.240.0070.02816.78
7.4.230.0000.03516.89
7.4.220.0060.06316.75
7.4.210.0080.06016.80
7.4.200.0030.03116.86
7.4.190.0030.03216.83
7.4.160.0140.04516.57
7.4.150.0070.05317.40
7.4.140.0080.06317.86
7.4.130.0060.05516.65
7.4.120.0110.05416.75
7.4.110.0100.05416.63
7.4.100.0040.05716.59
7.4.90.0070.05416.61
7.4.80.0070.05519.39
7.4.70.0030.05616.74
7.4.60.0080.05716.80
7.4.50.0000.04916.70
7.4.40.0000.05622.77
7.4.30.0030.06116.67
7.4.00.0150.05615.25
7.3.330.0000.03613.24
7.3.320.0000.03413.34
7.3.310.0030.03316.57
7.3.300.0040.03216.50
7.3.290.0030.05516.50
7.3.280.0090.06216.53
7.3.270.0170.04617.40
7.3.260.0130.07216.41
7.3.250.0110.07016.62
7.3.240.0060.05916.51
7.3.230.0130.05616.48
7.3.210.0070.05816.48
7.3.200.0100.05919.39
7.3.190.0140.05416.50
7.3.180.0030.05816.80
7.3.170.0100.05116.77
7.3.160.0070.05516.59
7.3.120.0070.06514.83
7.3.110.0050.06915.15
7.3.100.0090.05215.02
7.3.90.0050.05714.95
7.3.80.0020.06015.15
7.3.70.0050.05914.94
7.3.60.0050.05615.12
7.3.50.0100.05214.93
7.3.40.0070.05414.97
7.3.30.0080.04715.13
7.3.20.0030.05816.83
7.3.10.0090.05716.60
7.3.00.0080.05716.68
7.2.330.0090.08216.79
7.2.320.0100.05716.59
7.2.310.0160.06616.82
7.2.300.0060.05716.79
7.2.290.0200.07416.80
7.2.250.0070.07515.12
7.2.240.0060.06615.25
7.2.230.0050.06015.21
7.2.220.0020.05515.23
7.2.210.0050.05615.28
7.2.200.0080.05315.25
7.2.190.0050.05615.01
7.2.180.0050.05515.14
7.2.170.0020.06115.00
7.2.160.0030.04915.21
7.2.150.0000.05717.06
7.2.140.0070.05217.24
7.2.130.0080.05917.04
7.2.120.0110.04916.98
7.2.110.0060.05916.70
7.2.100.0080.06016.86
7.2.90.0080.05416.94
7.2.80.0100.04816.88
7.2.70.0070.06616.98
7.2.60.0060.05316.97
7.2.50.0050.06116.87
7.2.40.0130.05417.06
7.2.30.0080.05616.94
7.2.20.0030.05917.02
7.2.10.0110.05416.88
7.2.00.0040.05317.89
7.1.330.0030.11315.97
7.1.320.0000.11115.87
7.1.310.0080.09416.01
7.1.300.0080.10215.87
7.1.290.0020.10015.83
7.1.280.0080.09515.93
7.1.270.0020.11515.80
7.1.260.0030.10215.92
7.1.250.0100.10215.60
7.1.200.0000.05716.01
7.1.100.0100.05718.04
7.1.70.0030.05717.36
7.1.60.0070.09719.32
7.1.50.0100.08317.07
7.1.00.0000.08022.59
7.0.200.0000.06316.79
7.0.140.0070.13722.10
7.0.100.0200.16020.04
7.0.90.0100.10019.97
7.0.80.0200.12719.86
7.0.70.0100.16319.99
7.0.60.0170.12719.93
7.0.50.0170.13020.32
7.0.40.0030.08320.11
7.0.30.0030.08320.10
7.0.20.0100.14720.18
7.0.10.0170.11320.00
7.0.00.0170.12720.07
5.6.280.0070.16720.92
5.6.250.0030.16720.75
5.6.240.0030.18020.54
5.6.230.0030.16020.54
5.6.220.0070.11020.67
5.6.210.0000.11320.58
5.6.200.0070.20721.17
5.6.190.0070.14021.13
5.6.180.0030.17720.93
5.6.170.0130.17021.07
5.6.160.0170.14321.01
5.6.150.0030.15720.95
5.6.140.0070.15320.93
5.6.130.0130.15021.07
5.6.120.0070.16021.10
5.6.110.0130.11320.92
5.6.100.0070.12320.91
5.6.90.0030.14320.93
5.6.80.0070.17020.49
5.6.70.0100.14720.43
5.6.60.0130.16020.32
5.6.50.0070.13720.43
5.6.40.0130.16320.46
5.6.30.0070.16720.37
5.6.20.0100.16320.43
5.6.10.0170.18020.37
5.6.00.0070.10320.37
5.5.380.0070.11720.35
5.5.370.0000.19020.55
5.5.360.0030.18720.48
5.5.350.0070.17720.45
5.5.340.0030.18020.79
5.5.330.0200.09020.80
5.5.320.0130.16720.87
5.5.310.0130.11020.77
5.5.300.0070.17020.78
5.5.290.0070.13020.89
5.5.280.0100.16720.82
5.5.270.0000.19320.82
5.5.260.0070.16720.89
5.5.250.0000.12320.56
5.5.240.0130.17320.16
5.5.230.0100.15720.26
5.5.220.0000.18320.29
5.5.210.0130.17020.29
5.5.200.0130.10320.18
5.5.190.0030.18020.26
5.5.180.0000.12020.24
5.5.160.0000.16720.07
5.5.150.0130.17020.14
5.5.140.0070.13320.11
5.5.130.0100.16720.17
5.5.120.0030.17319.99
5.5.110.0000.11720.13
5.5.100.0030.16720.16
5.5.90.0100.16020.06
5.5.80.0070.18720.10
5.5.70.0030.19320.07
5.5.60.0100.12020.14
5.5.50.0070.16719.99
5.5.40.0100.16020.09
5.5.30.0130.16720.04
5.5.20.0100.16720.04
5.5.10.0100.15319.96
5.5.00.0030.17020.03
5.4.450.0070.17319.45
5.4.440.0170.14019.44
5.4.430.0070.11019.38
5.4.420.0000.16719.37
5.4.410.0030.13719.32
5.4.400.0170.15019.13
5.4.390.0030.12319.22
5.4.380.0000.17019.03
5.4.370.0070.10719.03
5.4.360.0030.11019.22
5.4.350.0170.13719.09
5.4.340.0130.17319.05
5.4.320.0030.11018.78
5.4.310.0170.14318.95
5.4.300.0030.16718.81
5.4.290.0030.10719.11
5.4.280.0030.18018.96
5.4.270.0070.11019.12
5.4.260.0030.11019.09
5.4.250.0030.18018.78
5.4.240.0070.16319.05
5.4.230.0100.16018.94
5.4.220.0030.15719.07
5.4.210.0130.17019.11
5.4.200.0100.18719.18
5.4.190.0170.14018.91
5.4.180.0100.16718.77
5.4.170.0100.11719.21
5.4.160.0070.13719.07
5.4.150.0030.11719.12
5.4.140.0070.14316.29
5.4.130.0070.15016.43
5.4.120.0270.09316.38
5.4.110.0070.14716.42
5.4.100.0070.15316.30
5.4.90.0130.15016.30
5.4.80.0030.16316.38
5.4.70.0000.13316.36
5.4.60.0000.11016.18
5.4.50.0070.11716.29
5.4.40.0070.14316.34
5.4.30.0100.12316.23
5.4.20.0000.11316.39
5.4.10.0070.10716.17
5.4.00.0000.11315.82
5.3.290.0130.17714.62
5.3.280.0170.18014.46
5.3.270.0070.18314.61
5.3.260.0070.11714.56
5.3.250.0030.19314.61
5.3.240.0100.11714.56
5.3.230.0030.17314.57
5.3.220.0000.16714.42
5.3.210.0000.12014.42
5.3.200.0070.15714.52
5.3.190.0030.12314.57
5.3.180.0070.16014.43
5.3.170.0000.16014.55
5.3.160.0000.15314.47
5.3.150.0130.16714.50
5.3.140.0030.13314.54
5.3.130.0070.12314.53
5.3.120.0030.12014.48
5.3.110.0000.14014.40
5.3.100.0070.11714.01
5.3.90.0130.11014.02
5.3.80.0030.12013.99
5.3.70.0070.12013.95
5.3.60.0100.11313.86
5.3.50.0100.11713.90
5.3.40.0030.13313.71
5.3.30.0070.12713.89
5.3.20.0000.13313.67
5.3.10.0130.11313.64
5.3.00.0100.09713.62
5.2.170.0030.11312.08
5.2.160.0070.11712.08
5.2.150.0070.11712.08
5.2.140.0030.12312.08
5.2.130.0000.11712.08
5.2.120.0070.09312.08
5.2.110.0030.11312.08
5.2.100.0070.11312.08
5.2.90.0000.13312.08
5.2.80.0000.11012.08
5.2.70.0030.12012.08
5.2.60.0030.11012.08
5.2.50.0070.09012.08
5.2.40.0030.09312.08
5.2.30.0030.11012.08
5.2.20.0000.09312.08
5.2.10.0000.09312.08
5.2.00.0000.09312.08
5.1.60.0030.08312.08
5.1.50.0070.16312.08
5.1.40.0070.14012.08
5.1.30.0000.16712.08
5.1.20.0070.17012.08
5.1.10.0000.11312.08
5.1.00.0070.15012.08
5.0.50.0100.26312.08
5.0.40.0070.23012.08
5.0.30.0030.23312.08
5.0.20.0030.17712.08
5.0.10.0000.16712.08
5.0.00.0030.22012.08
4.4.90.0030.13012.08
4.4.80.0000.14312.08
4.4.70.0030.18012.08
4.4.60.0030.13712.08
4.4.50.0000.18012.08
4.4.40.0030.22012.08
4.4.30.0000.23012.08
4.4.20.0000.18012.08
4.4.10.0000.17312.08
4.4.00.0030.19312.08
4.3.110.0070.21012.08
4.3.100.0030.21012.08
4.3.90.0000.24012.08
4.3.80.0030.26712.08
4.3.70.0170.14312.08
4.3.60.0000.18312.08
4.3.50.0000.19712.08
4.3.40.0000.19712.08
4.3.30.0000.20312.08
4.3.20.0070.23712.08
4.3.10.0370.15312.08
4.3.00.0000.24712.08

preferences:
46.16 ms | 401 KiB | 5 Q