3v4l.org

run code in 300+ PHP versions simultaneously
<?php $category = array( 1 => array( 'id' => 1, 'parentID' => 0, 'name' => 'SUV auto parts' ), 2 => array( 'id' => 2, 'parentID' => 1, 'name' => 'Engine Related' ), 3 => array( 'id' => 3, 'parentID' => 2, 'name' => 'Spark Plugs' ), 4 => array( 'id' => 4, 'parentID' => 2, 'name' => 'Engine Oil' ), 5 => array( 'id' => 5, 'parentID' => 1, 'name' => 'Body related' ), 6 => array( 'id' => 6, 'parentID' => 0, 'name' => 'Sedan auto parts' ), 7 => array( 'id' => 7, 'parentID' => 6, 'name' => 'Engine Related' ), ); $parentId = 2; // set the parentID foreach($category as $key => $value) { if($value['parentID'] == $parentId) { echo '<pre>'; print_r($value); // print matching records echo '</pre>'; } }

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.4.130.0120.00817.90
8.4.120.0100.01020.70
8.4.110.0090.00522.68
8.4.100.0090.01117.74
8.4.90.0060.00218.43
8.4.80.0090.01119.42
8.4.70.0060.00817.90
8.4.60.0110.00918.72
8.4.50.0150.00517.77
8.4.40.0200.00019.14
8.4.30.0060.00318.45
8.4.20.0080.00020.76
8.4.10.0070.00319.52
8.3.260.0130.00716.48
8.3.250.0110.00718.87
8.3.240.0110.00816.50
8.3.230.0090.00816.61
8.3.220.0100.00817.12
8.3.210.0120.00816.62
8.3.200.0050.00416.70
8.3.190.0050.00318.64
8.3.180.0120.00618.54
8.3.170.0060.01217.29
8.3.160.0180.00018.28
8.3.150.0130.00618.71
8.3.140.0040.00418.43
8.3.130.0030.00618.44
8.3.120.0180.00020.53
8.3.110.0070.00420.94
8.3.100.0040.00424.06
8.3.90.0080.00026.77
8.3.80.0090.00016.63
8.3.70.0090.00918.30
8.3.60.0070.01416.38
8.3.50.0090.00523.63
8.3.40.0140.00418.84
8.3.30.0110.00418.85
8.3.20.0040.00420.77
8.3.10.0090.00021.77
8.3.00.0000.00721.97
8.2.290.0090.00920.47
8.2.280.0120.00718.23
8.2.270.0140.00717.26
8.2.260.0140.00416.40
8.2.250.0030.00616.73
8.2.240.0040.00419.16
8.2.230.0040.00422.58
8.2.220.0040.00737.54
8.2.210.0070.01126.77
8.2.200.0000.00916.50
8.2.190.0120.00616.58
8.2.180.0090.00625.92
8.2.170.0030.01022.96
8.2.160.0120.00322.09
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00418.94
8.2.110.0030.00620.46
8.2.100.0040.00817.84
8.2.90.0040.00419.36
8.2.80.0080.00017.97
8.2.70.0050.00317.75
8.2.60.0080.00018.05
8.2.50.0090.00018.07
8.2.40.0040.00418.22
8.2.30.0080.00318.37
8.2.20.0040.00418.18
8.2.10.0040.00419.42
8.2.00.0030.00719.27
8.1.330.0140.00521.95
8.1.320.0100.01116.14
8.1.310.0040.00416.88
8.1.300.0080.00018.32
8.1.290.0060.00630.84
8.1.280.0130.00725.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0050.00522.42
8.1.230.0080.00419.15
8.1.220.0040.00417.77
8.1.210.0000.00818.77
8.1.200.0080.00017.35
8.1.190.0050.00317.23
8.1.180.0000.00818.10
8.1.170.0000.00918.65
8.1.160.0040.00418.76
8.1.150.0000.00818.91
8.1.140.0040.00420.75
8.1.130.0070.00020.16
8.1.120.0070.00017.46
8.1.110.0080.00017.36
8.1.100.0000.00817.36
8.1.90.0000.00717.42
8.1.80.0030.00617.44
8.1.70.0040.00417.46
8.1.60.0040.00417.60
8.1.50.0000.00817.51
8.1.40.0000.00817.42
8.1.30.0040.00417.52
8.1.20.0030.00517.50
8.1.10.0040.00417.55
8.1.00.0000.00817.47
8.0.300.0080.00018.77
8.0.290.0080.00016.75
8.0.280.0000.00720.28
8.0.270.0030.00518.05
8.0.260.0000.00619.98
8.0.250.0000.00716.99
8.0.240.0040.00416.92
8.0.230.0030.00316.95
8.0.220.0000.00716.76
8.0.210.0000.00716.90
8.0.200.0030.00316.96
8.0.190.0030.00316.84
8.0.180.0030.00516.93
8.0.170.0080.00016.78
8.0.160.0030.00316.89
8.0.150.0030.00516.86
8.0.140.0000.00716.73
8.0.130.0030.00313.27
8.0.120.0040.00416.86
8.0.110.0040.00416.88
8.0.100.0000.00716.95
8.0.90.0040.00416.70
8.0.80.0090.00516.87
8.0.70.0000.00716.75
8.0.60.0050.00216.79
8.0.50.0000.00716.86
8.0.30.0130.00317.12
8.0.20.0060.01316.82
8.0.10.0000.00717.02
8.0.00.0090.01116.79
7.4.330.0000.00516.89
7.4.320.0030.00316.55
7.4.300.0030.00316.64
7.4.290.0000.00816.59
7.4.280.0000.00816.59
7.4.270.0070.00016.58
7.4.260.0030.00313.26
7.4.250.0000.00716.44
7.4.240.0070.00016.60
7.4.230.0000.00716.62
7.4.220.0030.00316.50
7.4.210.0040.01116.60
7.4.200.0040.00416.67
7.4.130.0090.00916.46
7.4.120.0100.01316.44
7.4.110.0100.00716.75
7.4.100.0120.00616.48
7.4.90.0070.01016.53
7.4.80.0030.01919.39
7.4.70.0070.01016.54
7.4.60.0090.00916.54
7.4.50.0130.00016.38
7.4.40.0130.00316.55
7.4.10.0070.01016.42
7.4.00.0160.00316.63
7.3.330.0080.00016.29
7.3.320.0030.00313.05
7.3.310.0000.00716.25
7.3.300.0040.00416.34
7.3.290.0080.01016.29
7.3.280.0080.00616.21
7.3.260.0080.00816.49
7.3.230.0130.01016.39
7.3.210.0060.01216.42
7.3.200.0100.00716.58
7.3.190.0080.00816.53
7.3.180.0100.00616.39
7.3.170.0100.00716.32
7.3.160.0000.01716.55
7.3.130.0130.00316.21
7.3.120.0130.00316.57
7.3.110.0150.00016.29
7.3.100.0140.00316.32
7.3.90.0080.01116.15
7.3.80.0110.00716.30
7.3.70.0060.01216.23
7.3.60.0120.00916.22
7.3.50.0150.00716.24
7.3.40.0090.00916.00
7.3.30.0130.00516.22
7.3.20.0060.00916.33
7.3.10.0120.00516.27
7.3.00.0140.00316.47
7.2.330.0110.00616.46
7.2.320.0160.00716.69
7.2.310.0130.00416.61
7.2.300.0040.01916.48
7.2.290.0130.00316.82
7.2.260.0030.01816.71
7.2.250.0030.01516.70
7.2.240.0060.01116.63
7.2.230.0130.00616.27
7.2.220.0110.01116.42
7.2.210.0070.01116.49
7.2.200.0160.00416.31
7.2.190.0110.00816.29
7.2.180.0100.00916.38
7.2.170.0100.00816.33
7.2.160.0060.01116.38
7.2.150.0060.01216.44
7.2.140.0100.00716.42
7.2.130.0110.00616.44
7.2.120.0080.00816.75
7.2.110.0130.00416.64
7.2.100.0090.01216.51
7.2.90.0090.00916.38
7.2.80.0050.01616.48
7.2.70.0040.01816.60
7.2.60.0140.00916.57
7.2.50.0090.00916.50
7.2.40.0100.01416.69
7.2.30.0110.01416.62
7.2.20.0080.01316.73
7.2.10.0130.01016.61
7.2.00.0120.00516.70

preferences:
17.82 ms | 403 KiB | 5 Q