3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = "100% Wool"; $separators = [ "/", ",", "&", " AND " ]; $value = str_replace($separators, "|", $value); $candidates = explode("|", $value); foreach($candidates as $candidate) { $percentage = (count($candidates) == 1) ? "100%" : null; if($candidate = trim($candidate)){ if(strpos("%", $candidate) !== false) { list($percentage, $material) = explode("%", $candidate); $percentage .= "%"; } else { $material = $candidate; } $entities = $this->mapping['material']; if($id = $this->exact($material, $entities)) { $material = [ 'material_id' => $id, 'percentage' => $percentage ]; $product['materials'][] = $material; } else { } } } print_r($product['materials']);

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.0120.00916.88
8.3.50.0150.00721.26
8.3.40.0000.01418.71
8.3.30.0120.00318.79
8.3.20.0070.00020.17
8.3.10.0050.00323.67
8.3.00.0080.00023.48
8.2.180.0170.00016.73
8.2.170.0070.01422.96
8.2.160.0110.01420.35
8.2.150.0090.00025.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0080.00019.96
8.2.110.0040.00421.00
8.2.100.0080.00417.80
8.2.90.0030.00619.28
8.2.80.0040.00418.03
8.2.70.0060.00317.48
8.2.60.0050.00317.93
8.2.50.0000.00918.07
8.2.40.0040.00422.31
8.2.30.0000.00719.39
8.2.20.0000.00717.69
8.2.10.0070.00018.21
8.2.00.0000.00818.02
8.1.280.0070.01125.92
8.1.270.0060.00323.86
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0030.00623.96
8.1.230.0080.00319.07
8.1.220.0030.00617.76
8.1.210.0000.00818.77
8.1.200.0070.00317.36
8.1.190.0090.00017.35
8.1.180.0080.00018.10
8.1.170.0000.00818.50
8.1.160.0000.00720.77
8.1.150.0000.00718.91
8.1.140.0080.00019.55
8.1.130.0030.00317.73
8.1.120.0040.00417.38
8.1.110.0000.00817.39
8.1.100.0040.00417.54
8.1.90.0030.00517.43
8.1.80.0070.00017.39
8.1.70.0000.00717.46
8.1.60.0040.00417.61
8.1.50.0000.00817.54
8.1.40.0070.00017.55
8.1.30.0030.00617.59
8.1.20.0000.00817.71
8.1.10.0030.00617.64
8.1.00.0070.00417.60
8.0.300.0040.00418.77
8.0.290.0050.00316.73
8.0.280.0030.00318.50
8.0.270.0000.00817.27
8.0.260.0060.00017.27
8.0.250.0030.00317.00
8.0.240.0000.00717.00
8.0.230.0040.00417.05
8.0.220.0080.00017.02
8.0.210.0070.00016.97
8.0.200.0000.00617.07
8.0.190.0000.00717.06
8.0.180.0000.00717.02
8.0.170.0030.00616.90
8.0.160.0000.00716.96
8.0.150.0040.00416.84
8.0.140.0040.00416.90
8.0.130.0000.00613.36
8.0.120.0000.00816.83
8.0.110.0040.00416.88
8.0.100.0070.00016.95
8.0.90.0000.00716.84
8.0.80.0070.01316.97
8.0.70.0070.00017.01
8.0.60.0040.00416.93
8.0.50.0030.00516.87
8.0.30.0180.00317.20
8.0.20.0090.01617.40
8.0.10.0080.00016.88
8.0.00.0130.01116.71
7.4.330.0000.00516.67
7.4.320.0000.00616.54
7.4.300.0040.00416.51
7.4.290.0030.00316.42
7.4.280.0040.00416.63
7.4.270.0030.00316.52
7.4.260.0040.00416.63
7.4.250.0070.00016.57
7.4.240.0020.00516.54
7.4.230.0070.00016.64
7.4.220.0070.02016.56
7.4.210.0090.00916.56
7.4.200.0030.00316.43
7.4.160.0060.00916.62
7.4.150.0090.00917.40
7.4.140.0110.00617.86
7.4.130.0100.00916.70
7.4.120.0120.01216.50
7.4.110.0140.01016.60
7.4.100.0070.01016.33
7.4.90.0120.00416.60
7.4.80.0060.01219.39
7.4.70.0110.00516.79
7.4.60.0130.01016.59
7.4.50.0040.01116.43
7.4.40.0030.01316.36
7.4.30.0140.00316.58
7.4.00.0030.01014.97
7.3.330.0060.00013.25
7.3.320.0000.00613.33
7.3.310.0030.00316.34
7.3.300.0030.00316.43
7.3.290.0030.00316.38
7.3.280.0090.00716.43
7.3.270.0070.01317.40
7.3.260.0090.00916.61
7.3.250.0090.01316.46
7.3.240.0130.00316.35
7.3.230.0150.00316.62
7.3.210.0100.00716.66
7.3.200.0060.01319.39
7.3.190.0080.00816.66
7.3.180.0050.01016.36
7.3.170.0030.01916.58
7.3.160.0130.00316.34
7.2.330.0070.01216.45
7.2.320.0110.01116.76
7.2.310.0030.01416.66
7.2.300.0030.01316.77
7.2.290.0100.00616.66
7.2.60.0030.01016.68
7.2.00.0000.00919.48
7.1.200.0000.01415.61
7.1.100.0000.01118.07
7.1.70.0030.01017.24
7.1.60.0070.01819.30
7.1.50.0030.00716.69
7.1.00.0030.07722.45
7.0.200.0030.00716.71
7.0.60.0170.03019.92
7.0.50.0070.08317.92
7.0.40.0030.04720.09
7.0.30.0200.03720.16
7.0.20.0330.07320.21
7.0.10.0100.07020.04
7.0.00.0170.06320.17
5.6.280.0070.03021.07
5.6.210.0100.03320.52
5.6.200.0170.07718.18
5.6.190.0100.05020.64
5.6.180.0370.04020.34
5.6.170.0230.03720.52
5.6.160.0070.04720.46
5.6.150.0030.08018.16
5.6.140.0130.07318.15
5.6.130.0170.07018.22
5.6.120.0030.04021.15
5.6.110.0000.06021.14
5.6.100.0130.07721.11
5.6.90.0070.04020.98
5.6.80.0030.04320.39
5.5.350.0070.06020.47
5.5.340.0070.08317.96
5.5.330.0100.07720.40
5.5.320.0370.05320.18
5.5.310.0270.06020.28
5.5.300.0100.07717.89
5.5.290.0070.08317.91
5.5.280.0070.03720.79
5.5.270.0170.07320.88
5.5.260.0170.07720.68
5.5.250.0100.07720.69
5.5.240.0130.03020.20

preferences:
51.38 ms | 401 KiB | 5 Q