3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "PHP [gallery-1]. [gallery-2]"; echo preg_replace('/\[gallery-([1-9]*)\]/', '$1', $text); die(); if (preg_match_all("/\bgallery-\b/i", $text, $matches, PREG_OFFSET_CAPTURE)) { // print_r($matches); $matches = $matches[0]; if(is_array($matches)) { foreach($matches as $match) { $pos = $match[1]-1; } } // $position = $matches[0][0][1]; } else { echo "A match was not found."; }

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.0110.00418.53
8.3.50.0150.00521.14
8.3.40.0140.00019.14
8.3.30.0130.00320.17
8.3.20.0080.00020.71
8.3.10.0050.00321.09
8.3.00.0080.00023.52
8.2.180.0070.01416.50
8.2.170.0120.00922.96
8.2.160.0090.00520.18
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0040.00426.16
8.2.120.0060.00320.91
8.2.110.0060.00319.27
8.2.100.0090.00317.91
8.2.90.0070.00019.21
8.2.80.0080.00018.03
8.2.70.0060.00317.88
8.2.60.0030.00517.80
8.2.50.0040.00418.07
8.2.40.0030.00718.28
8.2.30.0090.00019.46
8.2.20.0050.00217.79
8.2.10.0050.00217.89
8.2.00.0000.00817.84
8.1.280.0120.00625.92
8.1.270.0060.00323.99
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0110.00020.65
8.1.230.0110.00021.03
8.1.220.0050.00318.77
8.1.210.0050.00518.77
8.1.200.0030.00617.35
8.1.190.0050.00317.43
8.1.180.0050.00318.10
8.1.170.0070.00318.66
8.1.160.0040.00418.89
8.1.150.0000.00818.78
8.1.140.0040.00417.54
8.1.130.0050.00317.91
8.1.120.0000.00717.43
8.1.110.0070.00017.47
8.1.100.0070.00017.52
8.1.90.0030.00417.60
8.1.80.0040.00417.48
8.1.70.0040.00417.53
8.1.60.0080.00017.68
8.1.50.0060.00317.53
8.1.40.0030.00617.57
8.1.30.0030.00617.85
8.1.20.0030.00517.70
8.1.10.0000.00817.67
8.1.00.0030.00517.66
8.0.300.0070.00019.89
8.0.290.0040.00417.05
8.0.280.0070.00018.42
8.0.270.0000.00817.19
8.0.260.0030.00316.91
8.0.250.0060.00317.07
8.0.240.0030.00517.02
8.0.230.0070.00017.00
8.0.220.0040.00416.95
8.0.210.0040.00416.94
8.0.200.0000.00616.96
8.0.190.0040.00317.08
8.0.180.0000.00716.95
8.0.170.0000.00716.94
8.0.160.0000.00716.88
8.0.150.0030.00316.87
8.0.140.0040.00416.97
8.0.130.0000.00613.41
8.0.120.0040.00417.00
8.0.110.0000.00716.91
8.0.100.0030.00516.86
8.0.90.0040.00416.93
8.0.80.0030.01617.02
8.0.70.0000.00816.99
8.0.60.0050.00316.97
8.0.50.0040.00417.05
8.0.30.0120.00717.09
8.0.20.0060.01417.40
8.0.10.0040.00416.93
8.0.00.0130.00616.83
7.4.330.0020.00215.07
7.4.320.0000.00616.69
7.4.300.0030.00316.55
7.4.290.0030.00316.66
7.4.280.0030.00316.68
7.4.270.0070.00016.73
7.4.260.0000.00513.43
7.4.250.0090.00016.71
7.4.240.0000.00716.57
7.4.230.0030.00316.73
7.4.220.0060.00916.77
7.4.210.0060.01116.67
7.4.200.0030.00316.81
7.4.190.0000.00716.51
7.4.160.0030.01316.60
7.4.150.0190.00017.40
7.4.140.0120.00817.86
7.4.130.0090.00816.69
7.4.120.0070.01016.67
7.4.110.0100.00716.59
7.4.100.0090.00916.63
7.4.90.0170.00016.59
7.4.80.0150.00619.39
7.4.70.0070.01316.55
7.4.60.0130.00316.58
7.4.50.0060.00016.67
7.4.40.0080.00822.77
7.4.30.0090.00916.63
7.4.00.0090.00615.38
7.3.330.0050.00013.10
7.3.320.0050.00013.21
7.3.310.0040.00416.21
7.3.300.0040.00416.41
7.3.290.0110.00416.40
7.3.280.0090.00816.42
7.3.270.0170.00017.40
7.3.260.0100.00918.24
7.3.250.0120.00716.55
7.3.240.0060.00916.75
7.3.230.0160.00016.66
7.3.210.0060.00916.25
7.3.200.0080.01119.39
7.3.190.0090.00916.30
7.3.180.0090.00616.50
7.3.170.0120.00316.43
7.3.160.0200.00316.50
7.3.120.0090.00614.91
7.3.110.0090.00314.82
7.3.100.0070.01014.78
7.3.90.0060.00915.06
7.3.80.0060.01215.10
7.3.70.0100.00614.84
7.3.60.0120.00314.68
7.3.50.0000.01114.72
7.3.40.0040.00714.98
7.3.30.0070.00314.97
7.3.20.0000.01216.63
7.3.10.0040.01116.76
7.3.00.0040.00816.79
7.2.330.0080.01216.79
7.2.320.0130.00316.87
7.2.310.0120.00616.63
7.2.300.0090.01216.62
7.2.290.0090.00816.78
7.2.240.0040.01115.00
7.2.230.0040.01514.95
7.2.220.0070.01115.02
7.2.210.0070.01015.15
7.2.200.0070.00715.08
7.2.190.0060.00914.69
7.2.180.0080.00815.14
7.2.170.0140.00015.32
7.2.160.0000.00915.07
7.2.150.0130.00316.93
7.2.140.0070.01016.78
7.2.130.0030.00916.75
7.2.120.0070.00717.13
7.2.110.0070.00316.72
7.2.100.0040.01116.88
7.2.90.0100.00717.07
7.2.80.0000.00917.03
7.2.70.0040.01116.56
7.2.60.0040.01116.79
7.2.50.0070.00716.81
7.2.40.0030.00916.59
7.2.30.0030.01416.70
7.2.20.0040.01416.79
7.2.10.0000.01416.89
7.2.00.0060.00618.08
7.1.330.0100.00316.01
7.1.320.0060.00615.86
7.1.310.0090.00315.75
7.1.300.0070.00715.77
7.1.290.0000.01415.74
7.1.280.0080.00815.72
7.1.270.0060.00615.71
7.1.260.0040.00916.03
7.1.250.0000.01415.85
7.1.100.0000.01218.07
7.1.70.0040.00417.32
7.1.60.0130.01019.17
7.1.50.0130.01017.18
7.1.00.0100.03322.44
7.0.200.0030.00816.81
7.0.140.0100.06721.97
7.0.80.0100.06319.91
7.0.70.0130.03719.85
7.0.60.0070.07320.07
7.0.50.0070.06720.36
7.0.40.0070.04320.00
7.0.30.0030.04320.18
7.0.20.0070.03320.10
7.0.10.0000.04320.11
7.0.00.0100.03720.07
5.6.280.0000.07721.04
5.6.230.0100.03720.67
5.6.220.0070.04020.61
5.6.210.0030.05720.62
5.6.200.0000.04320.93
5.6.190.0030.03720.93
5.6.180.0070.03721.04
5.6.170.0030.04321.03
5.6.160.0070.03721.12
5.6.150.0030.05020.93
5.6.140.0130.03721.01
5.6.130.0030.03720.95
5.6.120.0000.04720.93
5.6.110.0000.04321.10
5.6.100.0030.03720.94
5.6.90.0100.03721.00
5.6.80.0130.07720.51
5.6.70.0070.08320.41
5.6.60.0070.05020.46
5.6.50.0070.07720.42
5.6.40.0100.08320.41
5.6.30.0170.05720.36
5.6.20.0070.05320.36
5.6.10.0000.08720.35
5.6.00.0230.07020.50
5.5.370.0100.03020.42
5.5.360.0000.04720.41
5.5.350.0070.05020.39
5.5.340.0070.03720.91
5.5.330.0070.04020.64
5.5.320.0030.04720.83
5.5.310.0070.03720.91
5.5.300.0000.05720.91
5.5.290.0030.04020.86
5.5.280.0000.04720.72
5.5.270.0030.06320.84
5.5.260.0100.07720.86
5.5.250.0070.03320.72
5.5.240.0130.06720.29
5.5.230.0170.06720.30
5.5.220.0100.07320.20
5.5.210.0170.07020.02
5.5.200.0100.04020.08
5.5.190.0070.06320.18
5.5.180.0200.04020.23
5.5.160.0070.08720.27
5.5.150.0070.03720.14
5.5.140.0030.08020.13
5.5.130.0000.08320.10
5.5.120.0030.08320.23
5.5.110.0130.07020.12
5.5.100.0070.04320.13
5.5.90.0070.07720.15
5.5.80.0030.07019.97
5.5.70.0130.05020.16
5.5.60.0170.03020.09
5.5.50.0070.07720.09
5.5.40.0030.07319.94
5.5.30.0170.05720.02
5.5.20.0100.03720.02
5.5.10.0100.04720.08
5.5.00.0070.04020.11
5.4.450.0000.04719.56
5.4.440.0000.04319.44
5.4.430.0030.04319.29
5.4.420.0130.03319.13
5.4.410.0000.04019.22
5.4.400.0100.07319.10
5.4.390.0100.07718.96
5.4.380.0100.04719.11
5.4.370.0170.05019.02
5.4.360.0030.06319.07
5.4.350.0000.08018.79
5.4.340.0130.06718.81
5.4.320.0070.07318.96
5.4.310.0100.04318.81
5.4.300.0000.08718.81
5.4.290.0100.07018.80
5.4.280.0070.05019.03
5.4.270.0130.06018.80
5.4.260.0100.06319.07
5.4.250.0070.07319.22
5.4.240.0130.06719.11
5.4.230.0070.05319.11
5.4.220.0070.06018.93
5.4.210.0070.07719.02
5.4.200.0070.08019.11
5.4.190.0030.05019.02
5.4.180.0070.07719.24
5.4.170.0000.04319.09
5.4.160.0030.08018.77
5.4.150.0030.04019.00
5.4.140.0000.06316.38
5.4.130.0070.03716.27
5.4.120.0000.05316.27
5.4.110.0100.06716.33
5.4.100.0030.03716.42
5.4.90.0100.02316.24
5.4.80.0170.06316.45
5.4.70.0000.05716.29
5.4.60.0170.05016.18
5.4.50.0130.06316.40
5.4.40.0030.07016.39
5.4.30.0030.06316.23
5.4.20.0070.07716.18
5.4.10.0030.07016.34
5.4.00.0030.06015.57
5.3.290.0030.08014.52
5.3.280.0100.07314.43
5.3.270.0030.04014.52
5.3.260.0030.04014.59
5.3.250.0000.04314.54
5.3.240.0070.06714.58
5.3.230.0030.08314.58
5.3.220.0030.08014.43
5.3.210.0000.06714.47
5.3.200.0100.03314.56
5.3.190.0070.03714.57
5.3.180.0100.07714.56
5.3.170.0000.04014.42
5.3.160.0030.07314.38
5.3.150.0070.04714.55
5.3.140.0070.08314.39
5.3.130.0070.04714.51
5.3.120.0000.05014.40
5.3.110.0070.08014.40
5.3.100.0070.07713.90
5.3.90.0100.07013.99
5.3.80.0070.05313.95
5.3.70.0030.07013.99
5.3.60.0100.07713.96
5.3.50.0070.07713.95
5.3.40.0000.07013.93
5.3.30.0170.04313.86
5.3.20.0030.07013.46
5.3.10.0030.04313.61
5.3.00.0100.05713.60
5.2.170.0070.05711.70
5.2.160.0030.06311.70
5.2.150.0100.06011.70
5.2.140.0000.03711.70
5.2.130.0030.04011.70
5.2.120.0000.04011.70
5.2.110.0100.02311.70
5.2.100.0030.06011.70
5.2.90.0070.05011.70
5.2.80.0030.06011.70
5.2.70.0100.05011.70
5.2.60.0030.06311.70
5.2.50.0130.05311.70
5.2.40.0100.05711.70
5.2.30.0070.05011.70
5.2.20.0030.06011.70
5.2.10.0070.04011.70
5.2.00.0030.04311.70
5.1.60.0000.03011.70
5.1.50.0030.05311.70
5.1.40.0070.04711.70
5.1.30.0030.05711.70
5.1.20.0070.05311.70
5.1.10.0000.04711.70
5.1.00.0030.05011.70
5.0.50.0100.03711.70
5.0.40.0030.04311.70
5.0.30.0030.05711.70
5.0.20.0030.03711.70
5.0.10.0070.04311.70
5.0.00.0000.06711.70
4.4.90.0030.01711.70
4.4.80.0070.03311.70
4.4.70.0000.02311.70
4.4.60.0000.03711.70
4.4.50.0030.03311.70
4.4.40.0000.05011.70
4.4.30.0000.02711.70
4.4.20.0000.02311.70
4.4.10.0070.01011.70
4.4.00.0000.06011.70
4.3.110.0030.02711.70
4.3.100.0000.02011.70
4.3.90.0030.03011.70
4.3.80.0100.04711.70
4.3.70.0000.02711.70
4.3.60.0000.02711.70
4.3.50.0000.03311.70
4.3.40.0030.05011.70
4.3.30.0000.03311.70
4.3.20.0000.02711.70
4.3.10.0000.03711.70
4.3.00.0000.03311.70

preferences:
43.83 ms | 401 KiB | 5 Q