3v4l.org

run code in 300+ PHP versions simultaneously
<?php $products = array(); class Products { public $chemID; public $catID; } $prod1 = new Products; $prod1->chemID=1; $prod1->catID=1; array_push($products,$prod1); for($i = 1; $i < 5; $i++) { ${'prod'.$i} = new Products; ${'prod'.$i}->chemID = $i; ${'prod'.$i}->catID = $i; array_push($products,${'prod'.$i}); } $carts = (object)array(array("chemID"=> 1, "catID" => 4),array("chemID"=> 2, "catID" => 4), array("chemID"=> 1, "catID" => 1)); $cnt = 0; foreach($products as $pkey=>$pobj) { foreach($carts as $ckey=>$carray) { if(isset($carray['chemID']) && isset($pobj['chemID'])) { if(isset($carray['catID']) && isset($pobj['catID']) && $carray['catID']==$pobj['catID']) { $cnt++; } } } } echo $cnt;

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.01016.75
8.3.50.0140.00718.18
8.3.40.0110.00418.88
8.3.30.0110.00418.71
8.3.20.0070.00720.34
8.3.10.0000.00823.66
8.3.00.0000.00819.38
8.2.180.0110.00716.88
8.2.170.0100.00722.96
8.2.160.0120.00619.21
8.2.150.0030.00624.18
8.2.140.0050.00324.66
8.2.130.0000.00817.63
8.2.120.0050.00326.35
8.2.110.0070.01022.25
8.2.100.0080.00317.93
8.2.90.0040.00419.35
8.2.80.0080.00017.97
8.2.70.0060.00317.59
8.2.60.0040.00418.04
8.2.50.0040.00418.07
8.2.40.0030.00619.25
8.2.30.0000.00720.64
8.2.20.0000.00817.88
8.2.10.0030.00618.14
8.2.00.0000.00718.14
8.1.280.0090.00625.92
8.1.270.0040.00423.91
8.1.260.0050.00328.09
8.1.250.0050.00328.09
8.1.240.0000.00922.59
8.1.230.0090.00317.79
8.1.220.0030.00517.79
8.1.210.0000.00918.77
8.1.200.0030.00717.38
8.1.190.0000.00817.25
8.1.180.0050.00318.10
8.1.170.0040.00418.73
8.1.160.0030.00521.99
8.1.150.0050.00218.95
8.1.140.0040.00419.54
8.1.130.0030.00317.68
8.1.120.0000.00717.51
8.1.110.0040.00417.47
8.1.100.0000.00717.50
8.1.90.0030.00317.50
8.1.80.0030.00417.46
8.1.70.0030.00317.39
8.1.60.0040.00417.45
8.1.50.0030.00617.53
8.1.40.0050.00317.49
8.1.30.0100.00317.61
8.1.20.0030.00517.49
8.1.10.0000.00817.61
8.1.00.0030.00517.39
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0070.00018.48
8.0.270.0030.00317.30
8.0.260.0000.00717.19
8.0.250.0030.00317.08
8.0.240.0030.00616.94
8.0.230.0040.00417.02
8.0.220.0050.00216.88
8.0.210.0030.00516.94
8.0.200.0030.00317.08
8.0.190.0030.00617.08
8.0.180.0000.00817.06
8.0.170.0040.00417.00
8.0.160.0030.00316.87
8.0.150.0040.00417.01
8.0.140.0040.00416.97
8.0.130.0000.00613.41
8.0.120.0080.00016.95
8.0.110.0000.00717.02
8.0.100.0050.00216.83
8.0.90.0040.00417.04
8.0.80.0090.01216.88
8.0.70.0040.00416.84
8.0.60.0000.00716.86
8.0.50.0040.00416.87
8.0.30.0110.00917.20
8.0.20.0120.00817.43
8.0.10.0050.00317.05
8.0.00.0060.01316.79
7.4.330.0040.00415.08
7.4.320.0030.00316.63
7.4.300.0060.00016.54
7.4.290.0080.00016.60
7.4.280.0040.00416.52
7.4.270.0000.00716.55
7.4.260.0030.00316.51
7.4.250.0030.00616.57
7.4.240.0030.00416.44
7.4.230.0080.00016.63
7.4.220.0190.01416.47
7.4.210.0110.00316.57
7.4.200.0040.00416.71
7.4.160.0030.01316.54
7.4.150.0120.01117.40
7.4.140.0080.01217.86
7.4.130.0060.01216.48
7.4.120.0110.01016.51
7.4.110.0110.00716.57
7.4.100.0090.00916.63
7.4.90.0100.00716.68
7.4.80.0160.00619.39
7.4.70.0180.00016.51
7.4.60.0090.00616.62
7.4.50.0090.00616.34
7.4.40.0070.01016.57
7.4.30.0140.00316.66
7.4.00.0090.00815.05
7.3.330.0070.00013.37
7.3.320.0000.00513.17
7.3.310.0030.00316.50
7.3.300.0030.00316.39
7.3.290.0000.00716.35
7.3.280.0080.00916.38
7.3.270.0060.01517.40
7.3.260.0070.01016.46
7.3.250.0080.01116.42
7.3.240.0100.00916.40
7.3.230.0120.00616.43
7.3.210.0070.01116.41
7.3.200.0140.00416.60
7.3.190.0060.01216.55
7.3.180.0170.02216.50
7.3.170.0060.01016.50
7.3.160.0060.00916.37
7.3.120.0060.01314.88
7.3.110.0030.01514.72
7.3.100.0040.01114.53
7.3.90.0030.01015.03
7.3.80.0100.00015.02
7.3.70.0110.00414.87
7.3.60.0030.00614.93
7.3.50.0080.00014.91
7.3.40.0110.00715.02
7.3.30.0040.01414.94
7.3.20.0040.00816.38
7.3.10.0020.01016.41
7.3.00.0070.00516.80
7.2.330.0090.00916.70
7.2.320.0090.01516.65
7.2.310.0060.00916.78
7.2.300.0070.01116.62
7.2.290.0100.01316.90
7.2.250.0040.01414.87
7.2.240.0110.00715.23
7.2.230.0070.01015.34
7.2.220.0080.00415.04
7.2.210.0060.01014.96
7.2.200.0120.00315.11
7.2.190.0060.00915.07
7.2.180.0110.00415.05
7.2.170.0000.01414.77
7.2.130.0000.01517.03
7.2.120.0110.00716.68
7.2.110.0000.01317.10
7.2.100.0030.01016.71
7.2.90.0030.01716.72
7.2.80.0080.00416.88
7.2.70.0030.00717.10
7.2.60.0110.00316.67
7.2.50.0040.00817.12
7.2.40.0090.00617.08
7.2.30.0080.00816.93
7.2.20.0100.00616.55
7.2.10.0130.00016.49
7.2.00.0030.01218.21
7.1.330.0000.01515.95
7.1.320.0110.00315.98
7.1.310.0040.01116.02
7.1.300.0030.00715.59
7.1.290.0060.00915.44
7.1.280.0040.01115.77
7.1.270.0040.01115.83
7.1.260.0100.00316.02
7.1.250.0030.00615.86
7.1.200.0060.00315.89
7.1.100.0000.01017.80
7.1.70.0000.01017.30
7.1.60.0160.00619.48
7.1.50.0000.01916.99
7.1.00.0030.07722.35
7.0.200.0230.00714.70
7.0.60.0370.03719.92
7.0.50.0100.03317.91
7.0.40.0130.06320.27
7.0.30.0330.06020.08
7.0.20.0330.06320.23
7.0.10.0100.04020.07
7.0.00.0030.08020.10
5.6.280.0100.06020.87
5.6.210.0070.08320.70
5.6.200.0170.07718.18
5.6.190.0070.05020.50
5.6.180.0230.03720.42
5.6.170.0300.08020.55
5.6.160.0030.09720.51
5.6.150.0130.07718.18
5.6.140.0030.06718.19
5.6.130.0200.07018.21
5.6.120.0200.04321.03
5.6.110.0030.04321.05
5.6.100.0030.04321.02
5.6.90.0030.04721.00
5.6.80.0030.08320.52
5.5.350.0030.08020.45
5.5.340.0030.08717.94
5.5.330.0130.07020.41
5.5.320.0000.08320.34
5.5.310.0130.04320.27
5.5.300.0030.05718.08
5.5.290.0100.06317.95
5.5.280.0170.07020.99
5.5.270.0130.06720.89
5.5.260.0030.04320.77
5.5.250.0130.07720.59
5.5.240.0030.04720.20

preferences:
51.95 ms | 400 KiB | 5 Q