3v4l.org

run code in 300+ PHP versions simultaneously
<?php function AttrFromString($string) { preg_match_all('/(\S+)=["\']?((?:.(?!["\']?\s+(?:\S+)=|[>"\']))+.)["\']?|(\S+)/', $string, $matches); var_dump($matches); $items = explode(" ", $string); $newlist = array(); foreach($items 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); } } } AttrFromString("test=hallo tes2=\"doei\" test3='lol' no-pe ja test='niks'");

Abusive script

This script was stopped while abusing our resources

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)
7.4.10.0170.00815.82
7.4.00.0120.00815.54
7.3.130.0090.00815.71
7.3.120.0100.01115.52
7.3.110.0160.00815.76
7.3.100.0130.00915.88
7.3.90.0120.01415.86
7.3.80.0120.01015.74
7.3.70.0100.01315.90
7.3.60.0130.00715.74
7.3.50.0100.01115.80
7.3.40.0120.01115.71
7.3.30.0080.01315.73
7.3.20.0360.01016.74
7.3.10.0290.00616.67
7.3.00.0100.01016.70
7.2.260.0110.01516.03
7.2.250.0160.00915.98
7.2.240.0060.01616.12
7.2.230.0120.01316.11
7.2.220.0150.00815.87
7.2.210.0140.00916.13
7.2.200.0070.01116.04
7.2.190.0150.00916.04
7.2.180.0140.00916.08
7.2.170.0120.01115.96
7.2.160.0110.01316.06
7.2.150.0150.00917.02
7.2.140.0120.00916.99
7.2.130.0210.01416.98
7.2.120.0120.00617.02
7.2.110.0080.01016.88
7.2.100.0100.00917.54
7.2.90.0120.00817.67
7.2.80.0130.00615.57
7.2.70.0220.00515.62
7.2.60.0150.00815.63
7.2.50.0080.01015.50
7.2.40.0120.00815.54
7.2.30.0110.01216.93
7.2.20.0440.00816.99
7.2.10.0250.00717.02
7.2.00.0100.00918.17
7.1.330.0350.00915.76
7.1.320.0580.01215.74
7.1.310.0140.00815.86
7.1.300.0390.01015.78
7.1.290.0140.00416.67
7.1.280.0140.00816.76
7.1.270.0140.00716.82
7.1.260.0050.01615.79
7.1.250.0090.00816.45
7.1.240.0150.00716.89
7.1.230.0150.00815.79
7.1.220.0120.00915.76
7.1.210.0350.01015.72
7.1.200.0120.01415.98
7.1.190.0120.01415.96
7.1.180.0160.00716.85
7.1.170.0360.00815.80
7.1.160.0090.01115.79
7.1.150.0090.01015.84
7.1.140.0120.01216.72
7.1.130.0380.00615.77
7.1.120.0390.01115.82
7.1.110.0130.00716.85
7.1.100.0170.00816.78
7.1.90.0180.00716.62
7.1.80.0110.01115.98
7.1.70.0090.00616.39
7.1.60.0080.01216.99
7.1.50.0090.00715.12
7.1.40.0120.01116.91
7.1.30.0050.01715.83
7.1.20.0220.00614.16
7.1.10.0110.01015.84
7.1.00.0130.03018.64
7.0.330.0130.01016.33
7.0.320.0120.00915.53
7.0.310.0240.00714.03
7.0.300.0100.01315.29
7.0.290.0100.00916.49
7.0.280.0220.01115.47
7.0.270.0160.01015.44
7.0.260.0180.00715.58
7.0.250.0270.01015.61
7.0.240.0240.01015.62
7.0.230.0310.00815.46
7.0.220.0130.00715.67
7.0.210.0100.00916.53
7.0.200.0080.01116.07
7.0.190.0160.00315.58
7.0.180.0110.01015.49
7.0.170.0150.00915.62
7.0.160.0070.01615.53
7.0.150.0120.00714.11
7.0.140.0080.02616.67
7.0.130.0300.01215.62
7.0.120.0090.02416.78
7.0.110.0120.00815.47
7.0.100.0200.00514.09
7.0.90.0130.00716.38
7.0.80.0280.01115.54
7.0.70.0070.01115.40
7.0.60.0140.03117.54
7.0.50.0320.03116.39
7.0.40.0100.03716.25
7.0.30.0170.03216.20
7.0.20.0170.03216.34
7.0.10.0140.02616.34
7.0.00.0060.03616.29
5.6.400.0080.01215.43
5.6.390.0170.00515.55
5.6.380.0090.01415.36
5.6.370.0090.01215.26
5.6.360.0110.00915.24
5.6.350.0110.00915.52
5.6.340.0120.01215.54
5.6.330.0130.00613.64
5.6.320.0100.00913.62
5.6.310.0070.01515.14
5.6.300.0150.00915.37
5.6.290.0100.01215.34
5.6.280.0040.03517.25
5.6.270.0140.00815.30
5.6.260.0110.01015.28
5.6.250.0130.00815.35
5.6.240.0080.01415.29
5.6.230.0100.01015.42
5.6.220.0120.00715.36
5.6.210.0120.02517.12
5.6.200.0070.02216.32
5.6.190.0100.03617.06
5.6.180.0170.02117.10
5.6.170.0170.02917.01
5.6.160.0130.01717.06
5.6.150.0160.02216.36
5.6.140.0070.02916.38
5.6.130.0110.01916.38
5.6.120.0110.03617.25
5.6.110.0060.04017.13
5.6.100.0060.03417.13
5.6.90.0130.03117.13
5.6.80.0070.02417.01
5.6.70.0130.00715.00
5.6.60.0090.00813.48
5.6.50.0110.00715.23
5.6.40.0130.00815.25
5.6.30.0110.01315.24
5.6.20.0090.01115.11
5.6.10.0140.00715.24
5.6.00.0130.00613.46
5.5.380.0140.00915.42
5.5.370.0190.00415.39
5.5.360.0100.01115.25
5.5.350.0190.01917.03
5.5.340.0090.02916.14
5.5.330.0070.03416.91
5.5.320.0190.02416.88
5.5.310.0140.03717.00
5.5.300.0140.02516.19
5.5.290.0130.03016.21
5.5.280.0110.03117.17
5.5.270.0070.02017.06
5.5.260.0110.01717.13
5.5.250.0100.03417.07
5.5.240.0120.01917.00
5.5.230.0100.00915.18
5.5.220.0130.00915.15
5.5.210.0130.00615.13
5.5.200.0110.00915.28
5.5.190.0150.00515.30
5.5.180.0140.00615.34
5.5.170.0090.00915.25
5.5.160.0110.00915.27
5.5.150.0110.00715.03
5.5.140.0090.01115.25
5.5.130.0110.01015.32
5.5.120.0090.00915.05
5.5.110.0160.00515.28
5.5.100.0150.00415.29
5.5.90.0140.00515.23
5.5.80.0040.01515.21
5.5.70.0070.01315.18
5.5.60.0110.00515.19
5.5.50.0090.00915.29
5.5.40.0100.01115.21
5.5.30.0100.01015.03
5.5.20.0120.00915.19
5.5.10.0140.00415.34
5.5.00.0110.01115.22
5.4.450.0080.01614.50
5.4.440.0060.01914.74
5.4.430.0060.01614.58
5.4.420.0090.02814.33
5.4.410.0080.02214.59
5.4.400.0100.02614.33
5.4.390.0070.03014.38
5.4.380.0070.01614.35
5.4.370.0070.02314.47
5.4.360.0060.03114.35
5.4.350.0070.02714.41
5.4.340.0040.02114.53
5.4.330.0060.00511.85
5.4.320.0040.02614.26
5.4.310.0060.01514.40
5.4.300.0060.02314.32
5.4.290.0100.02614.38
5.4.280.0040.03514.33
5.4.270.0100.02714.45
5.4.260.0100.02714.28
5.4.250.0050.02814.52
5.4.240.0040.02114.46
5.4.230.0100.01314.41
5.4.220.0060.03214.35
5.4.210.0070.03014.44
5.4.200.0090.01514.32
5.4.190.0120.01814.40
5.4.180.0080.02914.47
5.4.170.0090.01814.29
5.4.160.0040.02614.38
5.4.150.0060.03314.33
5.4.140.0100.02513.55
5.4.130.0030.02313.56
5.4.120.0070.01513.35
5.4.110.0050.01813.56
5.4.100.0030.02013.52
5.4.90.0070.01913.43
5.4.80.0050.01813.57
5.4.70.0070.01913.41
5.4.60.0110.01713.45
5.4.50.0070.01613.46
5.4.40.0060.01813.46
5.4.30.0040.01913.42
5.4.20.0040.03213.37
5.4.10.0050.01713.48
5.4.00.0060.01713.37
5.3.290.0100.02212.96
5.3.280.0070.02612.76
5.3.270.0080.02812.80
5.3.260.0060.02612.89
5.3.250.0050.03012.83
5.3.240.0030.02812.64
5.3.230.0080.01812.72
5.3.220.0040.03412.68
5.3.210.0070.02012.70
5.3.200.0050.02312.76
5.3.190.0080.01712.83
5.3.180.0040.02012.84
5.3.170.0050.02112.83
5.3.160.0080.01612.72
5.3.150.0050.03012.76
5.3.140.0110.01612.78
5.3.130.0050.02412.84
5.3.120.0050.02412.85
5.3.110.0070.01412.72
5.3.100.0090.02412.60
5.3.90.0060.01512.61
5.3.80.0080.02612.51
5.3.70.0050.02112.47
5.3.60.0060.02812.66
5.3.50.0130.01412.54
5.3.40.0030.02312.55
5.3.30.0080.02712.60
5.3.20.0080.01612.44
5.3.10.0070.01912.37
5.3.00.0090.02012.24
5.2.170.0000.03711.19
5.2.160.0000.06011.17
5.2.150.0030.06711.10
5.2.140.0000.04311.19
5.2.130.0030.05711.00
5.2.120.0100.02311.13
5.2.110.0030.03011.16
5.2.100.0030.05711.25
5.2.90.0070.06011.16
5.2.80.0030.03311.14
5.2.70.0030.06310.99
5.2.60.0070.04311.10
5.2.50.0070.06011.07
5.2.40.0070.05310.93
5.2.30.0130.05311.03
5.2.20.0000.05311.04
5.2.10.0000.06310.85
5.2.00.0070.03310.64
5.1.60.0030.04710.16
5.1.50.0100.05010.02
5.1.40.0000.03010.13
5.1.30.0030.04710.35
5.1.20.0000.04010.36
5.1.10.0000.05310.03
5.1.00.0070.02710.06
5.0.50.0000.0408.63
5.0.40.0000.0338.40
5.0.30.0070.0378.23
5.0.20.0030.0238.14
5.0.10.0030.0378.16
5.0.00.0030.0438.20
4.4.90.0000.0337.90
4.4.80.0000.0177.90
4.4.70.0030.0207.90
4.4.60.0000.0277.90
4.4.50.0000.0307.90
4.4.40.0030.0507.90
4.4.30.0000.0237.90
4.4.20.0130.0137.90
4.4.10.0000.0177.90
4.4.00.0030.0507.90
4.3.110.0000.0277.90
4.3.100.0070.0207.90
4.3.90.0030.0337.90
4.3.80.0000.0537.90
4.3.70.0070.0307.90
4.3.60.0030.0277.90
4.3.50.0070.0137.90
4.3.40.0070.0437.90
4.3.30.0070.0277.90
4.3.20.0000.0207.90
4.3.10.0000.0207.90
4.3.00.0000.0207.90

preferences:
39.59 ms | 401 KiB | 5 Q