3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = "[ppp src='name']"; $regex = '#(?:\[[a-z](?^)\G)\K(?:\s+(\w+)=["\'](.*?)["\']|\s*\](.*?)\[/link\])#si'; preg_match_all($regex, $html, $matches, PREG_SET_ORDER); $links = array(); $reset = true; foreach($matches as $match) { if($reset) { $links[] = array( 'params' => array(), 'value' => null ); $reset = false; } end($links); $key = key($links); if(isset($match[3])) { $links[$key]['value'] = $match[3]; $reset = true; } else { $links[$key]['params'][$match[1]] = $match[2]; } } var_dump($links);

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.0130.00318.68
8.3.50.0130.00822.17
8.3.40.0070.01118.78
8.3.30.0140.00018.92
8.3.20.0000.00720.27
8.3.10.0030.00620.48
8.3.00.0050.00319.38
8.2.180.0160.00018.68
8.2.170.0150.00622.96
8.2.160.0130.00020.35
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0040.00419.42
8.2.110.0030.00622.37
8.2.100.0080.00418.03
8.2.90.0060.00319.22
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0090.00017.80
8.2.50.0000.00818.07
8.2.40.0040.00418.22
8.2.30.0080.00018.18
8.2.20.0030.00617.93
8.2.10.0080.00018.29
8.2.00.0040.00417.93
8.1.280.0040.01125.92
8.1.270.0080.00020.69
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0060.00322.36
8.1.230.0080.00417.77
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0090.00017.59
8.1.190.0030.00517.60
8.1.180.0050.00322.15
8.1.170.0040.00419.04
8.1.160.0040.00418.88
8.1.150.0040.00419.06
8.1.140.0050.00317.73
8.1.130.0000.00717.95
8.1.120.0020.00517.64
8.1.110.0000.00817.56
8.1.100.0040.00317.71
8.1.90.0000.00817.68
8.1.80.0040.00417.57
8.1.70.0000.00817.62
8.1.60.0000.00817.75
8.1.50.0030.00617.71
8.1.40.0050.00317.71
8.1.30.0040.00417.68
8.1.20.0000.00817.72
8.1.10.0020.00517.70
8.1.00.0000.00817.49
8.0.300.0070.00018.77
8.0.290.0000.00816.75
8.0.280.0030.00318.52
8.0.270.0030.00317.32
8.0.260.0030.00317.23
8.0.250.0050.00217.07
8.0.240.0030.00317.01
8.0.230.0050.00217.02
8.0.220.0000.00717.09
8.0.210.0000.00717.03
8.0.200.0030.00317.12
8.0.190.0030.00517.00
8.0.180.0000.00916.98
8.0.170.0040.00417.08
8.0.160.0050.00317.05
8.0.150.0030.00317.03
8.0.140.0070.00017.12
8.0.130.0000.00613.53
8.0.120.0000.00817.10
8.0.110.0050.00317.04
8.0.100.0040.00417.09
8.0.90.0070.00017.14
8.0.80.0090.00917.07
8.0.70.0040.00417.15
8.0.60.0050.00217.07
8.0.50.0000.00817.09
8.0.30.0060.01317.46
8.0.20.0080.01117.40
8.0.10.0000.00717.16
8.0.00.0100.00816.88
7.4.330.0050.00015.09
7.4.320.0000.00816.90
7.4.300.0040.00416.81
7.4.290.0050.00316.91
7.4.280.0030.00516.80
7.4.270.0000.00716.90
7.4.260.0070.00016.78
7.4.250.0050.00316.77
7.4.240.0040.00316.90
7.4.230.0030.00316.72
7.4.220.0060.01216.87
7.4.210.0040.01116.89
7.4.200.0030.00317.01
7.4.160.0110.00816.85
7.4.150.0160.00317.40
7.4.140.0080.01417.86
7.4.130.0090.00916.75
7.4.120.0080.00916.72
7.4.110.0060.01116.72
7.4.100.0100.01016.73
7.4.90.0140.00316.56
7.4.80.0060.01316.52
7.4.70.0100.00616.74
7.4.60.0030.01316.72
7.4.50.0050.00016.63
7.4.40.0060.01016.55
7.4.30.0040.01516.68
7.4.00.0060.00615.03
7.3.330.0000.00613.34
7.3.320.0000.00613.18
7.3.310.0070.00016.34
7.3.300.0030.00316.28
7.3.290.0050.01116.43
7.3.280.0120.00516.48
7.3.270.0090.00917.40
7.3.260.0100.00716.41
7.3.240.0060.01116.61
7.3.230.0140.00316.68
7.3.210.0130.00716.66
7.3.200.0070.01319.39
7.3.190.0170.00816.70
7.3.180.0060.00916.52
7.3.170.0130.01016.50
7.3.160.0080.00816.86
7.2.330.0110.00616.67
7.2.320.0100.01016.59
7.2.310.0120.01316.46
7.2.300.0030.01316.52
7.2.290.0080.00816.54
7.2.60.0000.01316.73
7.2.00.0030.00719.28
7.1.100.0040.00818.42
7.1.70.0080.00617.44
7.1.60.0060.01819.34
7.1.50.0040.01817.14
7.1.00.0030.09022.42
7.0.200.0000.00816.51
7.0.140.0070.07021.97
7.0.60.0170.06319.93
7.0.50.0100.07717.76
7.0.40.0170.08020.27
7.0.30.0530.08320.20
7.0.20.0130.04720.16
7.0.10.0030.04320.14
7.0.00.0100.08320.20
5.6.280.0030.07320.91
5.6.210.0030.04320.54
5.6.200.0170.07318.21
5.6.190.0200.07320.77
5.6.180.0000.07020.57
5.6.170.0270.06720.46
5.6.160.0070.07720.32
5.6.150.0100.07318.22
5.6.140.0030.05018.24
5.6.130.0030.08318.18
5.6.120.0070.07021.05
5.6.110.0200.07720.95
5.6.100.0030.09021.08
5.6.90.0070.05021.10
5.6.80.0030.07720.50
5.5.350.0170.08020.44
5.5.340.0070.03717.96
5.5.330.0000.04720.36
5.5.320.0330.05020.24
5.5.310.0200.07320.14
5.5.300.0100.08017.88
5.5.290.0100.07317.91
5.5.280.0070.06320.96
5.5.270.0100.03720.81
5.5.260.0100.07720.74
5.5.250.0100.08320.74
5.5.240.3430.04320.36
5.4.450.0330.06719.55
5.4.440.0870.06319.61
5.4.430.1070.04319.45
5.4.420.0170.05019.26
5.4.410.0000.06319.22
5.4.400.0270.06318.60
5.4.390.0400.05718.65
5.4.380.0200.06018.69
5.4.370.0300.05718.63
5.4.360.0330.05318.73
5.4.350.0060.03711.98
5.4.340.0040.03811.97
5.4.320.0070.03812.46
5.4.310.0070.04012.45
5.4.300.0080.03712.46
5.4.290.0070.03812.45
5.4.280.0070.03612.35
5.4.270.0110.03712.35
5.4.260.0100.04312.35
5.4.250.0090.04012.35
5.4.240.0050.03712.35
5.4.230.0050.04212.34
5.4.220.0070.03912.34
5.4.210.0110.03912.34
5.4.200.0020.04212.34
5.4.190.0080.04012.34
5.4.180.0060.04012.34
5.4.170.0070.03612.35
5.4.160.0090.03412.34
5.4.150.0110.04112.34
5.4.140.0060.03712.02
5.4.130.0080.03412.02
5.4.120.0050.03711.97
5.4.110.0080.03711.97
5.4.100.0080.03411.97
5.4.90.0070.03711.97
5.4.80.0040.04211.96
5.4.70.0040.03811.96
5.4.60.0090.03511.96
5.4.50.0050.03711.96
5.4.40.0050.03911.95
5.4.30.0080.03511.95
5.4.20.0030.03911.95
5.4.10.0080.03411.95
5.4.00.0050.04111.44
5.3.290.0070.04812.80
5.3.280.0050.04212.71
5.3.270.0080.04012.72
5.3.260.0050.04512.72
5.3.250.0080.04112.72
5.3.240.0110.03412.72
5.3.230.0090.03712.71
5.3.220.0080.03712.68
5.3.210.0080.04112.68
5.3.200.0050.04212.68
5.3.190.0070.04212.68
5.3.180.0070.04312.67
5.3.170.0070.03712.67
5.3.160.0040.04212.67
5.3.150.0060.03712.67
5.3.140.0090.03612.66
5.3.130.0060.04112.66
5.3.120.0060.04212.65
5.3.110.0070.04112.65
5.3.100.0060.04212.12
5.3.90.0080.03712.09
5.3.80.0110.03512.07
5.3.70.0080.03612.07
5.3.60.0080.03612.06
5.3.50.0030.04512.00
5.3.40.0070.03912.00
5.3.30.0030.03811.95
5.3.20.0040.04111.74
5.3.10.0050.03611.70
5.3.00.0070.03511.69
5.2.170.0070.0359.19
5.2.160.0070.0309.20
5.2.150.0090.0329.20
5.2.140.0040.0359.19
5.2.130.0060.0339.15
5.2.120.0080.0329.15
5.2.110.0070.0299.16
5.2.100.0070.0339.15
5.2.90.0080.0289.15
5.2.80.0060.0309.14
5.2.70.0060.0309.14
5.2.60.0030.0339.10
5.2.50.0050.0359.07
5.2.40.0090.0299.05
5.2.30.0040.0379.02
5.2.20.0110.0249.01
5.2.10.0070.0268.92
5.2.00.0040.0408.78
5.1.60.0080.0328.06
5.1.50.0060.0298.06
5.1.40.0040.0368.04
5.1.30.0030.0278.39
5.1.20.0050.0268.42
5.1.10.0090.0498.14
5.1.00.0050.0308.14
5.0.50.0070.0206.63
5.0.40.0060.0196.49
5.0.30.0050.0406.30
5.0.20.0080.0236.27
5.0.10.0080.0236.25
5.0.00.0070.0306.25
4.4.90.0040.0174.78
4.4.80.0040.0154.75
4.4.70.0040.0154.75
4.4.60.0050.0154.75
4.4.50.0050.0194.77
4.4.40.0030.0344.71
4.4.30.0070.0164.76
4.4.20.0030.0154.84
4.4.10.0030.0164.85
4.4.00.0020.0274.76
4.3.110.0040.0154.67
4.3.100.0050.0134.66
4.3.90.0020.0184.63
4.3.80.0020.0264.59
4.3.70.0030.0184.63
4.3.60.0050.0144.63
4.3.50.0080.0144.63
4.3.40.0020.0254.54
4.3.30.0040.0163.29
4.3.20.0020.0173.27
4.3.10.0030.0163.23
4.3.00.0070.0207.17

preferences:
58.31 ms | 401 KiB | 5 Q