3v4l.org

run code in 300+ PHP versions simultaneously
<?php function matchStrings($str) { $ret = array(); // $ret = explode("\n", $str); foreach($ret as $asub) { $asub = str_replace('x', '', $asub); preg_match('/^(sh[0-9]+sh)+/', trim($asub), $ret['matches'][]); } $ret = array_unique($ret['matches']); foreach($ret as $sfind) { var_dump($sfind); } return $ret; // } $test = <<<MULTI xx xx sh1sh xx xx xx sh2sh xx xx xx xx sh**sh xx xx x xx xx sh3xxxsh xx xx sh4shsh5sh xxx MULTI; $matches = matchStrings($test); print_r($matches);

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.0140.01016.88
8.3.50.0100.00922.11
8.3.40.0150.00018.79
8.3.30.0000.01418.92
8.3.20.0000.00820.27
8.3.10.0080.00021.76
8.3.00.0070.00019.72
8.2.180.0160.00317.00
8.2.170.0150.00022.96
8.2.160.0130.00320.38
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0000.00819.19
8.2.120.0030.00526.35
8.2.110.0050.00520.35
8.2.100.0030.00918.16
8.2.90.0030.00619.35
8.2.80.0030.00517.97
8.2.70.0050.00317.75
8.2.60.0060.00318.04
8.2.50.0030.00618.07
8.2.40.0040.00421.32
8.2.30.0050.00520.61
8.2.20.0040.00417.98
8.2.10.0050.00318.04
8.2.00.0000.00718.15
8.1.280.0140.00325.92
8.1.270.0040.00418.88
8.1.260.0070.00028.09
8.1.250.0080.00028.09
8.1.240.0070.00323.70
8.1.230.0040.00820.87
8.1.220.0040.00417.76
8.1.210.0080.00018.77
8.1.200.0030.00617.47
8.1.190.0020.00517.57
8.1.180.0050.00318.10
8.1.170.0000.00818.84
8.1.160.0040.00420.80
8.1.150.0020.00518.83
8.1.140.0040.00419.59
8.1.130.0030.00317.74
8.1.120.0050.00217.66
8.1.110.0000.00817.57
8.1.100.0000.00817.57
8.1.90.0080.00317.53
8.1.80.0070.00017.61
8.1.70.0070.00017.57
8.1.60.0000.00817.64
8.1.50.0000.00917.68
8.1.40.0040.00417.61
8.1.30.0050.00317.84
8.1.20.0000.00717.84
8.1.10.0040.00417.61
8.1.00.0090.00017.57
8.0.300.0090.00018.77
8.0.290.0040.00417.13
8.0.280.0070.00018.39
8.0.270.0000.00817.36
8.0.260.0030.00317.34
8.0.250.0030.00317.22
8.0.240.0000.00617.05
8.0.230.0040.00417.09
8.0.220.0000.00717.15
8.0.210.0000.00717.16
8.0.200.0030.00317.07
8.0.190.0050.00517.16
8.0.180.0000.00817.04
8.0.170.0070.00017.12
8.0.160.0040.00417.12
8.0.150.0070.00017.06
8.0.140.0000.00716.94
8.0.130.0000.00513.56
8.0.120.0040.00417.04
8.0.110.0040.00417.05
8.0.100.0040.00416.98
8.0.90.0040.00416.94
8.0.80.0180.00317.09
8.0.70.0000.00717.18
8.0.60.0040.00417.13
8.0.50.0070.00017.13
8.0.30.0060.01117.33
8.0.20.0080.01217.44
8.0.10.0000.00817.28
8.0.00.0070.01116.89
7.4.330.0020.00216.68
7.4.320.0040.00416.84
7.4.300.0030.00316.65
7.4.290.0000.00716.83
7.4.280.0000.00816.62
7.4.270.0040.00416.75
7.4.260.0040.00416.78
7.4.250.0030.00616.73
7.4.240.0040.00316.81
7.4.230.0030.00316.84
7.4.220.0210.00916.91
7.4.210.0090.00616.87
7.4.200.0050.00216.93
7.4.160.0120.00316.73
7.4.150.0110.01417.40
7.4.140.0100.01317.86
7.4.130.0080.01316.73
7.4.120.0140.00316.76
7.4.110.0110.01116.62
7.4.100.0120.00916.84
7.4.90.0140.01116.83
7.4.80.0100.01319.39
7.4.70.0100.00616.63
7.4.60.0030.01316.64
7.4.50.0070.00716.58
7.4.40.0090.01316.83
7.4.30.0110.00616.71
7.4.00.0070.00715.41
7.3.330.0000.00513.57
7.3.320.0000.00613.40
7.3.310.0030.00316.48
7.3.300.0000.00716.55
7.3.290.0080.00616.56
7.3.280.0100.00616.60
7.3.270.0130.01017.40
7.3.260.0050.01416.50
7.3.250.0080.01416.71
7.3.240.0110.00616.56
7.3.230.0170.00016.45
7.3.210.0130.00316.57
7.3.200.0130.00316.56
7.3.190.0030.01516.66
7.3.180.0080.00816.94
7.3.170.0090.00916.76
7.3.160.0100.00616.82
7.3.10.0080.00816.56
7.3.00.0150.00317.05
7.2.330.0040.01516.80
7.2.320.0060.01816.82
7.2.310.0090.00816.88
7.2.300.0120.00616.84
7.2.290.0080.01616.84
7.2.130.0040.01117.08
7.2.120.0090.00617.16
7.2.110.0070.00317.11
7.2.100.0060.00316.98
7.2.90.0150.00017.27
7.2.80.0070.00716.77
7.2.70.0060.00816.77
7.2.60.0070.00817.04
7.2.50.0070.00716.95
7.2.40.0000.01216.98
7.2.30.0070.01017.27
7.2.20.0070.01117.25
7.2.10.0140.00717.20
7.2.00.0070.00918.10
7.1.250.0030.00715.89
7.1.200.0130.00915.77
7.1.100.0070.00418.57
7.1.70.0060.00317.40
7.1.60.0070.01719.50
7.1.50.0000.02117.06
7.1.00.0030.07722.38
7.0.200.0040.00417.04
7.0.60.0170.07020.02
7.0.50.0070.05717.89
7.0.40.0170.07719.98
7.0.30.0270.07020.25
7.0.20.0170.06720.24
7.0.10.0070.05720.09
7.0.00.0100.06720.34
5.6.280.0030.03321.07
5.6.210.0130.05020.57
5.6.200.0100.08318.12
5.6.190.0100.05020.39
5.6.180.0370.03320.61
5.6.170.0130.06020.50
5.6.160.0100.08320.55
5.6.150.0030.04318.18
5.6.140.0100.04018.15
5.6.130.0100.08318.28
5.6.120.0070.05020.99
5.6.110.0170.07320.99
5.6.100.0100.04320.99
5.6.90.0070.04020.96
5.6.80.0100.07320.39
5.5.350.0030.06320.46
5.5.340.0100.03318.08
5.5.330.0000.04720.27
5.5.320.0030.06320.20
5.5.310.0270.06020.35
5.5.300.0070.05017.96
5.5.290.0000.04717.97
5.5.280.0030.07320.73
5.5.270.0130.08320.87
5.5.260.0170.05720.65
5.5.250.0100.06320.58
5.5.240.0130.08020.12

preferences:
37.11 ms | 401 KiB | 5 Q