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) { echo $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.0150.00416.88
8.3.50.0050.01422.17
8.3.40.0150.00019.01
8.3.30.0040.01119.03
8.3.20.0070.00020.34
8.3.10.0040.00421.85
8.3.00.0030.00619.79
8.2.180.0130.00917.00
8.2.170.0070.00722.96
8.2.160.0080.00820.35
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0030.00621.13
8.2.120.0040.00426.35
8.2.110.0200.00020.47
8.2.100.0120.00018.04
8.2.90.0040.00419.21
8.2.80.0040.00417.97
8.2.70.0100.00317.88
8.2.60.0030.00617.80
8.2.50.0040.00418.07
8.2.40.0040.00421.30
8.2.30.0000.01020.67
8.2.20.0050.00217.84
8.2.10.0040.00418.16
8.2.00.0000.00818.06
8.1.280.0110.01125.92
8.1.270.0060.00318.79
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0060.00319.43
8.1.230.0040.00817.75
8.1.220.0030.00617.77
8.1.210.0080.00018.77
8.1.200.0030.00717.25
8.1.190.0040.00417.70
8.1.180.0030.00618.10
8.1.170.0040.00418.74
8.1.160.0040.00420.77
8.1.150.0050.00218.93
8.1.140.0030.00519.58
8.1.130.0050.00217.75
8.1.120.0000.00717.61
8.1.110.0000.00817.55
8.1.100.0070.00017.60
8.1.90.0030.00617.63
8.1.80.0040.00417.63
8.1.70.0070.00017.63
8.1.60.0030.00617.76
8.1.50.0080.00017.55
8.1.40.0060.00317.70
8.1.30.0040.00417.78
8.1.20.0040.00417.79
8.1.10.0000.00717.73
8.1.00.0060.00617.57
8.0.300.0080.00018.77
8.0.290.0000.00717.00
8.0.280.0000.00718.36
8.0.270.0030.00717.30
8.0.260.0000.00617.23
8.0.250.0000.00617.23
8.0.240.0070.00017.17
8.0.230.0030.00317.20
8.0.220.0030.00317.02
8.0.210.0050.00317.12
8.0.200.0030.00317.09
8.0.190.0080.00017.15
8.0.180.0070.00017.13
8.0.170.0040.00417.08
8.0.160.0040.00417.21
8.0.150.0040.00416.99
8.0.140.0000.00716.97
8.0.130.0050.00013.60
8.0.120.0000.00817.14
8.0.110.0050.00317.01
8.0.100.0070.00016.99
8.0.90.0000.00717.14
8.0.80.0100.00717.07
8.0.70.0000.00717.01
8.0.60.0000.00817.21
8.0.50.0080.00017.17
8.0.30.0110.00717.37
8.0.20.0080.01317.40
8.0.10.0000.00717.27
8.0.00.0070.01016.96
7.4.330.0000.00516.77
7.4.320.0000.00716.65
7.4.300.0070.00016.88
7.4.290.0030.00316.83
7.4.280.0070.00016.82
7.4.270.0000.00716.85
7.4.260.0000.00716.79
7.4.250.0070.00016.70
7.4.240.0040.00316.73
7.4.230.0030.00316.55
7.4.220.0060.01216.82
7.4.210.0150.00416.88
7.4.200.0000.00716.77
7.4.160.0140.00016.70
7.4.150.0060.01317.40
7.4.140.0130.00717.86
7.4.130.0110.01116.69
7.4.120.0100.00916.78
7.4.110.0060.01216.90
7.4.100.0140.00516.75
7.4.90.0130.00516.62
7.4.80.0090.00919.39
7.4.70.0090.00616.99
7.4.60.0070.01016.54
7.4.50.0000.01216.92
7.4.40.0080.01516.71
7.4.30.0130.01016.76
7.4.10.0070.01015.42
7.4.00.0070.01115.09
7.3.330.0050.00013.42
7.3.320.0030.00313.55
7.3.310.0000.00716.59
7.3.300.0000.00716.61
7.3.290.0100.00816.59
7.3.280.0080.01216.53
7.3.270.0130.00417.40
7.3.260.0000.01716.86
7.3.250.0130.00916.69
7.3.240.0150.00516.61
7.3.230.0130.00416.46
7.3.210.0150.00616.59
7.3.200.0090.00916.57
7.3.190.0060.00916.61
7.3.180.0250.03116.77
7.3.170.0100.01016.48
7.3.160.0060.00916.47
7.3.130.0030.01314.61
7.3.120.0120.00715.10
7.3.110.0090.00914.99
7.3.100.0050.01014.98
7.3.90.0040.01115.24
7.3.80.0060.00615.04
7.3.70.0000.01315.04
7.3.60.0020.01215.09
7.3.50.0020.01214.97
7.3.40.0050.00614.91
7.3.30.0060.00815.09
7.3.20.0090.00716.89
7.3.10.0050.00816.84
7.3.00.0060.00616.90
7.2.330.0110.00716.74
7.2.320.0130.01016.73
7.2.310.0090.00816.77
7.2.300.0100.00716.66
7.2.290.0090.00916.59
7.2.260.0070.01015.23
7.2.250.0060.01115.36
7.2.240.0080.01115.32
7.2.230.0120.00515.17
7.2.220.0030.01415.37
7.2.210.0020.01015.18
7.2.200.0040.00615.20
7.2.190.0060.00915.29
7.2.180.0020.01115.20
7.2.170.0040.01115.28
7.2.160.0040.01015.13
7.2.150.0050.00816.97
7.2.140.0030.01317.27
7.2.130.0070.00817.04
7.2.120.0100.00317.06
7.2.110.0080.00917.06
7.2.100.0110.00217.10
7.2.90.0100.00717.21
7.2.80.0050.01016.99
7.2.70.0090.00816.96
7.2.60.0030.01117.22
7.2.50.0080.00617.22
7.2.40.0130.00317.09
7.2.30.0050.00917.06
7.2.20.0080.00517.02
7.2.10.0060.00917.23
7.2.00.0060.00917.89
7.1.330.0060.01016.01
7.1.320.0110.00615.87
7.1.310.0040.01015.96
7.1.300.0070.00815.85
7.1.290.0030.00616.14
7.1.280.0050.01015.90
7.1.270.0040.01115.95
7.1.260.0030.01015.86
7.1.250.0050.00616.07
7.1.240.0090.00615.77
7.1.230.0110.00615.73
7.1.220.0000.01216.09
7.1.210.0120.00315.66
7.1.200.0030.00616.06
7.1.190.0040.01116.11
7.1.180.0000.00916.05
7.1.170.0030.01316.16
7.1.160.0120.00315.91
7.1.150.0000.01116.13
7.1.140.0120.00616.13
7.1.130.0070.00715.88
7.1.120.0100.00316.13
7.1.110.0090.00615.86
7.1.100.0090.00315.99
7.1.90.0060.00916.19
7.1.80.0030.00916.07
7.1.70.0040.00616.65
7.1.60.0050.00816.77
7.1.50.0050.01516.68
7.1.40.0050.00515.99
7.1.30.0030.00716.02
7.1.20.0070.00716.02
7.1.10.0070.00715.79
7.1.00.0030.04319.10
7.0.330.0100.00315.55
7.0.320.0030.01015.58
7.0.310.0130.00315.80
7.0.300.0060.00915.72
7.0.290.0060.00615.55
7.0.280.0040.01115.57
7.0.270.0030.00615.41
7.0.260.0150.00015.64
7.0.250.0030.00915.53
7.0.240.0040.00715.81
7.0.230.0070.00715.55
7.0.220.0030.00715.52
7.0.210.0060.00915.45
7.0.200.0060.00516.40
7.0.190.0040.00415.50
7.0.180.0040.00715.37
7.0.170.0040.01115.41
7.0.160.0120.00315.34
7.0.150.0070.00715.66
7.0.140.0030.01015.44
7.0.130.0030.00615.63
7.0.120.0120.00315.45
7.0.110.0060.00615.43
7.0.100.0090.00615.65
7.0.90.0000.00915.29
7.0.80.0000.01515.73
7.0.70.0060.00315.75
7.0.60.0060.04617.84
7.0.50.0070.04516.74
7.0.40.0070.02517.06
7.0.30.0170.04516.73
7.0.20.0120.04916.83
7.0.10.0050.03816.89
7.0.00.0050.03816.84
5.6.400.0060.01214.53
5.6.390.0000.01514.33
5.6.380.0030.00614.61
5.6.370.0040.01114.45
5.6.360.0100.00714.53
5.6.350.0000.00914.42
5.6.340.0000.01514.52
5.6.330.0060.00314.07
5.6.320.0070.00714.24
5.6.310.0040.00714.53
5.6.300.0060.00614.74
5.6.290.0000.01014.36
5.6.280.0020.02217.71
5.6.270.0030.01014.57
5.6.260.0060.00314.22
5.6.250.0070.00314.38
5.6.240.0030.00614.48
5.6.230.0100.00314.36
5.6.220.0060.00314.35
5.6.210.0050.04117.49
5.6.200.0120.04016.40
5.6.190.0100.04017.51
5.6.180.0170.02417.40
5.6.170.0110.02817.54
5.6.160.0050.03517.62
5.6.150.0020.03516.48
5.6.140.0080.02516.25
5.6.130.0050.03916.24
5.6.120.0090.04017.64
5.6.110.0070.04517.80
5.6.100.0030.02317.77
5.6.90.0020.02917.75
5.6.80.0100.04317.48
5.6.70.0060.00314.43
5.6.60.0000.01614.32
5.6.50.0000.01014.57
5.6.40.0030.01014.02
5.6.30.0000.01614.46
5.6.20.0060.00914.08
5.6.10.0000.01414.20
5.6.00.0070.00714.37
5.5.380.0080.00414.85
5.5.370.0080.00014.33
5.5.360.0090.00314.41
5.5.350.0050.04317.31
5.5.340.0080.03316.14
5.5.330.0070.03217.36
5.5.320.0050.04517.37
5.5.310.0080.02717.18
5.5.300.0030.04516.11
5.5.290.0050.03716.11
5.5.280.0100.04217.53
5.5.270.0070.04417.76
5.5.260.0050.04317.56
5.5.250.0060.04117.45
5.5.240.0120.04017.17
5.5.230.0040.01014.36
5.5.220.0030.01314.41
5.5.210.0040.00814.19
5.5.200.0040.01114.43
5.5.190.0030.01014.50
5.5.180.0060.00914.30
5.5.170.0030.01314.21
5.5.160.0000.00914.29
5.5.150.0160.00014.77
5.5.140.0030.01314.09
5.5.130.0000.01314.50
5.5.120.0120.00614.70
5.5.110.0030.01314.57
5.5.100.0060.00614.64
5.5.90.0060.00614.42
5.5.80.0000.01414.20
5.5.70.0040.01114.00
5.5.60.0080.00814.22
5.5.50.0030.00614.37
5.5.40.0030.00614.32
5.5.30.0070.01014.19
5.5.20.0060.00614.50
5.5.10.0060.00614.25
5.5.00.0070.00714.05

preferences:
44.44 ms | 401 KiB | 5 Q