3v4l.org

run code in 300+ PHP versions simultaneously
<?php $packageColumns = array( 'SequenceNumber' => 1, 'GroupPackageCount' => 1, 'Weight' => array( 'Value' => array('pkg_weight' => 2), 'Units' => 'LB' ), 'Dimensions' => array( 'Length' => array('pkg_length' => 6), 'Width' => array('pkg_width' => 5), 'Height' => array('pkg_height' => 3), 'Units' => 'IN' ) ); $package = array( 'pkg_weight' => 96, 'pkg_height' => 0, 'pkg_width' => 0, 'pkg_length' => 0 ); $newPackage = array(); foreach($packageColumns as $col => $def) { if(is_array($def)) { $newPackage[$col] = array(); foreach($def as $k => $default) { if(is_array($default)) { $key = key($default); $defaultValue = $default[$key]; } else { $key = $k; $defaultValue = $default; } if(isset($package[$key])) { $newPackage[$col][$k] = $package[$key]; } else if(isset($newPackage[$col][$k])) { continue; } else { $newPackage[$col][$k] = $defaultValue; } } } else { if(isset($package[$col])) { $newPackage[$col] = $package[$col]; } else if(isset($newPackage[$col])) { continue; } else { $newPackage[$col] = $def; } } } echo '<pre>'; print_r($newPackage); 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.3.60.0090.01216.50
8.3.50.0080.01021.13
8.3.40.0030.01218.58
8.3.30.0040.01119.23
8.3.20.0040.00420.28
8.3.10.0060.00323.65
8.3.00.0060.00317.46
8.2.180.0120.00616.50
8.2.170.0050.00822.96
8.2.160.0110.00320.47
8.2.150.0030.00524.18
8.2.140.0070.00724.66
8.2.130.0070.00026.16
8.2.120.0000.00721.00
8.2.110.0060.00319.38
8.2.100.0080.00417.63
8.2.90.0040.00419.30
8.2.80.0040.00417.97
8.2.70.0000.00817.61
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0030.00619.96
8.2.30.0070.00018.01
8.2.20.0030.00617.70
8.2.10.0040.00418.00
8.2.00.0040.00418.18
8.1.280.0070.00725.92
8.1.270.0110.00720.33
8.1.260.0090.00026.35
8.1.250.0000.00828.09
8.1.240.0050.00322.66
8.1.230.0070.00417.83
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0000.00917.22
8.1.190.0090.00017.36
8.1.180.0030.00618.10
8.1.170.0000.00818.57
8.1.160.0040.00422.03
8.1.150.0070.00018.94
8.1.140.0050.00217.37
8.1.130.0050.00217.75
8.1.120.0050.00317.46
8.1.110.0050.00217.39
8.1.100.0000.00717.40
8.1.90.0030.00517.48
8.1.80.0050.00217.48
8.1.70.0070.00017.50
8.1.60.0060.00317.57
8.1.50.0050.00317.41
8.1.40.0130.00017.39
8.1.30.0000.00817.55
8.1.20.0040.00417.62
8.1.10.0070.00017.46
8.1.00.0040.00417.53
8.0.300.0030.00518.77
8.0.290.0080.00016.75
8.0.280.0040.00418.51
8.0.270.0050.00217.18
8.0.260.0060.00017.22
8.0.250.0070.00016.88
8.0.240.0050.00316.93
8.0.230.0030.00516.94
8.0.220.0070.00016.88
8.0.210.0070.00016.91
8.0.200.0030.00316.95
8.0.190.0000.00817.04
8.0.180.0040.00416.92
8.0.170.0000.00716.87
8.0.160.0040.00416.89
8.0.150.0000.00716.86
8.0.140.0040.00416.88
8.0.130.0000.00613.26
8.0.120.0030.00616.82
8.0.110.0020.00516.80
8.0.100.0040.00416.89
8.0.90.0060.00316.78
8.0.80.0090.00616.96
8.0.70.0050.00316.76
8.0.60.0080.00016.98
8.0.50.0000.00716.92
8.0.30.0060.01217.20
8.0.20.0120.00817.40
8.0.10.0000.00816.89
8.0.00.0040.01516.80
7.4.330.0030.00315.04
7.4.320.0000.00616.54
7.4.300.0000.00716.48
7.4.290.0070.00016.52
7.4.280.0040.00416.61
7.4.270.0070.00016.62
7.4.260.0080.00416.49
7.4.250.0040.00416.49
7.4.240.0040.00416.64
7.4.230.0000.00816.34
7.4.220.0070.02016.53
7.4.210.0090.00816.63
7.4.200.0040.00416.72
7.4.160.0130.00716.57
7.4.150.0080.01117.40
7.4.140.0070.01317.86
7.4.130.0090.01216.43
7.4.120.0100.00916.50
7.4.110.0080.01516.46
7.4.100.0100.01016.66
7.4.90.0100.00716.54
7.4.80.0000.01719.39
7.4.70.0070.01016.46
7.4.60.0100.00616.41
7.4.50.0030.00516.47
7.4.40.0120.00616.64
7.4.30.0090.01216.62
7.4.00.0130.00314.80
7.3.330.0000.00613.20
7.3.320.0000.00513.16
7.3.310.0070.00016.44
7.3.300.0030.00316.37
7.3.290.0030.00316.31
7.3.280.0070.01316.35
7.3.270.0080.00817.40
7.3.260.0110.00516.57
7.3.240.0130.00416.52
7.3.230.0030.01716.41
7.3.210.0160.00716.42
7.3.200.0070.01519.39
7.3.190.0080.00916.51
7.3.180.0140.00316.59
7.3.170.0120.00916.47
7.3.160.0150.00016.33
7.2.330.0070.01016.63
7.2.320.0060.01516.53
7.2.310.0130.00916.40
7.2.300.0130.01016.81
7.2.290.0080.01116.60
7.2.00.0000.01219.27
7.1.100.0080.00818.13
7.1.70.0030.00617.37
7.1.60.0170.00719.59
7.1.50.0030.01916.92
7.1.00.0030.07722.32
7.0.200.0000.00816.88
7.0.60.0100.07319.92
7.0.50.0070.08017.90
7.0.40.0030.05320.10
7.0.30.0230.03720.17
7.0.20.0370.04720.00
7.0.10.0070.07720.12
7.0.00.0070.04020.00
5.6.280.0000.07721.13
5.6.210.0030.08320.61
5.6.200.0070.04718.22
5.6.190.0130.07720.43
5.6.180.0300.05020.61
5.6.170.0230.05720.50
5.6.160.0170.06020.51
5.6.150.0070.05318.16
5.6.140.0030.04718.08
5.6.130.0030.09018.20
5.6.120.0030.04320.99
5.6.110.0100.06321.14
5.6.100.0000.05020.89
5.6.90.0070.08021.00
5.6.80.0300.06320.39
5.5.350.0230.07020.41
5.5.340.0070.04017.89
5.5.330.0000.08320.19
5.5.320.0100.04320.13
5.5.310.0270.08720.24
5.5.300.0000.07018.01
5.5.290.0130.07317.88
5.5.280.0000.06720.98
5.5.270.0070.06020.95
5.5.260.0130.05720.85
5.5.250.0070.08720.70
5.5.240.0030.08720.27
5.4.450.0530.05719.50
5.4.440.0600.06019.55
5.4.430.0230.05319.54
5.4.420.0130.06019.59
5.4.410.0230.06019.04
5.4.400.0200.05319.09
5.4.390.0230.05319.26
5.4.380.0230.05319.15
5.4.370.0230.05019.18
5.4.360.0230.05319.19
5.4.350.0230.05318.90
5.4.340.0270.05319.34
5.4.320.0330.05019.21
5.4.310.0330.04318.82
5.4.300.0330.04719.18
5.4.290.0270.05019.34
5.4.280.0300.05018.90
5.4.270.0230.05319.09
5.4.260.0230.05319.11
5.4.250.0270.05318.92
5.4.240.0300.06719.20
5.4.230.0270.05019.18
5.4.220.0300.07319.12
5.4.210.0200.05019.14
5.4.200.0270.04316.49
5.4.190.0200.05318.87
5.4.180.0270.06718.90
5.4.170.0270.04718.95
5.4.160.0200.05718.96
5.4.150.0100.07318.90
5.4.140.0430.05316.43
5.4.130.0230.05716.22
5.4.120.0130.05716.62
5.4.110.0230.04316.55
5.4.100.0270.04316.22
5.4.90.0270.04316.54
5.4.80.0170.05316.52
5.4.70.0270.04316.41
5.4.60.0200.04716.48
5.4.50.0130.05016.52
5.4.40.0170.05016.53
5.4.30.0170.05016.47
5.4.20.0300.04016.33
5.4.10.0130.05316.46
5.4.00.0170.05015.92
5.3.290.0200.05314.51
5.3.280.0170.05314.54
5.3.270.0030.07014.49
5.3.260.0230.05014.62
5.3.250.0200.05314.55
5.3.240.0270.04314.49
5.3.230.0200.05014.50
5.3.220.0170.05314.52
5.3.210.0200.05314.45
5.3.200.0300.04014.63
5.3.190.0130.05714.54
5.3.180.0300.04314.49
5.3.170.0330.03714.49
5.3.160.0200.06014.51
5.3.150.0070.06314.58
5.3.140.0170.05014.43
5.3.130.0200.05314.40
5.3.120.0200.05314.42
5.3.110.0170.05714.50
5.3.100.0100.05714.03
5.3.90.0130.05314.07
5.3.80.0130.05714.06
5.3.70.0200.04713.88
5.3.60.0230.04713.90
5.3.50.0300.03713.90
5.3.40.0230.07713.96
5.3.30.0200.04713.71
5.3.20.0300.03713.74
5.3.10.0200.04713.70
5.3.00.0270.04013.60
5.2.170.0100.04311.00
5.2.160.0170.03711.21
5.2.150.0170.03710.95
5.2.140.0330.04011.16
5.2.130.0100.04310.98
5.2.120.0170.03711.11
5.2.110.0170.03711.19
5.2.100.0130.06011.02
5.2.90.0100.04310.95
5.2.80.0270.04710.90
5.2.70.0170.04310.96
5.2.60.0130.04310.90
5.2.50.0000.04710.97
5.2.40.0000.04710.84
5.2.30.0100.04010.93
5.2.20.0070.04310.97
5.2.10.0200.03310.79
5.2.00.0100.04310.75
5.1.60.0170.03310.00
5.1.50.0170.0309.93
5.1.40.0200.0239.87
5.1.30.0130.03310.20
5.1.20.0130.03310.43
5.1.10.0130.0339.99
5.1.00.0030.0439.96
5.0.50.0100.0278.57
5.0.40.0100.0238.43
5.0.30.0070.0438.14
5.0.20.0100.0278.10
5.0.10.0100.0278.27
5.0.00.0100.0538.27
4.4.90.0030.0375.84
4.4.80.0100.0305.81
4.4.70.0070.0335.78
4.4.60.0030.0305.92
4.4.50.0070.0175.84
4.4.40.0100.0305.89
4.4.30.0000.0275.88
4.4.20.0070.0205.82
4.4.10.0030.0235.95
4.4.00.0030.0375.95
4.3.110.0030.0235.78
4.3.100.0000.0235.71
4.3.90.0030.0235.76
4.3.80.0030.0375.71
4.3.70.0030.0235.66
4.3.60.0070.0205.79
4.3.50.0030.0235.75
4.3.40.0070.0335.77
4.3.30.0070.0204.60
4.3.20.0030.0234.54
4.3.10.0000.0274.36
4.3.00.0030.0237.13

preferences:
54.02 ms | 401 KiB | 5 Q