3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ ['Out Of Warranty', 'Total Orders', 'Total Qty', 'Canceled Orders'], ['Today<br/>(04-26-2020)', 1, 1, 0], ['Yesterday<br/>(04-25-2020)', 0, 0, 0], ['This Week<br/>(04-20-2020 - 04-26-2020)', 22, 39, 0], ['Last Week<br/>(04-13-2020 - 04-19-2020)', 7, 7, 0], ['This Month<br/>(04-01-2020 - 04-26-2020)', 29, 46, 0], ['This Year<br/>(01-01-2020 - 04-26-2020)', 30, 47, 0], ]; $array2 = [ ['Out Of Warranty', 'Total Orders', 'Total Qty', 'Canceled Orders'], ['Today<br/>(04-24-2020)', 10, 10, 0], ['Yesterday<br/>(04-23-2020)', 7, 7, 0], ['This Week<br/>(04-20-2020 - 04-24-2020)', 51, 51, 0], ['Last Week<br/>(04-13-2020 - 04-19-2020)', 31, 31, 0], ['This Month<br/>(04-01-2020 - 04-24-2020)', 93, 93, 0], ['This Year<br/>(01-01-2020 - 04-24-2020)', 1281, 1281, 1], ]; for ($i = 1, $size = count($array2); $i < $size; ++$i) { for ($col = 1; $col <= 3; ++$col) { $array1[$i][$col] += $array2[$i][$col]; } } var_export($array1);
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0 - 8.5.1
array ( 0 => array ( 0 => 'Out Of Warranty', 1 => 'Total Orders', 2 => 'Total Qty', 3 => 'Canceled Orders', ), 1 => array ( 0 => 'Today<br/>(04-26-2020)', 1 => 11, 2 => 11, 3 => 0, ), 2 => array ( 0 => 'Yesterday<br/>(04-25-2020)', 1 => 7, 2 => 7, 3 => 0, ), 3 => array ( 0 => 'This Week<br/>(04-20-2020 - 04-26-2020)', 1 => 73, 2 => 90, 3 => 0, ), 4 => array ( 0 => 'Last Week<br/>(04-13-2020 - 04-19-2020)', 1 => 38, 2 => 38, 3 => 0, ), 5 => array ( 0 => 'This Month<br/>(04-01-2020 - 04-26-2020)', 1 => 122, 2 => 139, 3 => 0, ), 6 => array ( 0 => 'This Year<br/>(01-01-2020 - 04-26-2020)', 1 => 1311, 2 => 1328, 3 => 1, ), )
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
207.53 ms | 408 KiB | 5 Q