3v4l.org

run code in 300+ PHP versions simultaneously
<?php $db_rows = [ ['id' => 1, 'title' => 'test', 'number' => 2, 'desc' => 'test'], ['id' => 2, 'title' => 'test2', 'number' => 3, 'desc' => 'test2'], ['id' => 3, 'title' => 'test3', 'number' => 1, 'desc' => 'test3'], ]; $clone_db_rows = []; foreach( $db_rows as $key => $value ) { $clone_db_rows = array_merge( $clone_db_rows, // Merge the current array with... array_fill( // ...a newly created containing... 0, $value['number'], // ... X items equals to... $value // ... $value. ) ); } print_r($clone_db_rows);

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.140.0140.00717.53
8.4.130.0090.00417.41
8.4.120.0060.00220.31
8.4.110.0130.00622.45
8.4.100.0130.00917.84
8.4.90.0110.01022.21
8.4.80.0110.01017.75
8.4.70.0100.01118.06
8.4.60.0110.00718.59
8.4.50.0150.00617.82
8.4.40.0100.00619.31
8.4.30.0060.00318.74
8.4.20.0100.01020.62
8.4.10.0040.00419.49
8.3.270.0120.00716.61
8.3.260.0090.01016.70
8.3.250.0120.00818.75
8.3.240.0110.00919.05
8.3.230.0140.00616.65
8.3.220.0040.00418.86
8.3.210.0050.00516.63
8.3.200.0040.00516.41
8.3.190.0130.00717.14
8.3.180.0150.00316.84
8.3.170.0040.00418.94
8.3.160.0110.01118.38
8.3.150.0140.00418.93
8.3.140.0060.00918.26
8.3.130.0080.00016.49
8.3.120.0090.00619.03
8.3.110.0030.00516.62
8.3.100.0040.00424.06
8.3.90.0040.01426.77
8.3.80.0060.00318.33
8.3.70.0100.00718.55
8.3.60.0120.00318.41
8.3.50.0140.00317.29
8.3.40.0060.01018.70
8.3.30.0040.01118.58
8.3.20.0000.00921.88
8.3.10.0080.00021.85
8.3.00.0050.00223.40
8.2.290.0090.01020.33
8.2.280.0090.00522.26
8.2.270.0000.01417.38
8.2.260.0090.00916.37
8.2.250.0040.00416.54
8.2.240.0090.00617.42
8.2.230.0030.00620.94
8.2.220.0090.00037.54
8.2.210.0110.00326.77
8.2.200.0000.00818.29
8.2.190.0090.01218.29
8.2.180.0040.01816.50
8.2.170.0070.01018.66
8.2.160.0070.01322.96
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0070.00026.16
8.2.110.0070.00421.04
8.2.100.0040.00818.03
8.2.90.0000.00819.14
8.2.80.0080.00417.97
8.2.70.0030.00517.75
8.2.60.0060.00318.05
8.2.50.0000.00818.07
8.2.40.0030.00618.10
8.2.30.0030.00718.13
8.2.20.0040.00418.18
8.2.10.0060.00718.85
8.2.00.0070.00019.19
8.1.330.0110.00823.57
8.1.320.0160.00516.03
8.1.310.0190.00016.99
8.1.300.0100.00618.53
8.1.290.0060.00318.88
8.1.280.0140.00725.92
8.1.270.0040.00422.41
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0030.00622.81
8.1.230.0070.00417.77
8.1.220.0060.00317.74
8.1.210.0000.00818.77
8.1.200.0080.00017.22
8.1.190.0070.00417.23
8.1.180.0030.00518.10
8.1.170.0040.00418.34
8.1.160.0040.00418.94
8.1.150.0000.00718.63
8.1.140.0000.00718.89
8.1.130.0040.00420.14
8.1.120.0000.00717.50
8.1.110.0040.00417.44
8.1.100.0050.00217.49
8.1.90.0000.00817.36
8.1.80.0040.00417.51
8.1.70.0000.00717.43
8.1.60.0000.00817.60
8.1.50.0040.00417.43
8.1.40.0030.00517.45
8.1.30.0040.00417.54
8.1.20.0080.00017.59
8.1.10.0040.00417.59
8.1.00.0040.00417.45
8.0.300.0040.00418.77
8.0.290.0000.00916.63
8.0.280.0030.00318.42
8.0.270.0030.00316.75
8.0.260.0030.00318.50
8.0.250.0040.00416.96
8.0.240.0000.00716.99
8.0.230.0000.00716.95
8.0.220.0030.00316.92
8.0.210.0000.00816.96
8.0.200.0040.00416.93
8.0.190.0070.00016.95
8.0.180.0050.00316.89
8.0.170.0110.00016.91
8.0.160.0000.00716.86
8.0.150.0030.00316.75
8.0.140.0000.00716.84
8.0.130.0000.00613.32
8.0.120.0070.00016.76
8.0.110.0050.00316.94
8.0.100.0040.00416.93
8.0.90.0040.00416.79
8.0.80.0090.01216.94
8.0.70.0040.00416.74
8.0.60.0070.00017.01
8.0.50.0000.00716.96
8.0.30.0110.00517.06
8.0.20.0090.01117.17
8.0.10.0050.00317.08
8.0.00.0170.00416.79
7.4.330.0000.00515.55
7.4.320.0030.00316.60
7.4.300.0060.00016.45
7.4.290.0070.00016.60
7.4.280.0080.00016.51
7.4.270.0070.00016.66
7.4.260.0030.00316.52
7.4.250.0030.00316.57
7.4.240.0020.00516.47
7.4.230.0030.00316.68
7.4.220.0000.00816.59
7.4.210.0080.00616.55
7.4.200.0000.00716.32
7.4.160.0080.00816.53
7.4.140.0080.00817.86
7.4.130.0140.01016.41
7.4.120.0100.01416.52
7.4.110.0110.00716.55
7.4.100.0030.01316.64
7.4.90.0080.01316.70
7.4.80.0110.01019.39
7.4.70.0070.01016.49
7.4.60.0100.00616.34
7.4.50.0070.00716.52
7.4.40.0070.01016.44
7.4.00.0070.00914.78
7.3.330.0000.00513.27
7.3.320.0030.00313.27
7.3.310.0000.00716.37
7.3.300.0040.00416.37
7.3.290.0060.00016.17
7.3.280.0090.00716.22
7.3.260.0130.00616.39
7.3.230.0030.01316.36
7.3.210.0180.00016.65
7.3.200.0070.00916.31
7.3.190.0120.00416.36
7.3.180.0120.00416.27
7.3.170.0110.00416.34
7.3.160.0120.00316.37
7.3.120.0070.01114.98
7.3.110.0060.01314.62
7.3.100.0140.00014.71
7.3.90.0140.00714.76
7.3.80.0000.01314.77
7.3.70.0080.00614.96
7.3.60.0070.01214.63
7.3.50.0120.00314.78
7.3.40.0110.00614.85
7.3.30.0040.00914.76
7.3.20.0110.00615.73
7.3.10.0100.00715.54
7.3.00.0130.00815.70
7.2.330.0080.00816.86
7.2.320.0120.00616.77
7.2.310.0060.01016.84
7.2.300.0090.00816.76
7.2.290.0090.00616.70
7.2.250.0100.01015.05
7.2.240.0000.01615.18
7.2.230.0110.01114.94
7.2.220.0080.00414.84
7.2.210.0110.00415.13
7.2.200.0080.00815.30
7.2.190.0100.00514.92
7.2.180.0060.01215.06
7.2.170.0030.01414.96
7.2.160.0090.01315.00
7.2.150.0150.00615.19
7.2.140.0110.00815.09
7.2.130.0070.01315.18
7.2.120.0120.00915.16
7.2.110.0180.01215.07
7.2.100.0060.01315.06
7.2.90.0150.00314.91
7.2.80.0160.00615.18
7.2.70.0180.00814.91
7.2.60.0100.01015.18
7.2.50.0180.00715.11
7.2.40.0710.00315.18
7.2.30.0180.00915.10
7.2.20.0100.00715.11
7.2.10.0180.00615.11
7.2.00.0210.00715.26
7.1.330.0060.00915.81
7.1.320.0060.00615.78
7.1.310.0090.00315.84
7.1.300.0100.00314.94
7.1.290.0030.01115.03
7.1.280.0100.00814.74
7.1.270.0120.01014.96
7.1.260.0080.00815.00
7.1.250.0200.00613.98

preferences:
37.21 ms | 403 KiB | 5 Q