3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ 'owner' => [ 'table' => 'owner', 'cols' => [ 'name' => 'Name', 'address' => [ 'table' => 'Address', 'cols' => [ 'line1' => 'Street Line 1', 'line2' => 'Street Line 2', 'city' => 'City', 'state' => [ 'table' => 'State', 'cols' => [ 'stateName' => 'State' ] ], 'postal_code' => 'Postal Code', ] ] ] ], 'renter' => [ 'table' => 'renter', 'cols' => [ 'name' => 'Name', 'address' => [ 'table' => 'Address', 'cols' => [ 'line1' => 'Street Line 1', 'line2' => 'Street Line 2', 'city' => 'City', 'state' => [ 'table' => 'State', 'cols' => [ 'stateName' => 'State' ] ], 'postal_code' => 'Postal Code', ] ] ] ] ]; function flatten(array $a, string $path = '') { if (isset($a['cols'])) { return flatten($a['cols'], $path); } $pairs = []; foreach ($a as $k => $v) { $p = empty($path) ? $k : "{$path}.{$k}"; if (is_array($v)) { array_push($pairs, ...flatten($v, $p)); } else { $pairs[] = ["key" => $p, "label" => $v]; } } return $pairs; } var_dump(flatten($a)); /* [ [ 'key' => 'owner.name', 'label' => 'Name' ], [ 'key' => 'owner.address.line1', 'label' => 'Street Line 1' ], [ 'key' => 'owner.address.line2', 'label' => 'Street Line 2' ], [ 'key' => 'owner.address.city', 'label' => 'City' ], [ 'key' => 'owner.address.state.stateName', 'label' => 'State' ], [ 'key' => 'owner.address.postal_code', 'label' => 'Postal Code' ], ] */

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.00618.53
8.3.50.0120.00918.18
8.3.40.0130.00319.02
8.3.30.0040.01118.71
8.3.20.0050.00321.69
8.3.10.0060.00923.66
8.3.00.0040.00423.39
8.2.180.0030.01316.63
8.2.170.0090.00622.96
8.2.160.0070.00720.02
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0080.00018.09
8.2.120.0080.00026.35
8.2.110.0080.00319.19
8.2.100.0040.00717.78
8.2.90.0060.00318.41
8.2.80.0040.00417.97
8.2.70.0090.00018.04
8.2.60.0090.00018.16
8.2.50.0050.00318.10
8.2.40.0040.00419.48
8.2.30.0040.00419.42
8.2.20.0020.00518.05
8.2.10.0000.00719.34
8.2.00.0040.00419.32
8.1.280.0130.00625.92
8.1.270.0060.00319.05
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0030.00619.21
8.1.230.0040.00720.87
8.1.220.0040.00417.74
8.1.210.0030.00618.90
8.1.200.0040.00417.35
8.1.190.0030.01017.35
8.1.180.0060.00318.10
8.1.170.0040.00418.50
8.1.160.0070.00018.82
8.1.150.0050.00218.92
8.1.140.0090.00020.78
8.1.130.0030.00320.13
8.1.120.0080.00017.48
8.1.110.0050.00317.47
8.1.100.0060.00317.37
8.1.90.0040.00417.38
8.1.80.0040.00417.46
8.1.70.0070.00017.46
8.1.60.0040.00417.53
8.1.50.0040.00417.56
8.1.40.0040.00817.48
8.1.30.0080.00017.65
8.1.20.0060.00317.56
8.1.10.0090.00317.64
8.1.00.0040.00417.52
8.0.300.0040.00419.93
8.0.290.0070.00016.75
8.0.280.0050.00318.46
8.0.270.0030.00517.33
8.0.260.0030.00718.51
8.0.250.0000.00716.99
8.0.240.0040.00416.90
8.0.230.0050.00216.93
8.0.220.0070.00016.88
8.0.210.0000.00816.91
8.0.200.0000.00817.03
8.0.190.0050.00217.04
8.0.180.0000.00816.95
8.0.170.0050.00516.93
8.0.160.0030.00516.93
8.0.150.0040.00416.92
8.0.140.0000.00716.84
8.0.130.0060.00013.38
8.0.120.0040.00416.76
8.0.110.0030.00616.83
8.0.100.0040.00416.78
8.0.90.0030.00516.91
8.0.80.0060.01116.88
8.0.70.0040.00416.85
8.0.60.0000.00716.74
8.0.50.0000.00716.74
8.0.30.0110.01117.02
8.0.20.0140.01417.40
8.0.10.0050.00317.08
8.0.00.0160.00816.56
7.4.330.0050.00015.55
7.4.320.0000.00616.45
7.4.300.0000.00616.68
7.4.290.0060.00316.53
7.4.280.0040.00416.61
7.4.270.0000.00716.54
7.4.260.0000.00716.55
7.4.250.0050.00516.45
7.4.240.0040.00416.45
7.4.230.0040.00416.72
7.4.220.0050.00316.69
7.4.210.0060.01216.56
7.4.200.0030.00516.72
7.4.160.0080.00916.62
7.4.140.0110.00817.86
7.4.130.0120.00616.52
7.4.120.0080.01116.54
7.4.110.0110.01416.53
7.4.100.0090.01516.59
7.4.90.0110.00816.35
7.4.80.0070.01719.39
7.4.70.0120.00616.59
7.4.60.0100.00916.52
7.4.50.0110.00316.38
7.4.40.0000.01816.40
7.4.10.0110.00714.92
7.4.00.0080.01015.06
7.3.330.0050.00013.40
7.3.320.0060.00013.40
7.3.310.0050.00316.43
7.3.300.0000.00716.41
7.3.290.0030.00316.27
7.3.280.0100.00816.39
7.3.260.0120.00816.44
7.3.240.0110.01116.45
7.3.230.0110.00716.55
7.3.210.0040.01416.34
7.3.200.0130.00716.72
7.3.190.0170.00716.41
7.3.180.0130.00516.45
7.3.170.0100.01016.41
7.3.160.0100.01016.39
7.3.130.0100.01014.78
7.3.120.0030.01014.82
7.3.110.0070.01114.73
7.3.100.0080.00614.77
7.3.90.0070.00715.05
7.3.80.0060.00614.63
7.3.70.0050.00614.79
7.3.60.0070.01014.87
7.3.50.0080.00914.89
7.3.40.0090.00714.90
7.3.30.0070.00914.70
7.3.20.0030.01216.69
7.3.10.0200.00415.91
7.3.00.0330.00216.07
7.2.330.0110.00716.59
7.2.320.0100.00716.34
7.2.310.0140.00816.72
7.2.300.0130.00616.51
7.2.290.0140.00316.60
7.2.260.0030.01614.94
7.2.250.0090.00915.06
7.2.240.0080.01015.20
7.2.230.0090.00615.08
7.2.220.0050.01115.16
7.2.210.0080.00515.12
7.2.200.0070.00715.05
7.2.190.0080.00814.92
7.2.180.0070.00715.05
7.2.170.0050.00715.14
7.2.160.0070.00714.94
7.2.150.0100.00617.05
7.2.140.0080.00817.01
7.2.130.0290.01116.18
7.2.120.0220.01016.21
7.2.110.0250.00816.20
7.2.100.0290.01016.26
7.2.90.0240.00516.26
7.2.80.0240.00516.28
7.2.70.0260.00516.29
7.2.60.0210.00916.27
7.2.50.0290.00816.29
7.2.40.0300.00416.30
7.2.30.0500.00516.21
7.2.20.0230.00916.43
7.2.10.0240.01116.05
7.2.00.0210.00916.28
7.1.330.0070.00615.70
7.1.320.0050.00715.89
7.1.310.0020.01315.79
7.1.300.0070.00715.84
7.1.290.0050.00815.89
7.1.280.0070.00515.81
7.1.270.0070.00815.69
7.1.260.0070.00615.81
7.1.250.0250.01015.17
7.1.240.0070.00716.01
7.1.230.0090.00015.89
7.1.220.0090.00615.96
7.1.210.0040.01115.80
7.1.200.0110.00015.80
7.1.190.0120.00315.93
7.1.180.0040.00815.79
7.1.170.0110.00415.62
7.1.160.0080.00415.83
7.1.150.0060.00915.82
7.1.140.0030.01015.94
7.1.130.0060.00315.85
7.1.120.0030.00815.94
7.1.110.0060.00615.89
7.1.100.0120.00015.56
7.1.90.0060.00315.83
7.1.80.0150.00015.86
7.1.70.0040.00515.73
7.1.60.0000.01415.82
7.1.50.0070.00715.67
7.1.40.0030.01015.68
7.1.30.0080.00015.86
7.1.20.0070.00715.68
7.1.10.0090.00615.78
7.1.00.0060.00915.75

preferences:
70.36 ms | 401 KiB | 5 Q