3v4l.org

run code in 300+ PHP versions simultaneously
<?php function AttrFromString($string) { preg_match_all('/(\S+)=["\']?((?:.(?!["\']?\s+(?:\S+)=|[>"\']))+.)["\']?|(\S+)/', $string, $matches); $newlist = array(); foreach($matches as $yes) { if (strpos($yes, "=")!==false) { $as = explode('=', $yes); } else { $as[0] = $yes; $as[1] = ""; } if (substr($as[1], 0,1) == "'" || substr($as[1], 0,1) == '"') { $as[1] = substr($as[1],1,strlen($as[1])-2); } array_push($newlist, array($as[0]. $as[1])); } var_dump($newlist); } AttrFromString("test=hallo tes2=\"doei\" test3='lol' no-pe ja test='niks'");

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.0100.00616.63
8.3.50.0120.01017.67
8.3.40.0120.00419.07
8.3.30.0110.00419.13
8.3.20.0080.00019.07
8.3.10.0040.00419.16
8.3.00.0060.00319.63
8.2.180.0080.00817.13
8.2.170.0100.01022.96
8.2.160.0120.00319.03
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00420.89
8.2.110.0060.00322.33
8.2.100.0040.00820.01
8.2.90.0080.00018.04
8.2.80.0040.00419.07
8.2.70.0050.00317.88
8.2.60.0030.00617.93
8.2.50.0040.00418.07
8.2.40.0000.00818.22
8.2.30.0060.00318.00
8.2.20.0030.00717.86
8.2.10.0000.00817.91
8.2.00.0050.00318.10
8.1.280.0070.01025.92
8.1.270.0060.00323.99
8.1.260.0080.00026.35
8.1.250.0030.00628.09
8.1.240.0030.00620.70
8.1.230.0080.00317.76
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.48
8.1.190.0080.00017.61
8.1.180.0040.00418.10
8.1.170.0040.00418.71
8.1.160.0000.00819.05
8.1.150.0040.00418.75
8.1.140.0000.00817.73
8.1.130.0000.00717.84
8.1.120.0030.00317.70
8.1.110.0050.00317.55
8.1.100.0030.00417.70
8.1.90.0080.00017.54
8.1.80.0040.00417.66
8.1.70.0020.00517.59
8.1.60.0000.00917.79
8.1.50.0040.00417.64
8.1.40.0080.00017.54
8.1.30.0030.00517.71
8.1.20.0080.00017.76
8.1.10.0000.00817.61
8.1.00.0000.00717.65
8.0.300.0000.00718.77
8.0.290.0030.00617.00
8.0.280.0000.00718.50
8.0.270.0000.00817.29
8.0.260.0000.00716.96
8.0.250.0000.00817.14
8.0.240.0030.00617.07
8.0.230.0040.00417.22
8.0.220.0070.00017.17
8.0.210.0000.00717.14
8.0.200.0060.00017.07
8.0.190.0000.00817.20
8.0.180.0070.00017.18
8.0.170.0030.00617.06
8.0.160.0070.00017.18
8.0.150.0000.00917.13
8.0.140.0110.00017.07
8.0.130.0030.00313.51
8.0.120.0030.00817.11
8.0.110.0000.00717.22
8.0.100.0040.00416.98
8.0.90.0000.00817.22
8.0.80.0100.00717.18
8.0.70.0000.00717.26
8.0.60.0040.00417.16
8.0.50.0000.00717.17
8.0.30.0110.00817.56
8.0.20.0070.01117.33
8.0.10.0050.00317.15
8.0.00.0110.01017.13
7.4.330.0050.00013.33
7.4.320.0030.00316.88
7.4.300.0000.00716.88
7.4.290.0040.00416.68
7.4.280.0080.00016.78
7.4.270.0030.00316.87
7.4.260.0000.00613.56
7.4.250.0040.00416.79
7.4.240.0070.00016.86
7.4.230.0070.00016.96
7.4.220.0100.00716.97
7.4.210.0020.01716.91
7.4.200.0030.00316.99
7.4.190.0030.00516.91
7.4.160.0040.01316.83
7.4.150.0110.01416.76
7.4.140.0120.00816.78
7.4.130.0110.00816.63
7.4.120.0090.00916.72
7.4.110.0190.00316.92
7.4.100.0050.01416.86
7.4.90.0080.01116.86
7.4.80.0170.00319.39
7.4.70.0130.01016.77
7.4.60.0130.00416.78
7.4.50.0070.00716.61
7.4.40.0060.01316.61
7.4.30.0090.00916.70
7.4.00.0070.01015.13
7.3.330.0030.00313.60
7.3.320.0030.00313.52
7.3.310.0000.00816.50
7.3.300.0030.00316.52
7.3.290.0060.00816.57
7.3.280.0060.01416.58
7.3.270.0110.00616.66
7.3.260.0060.01216.75
7.3.250.0100.00816.63
7.3.240.0110.00816.57
7.3.230.0130.00916.66
7.3.210.0070.01016.89
7.3.200.0060.01016.85
7.3.190.0080.00816.57
7.3.180.0090.00916.54
7.3.170.0120.00916.70
7.3.160.0100.01316.77
7.3.120.0120.00315.04
7.3.10.0070.00716.39
7.3.00.0040.01216.71
7.2.330.0090.01616.86
7.2.320.0140.00416.92
7.2.310.0090.00916.71
7.2.300.0060.01216.99
7.2.290.0120.00516.99
7.2.130.0080.01416.95
7.2.120.0260.00016.91
7.2.110.0060.00616.89
7.2.100.0120.00317.03
7.2.90.0060.01016.94
7.2.80.0100.01317.19
7.2.70.0110.00416.94
7.2.60.0070.00717.20
7.2.50.0060.00616.93
7.2.40.0100.00317.28
7.2.30.0090.00317.07
7.2.20.0000.01116.93
7.2.10.0090.00317.18
7.2.00.0070.00518.38
7.1.250.0100.00315.71
7.1.200.0100.00315.74
7.1.100.0070.00718.30
7.1.70.0000.01517.40
7.1.60.0100.01419.30
7.1.50.0030.01217.14
7.1.00.0070.06022.45
7.0.200.0080.00416.88
7.0.140.0030.07322.00
7.0.120.0070.03722.14
7.0.60.0030.07019.92
7.0.50.0030.08317.91
7.0.40.0100.05020.28
7.0.30.0270.05720.32
7.0.20.0230.04320.08
7.0.10.0100.05720.25
7.0.00.0000.09020.12
5.6.280.0070.07021.04
5.6.210.0030.05320.51
5.6.200.0200.06718.22
5.6.190.0230.05720.45
5.6.180.0330.08320.40
5.6.170.0330.06320.77
5.6.160.0070.08320.56
5.6.150.0030.08718.19
5.6.140.0100.07718.18
5.6.130.0070.07718.20
5.6.120.0100.08021.00
5.6.110.0170.07321.05
5.6.100.0030.05721.03
5.6.90.0170.03720.98
5.6.80.0100.04320.41
5.5.350.0000.05020.40
5.5.340.0130.07317.96
5.5.330.0030.08720.19
5.5.320.3470.04720.42
5.5.310.0270.08320.20
5.5.300.0070.07717.95
5.5.290.0030.08317.96
5.5.280.0070.07720.88
5.5.270.0070.06320.75
5.5.260.0000.09020.78
5.5.250.0030.08320.62
5.5.240.0070.08320.29
5.4.450.0100.08019.40
5.4.440.0030.05319.41
5.4.430.0070.08019.32
5.4.420.0100.04319.56
5.4.410.0100.08019.07
5.4.400.0100.07018.85
5.4.390.0000.05719.14
5.4.380.0030.03718.92
5.4.370.0000.07018.85
5.4.360.0100.08019.14
5.4.350.0130.07719.26
5.4.340.0100.05318.88
5.4.320.0100.04318.85
5.4.310.0070.08018.98
5.4.300.0030.07719.27
5.4.290.0030.04718.85
5.4.280.0030.04019.24
5.4.270.0030.07319.24
5.4.260.0070.04019.20
5.4.250.0000.05019.24
5.4.240.0170.02718.88
5.4.230.0000.06719.23
5.4.220.0130.06319.11
5.4.210.0000.06019.15
5.4.200.0030.04019.11
5.4.190.0030.03718.91
5.4.180.0000.04018.86
5.4.170.0000.04018.84
5.4.160.0070.04018.91
5.4.150.0030.03719.23
5.4.140.0000.06016.55
5.4.130.0070.03316.50
5.4.120.0000.03716.34
5.4.110.0030.03316.37
5.4.100.0070.03016.36
5.4.90.0070.04016.53
5.4.80.0070.03016.38
5.4.70.0030.03316.32
5.4.60.0070.03716.40
5.4.50.0000.04016.47
5.4.40.0070.03016.40
5.4.30.0000.03716.40
5.4.20.0030.04316.31
5.4.10.0030.03316.39
5.4.00.0070.03015.82
5.3.290.0030.07714.72
5.3.280.0070.03714.65
5.3.270.0030.04714.60
5.3.260.0030.03714.61
5.3.250.0070.03314.61
5.3.240.0030.03714.68
5.3.230.0030.03714.66
5.3.220.0070.03314.56
5.3.210.0030.04014.63
5.3.200.0030.03714.49
5.3.190.0070.03314.62
5.3.180.0070.03314.49
5.3.170.0000.04014.63
5.3.160.0030.03714.48
5.3.150.0070.03314.59
5.3.140.0030.03314.56
5.3.130.0030.03714.55
5.3.120.0000.04014.55
5.3.110.0100.03014.47
5.3.100.0070.03014.09
5.3.90.0000.03713.94
5.3.80.0000.03714.07
5.3.70.0030.03313.97
5.3.60.0000.04014.06
5.3.50.0070.03314.03
5.3.40.0030.03313.95
5.3.30.0030.04314.07
5.3.20.0000.03713.86
5.3.10.0000.03713.73
5.3.00.0000.03713.71
5.2.170.0000.03011.08
5.2.160.0030.02711.17
5.2.150.0000.03011.21
5.2.140.0030.02711.21
5.2.130.0030.03011.11
5.2.120.0070.02311.15
5.2.110.0000.03011.19
5.2.100.0000.03711.08
5.2.90.0000.03311.16
5.2.80.0100.05011.13
5.2.70.0030.05711.27
5.2.60.0070.05711.03
5.2.50.0000.05310.99
5.2.40.0000.03710.98
5.2.30.0030.02710.92
5.2.20.0000.04011.13
5.2.10.0100.05310.95
5.2.00.0070.05710.78
5.1.60.0030.05710.03
5.1.50.0030.0479.92
5.1.40.0030.04710.05
5.1.30.0100.03310.31
5.1.20.0000.06310.36
5.1.10.0070.04310.11
5.1.00.0070.0309.99
5.0.50.0070.0408.55
5.0.40.0000.0208.43
5.0.30.0070.0608.31
5.0.20.0000.0308.24
5.0.10.0000.0308.29
5.0.00.0000.0638.22
4.4.90.0000.0237.98
4.4.80.0030.0177.98
4.4.70.0030.0337.98
4.4.60.0030.0307.98
4.4.50.0030.0337.98
4.4.40.0030.0477.98
4.4.30.0030.0307.98
4.4.20.0030.0337.98
4.4.10.0030.0237.98
4.4.00.0000.0407.98
4.3.110.0070.0107.98
4.3.100.0000.0307.98
4.3.90.0030.0337.98
4.3.80.0000.0407.98
4.3.70.0000.0337.98
4.3.60.0000.0377.98
4.3.50.0030.0337.98
4.3.40.0030.0337.98
4.3.30.0000.0207.98
4.3.20.0070.0307.98
4.3.10.0000.0337.98
4.3.00.0030.0307.98

preferences:
48.98 ms | 401 KiB | 5 Q