3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array( "h1_serial_number" => array('SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1','SERIAL_NUMBER_RACK_1'), "h2_serial_number" => array('SERIAL_NUMBER_SYSTEM_1','SERIAL_NUMBER_SYSTEM_1','SERIAL_NUMBER_SYSTEM_1','SERIAL_NUMBER_SYSTEM_1','SERIAL_NUMBER_SYSTEM_1','SERIAL_NUMBER_SYSTEM_1','SERIAL_NUMBER_SYSTEM_1','SERIAL_NUMBER_SYSTEM_1','SERIAL_NUMBER_SYSTEM_2','SERIAL_NUMBER_SYSTEM_2','SERIAL_NUMBER_SYSTEM_2','SERIAL_NUMBER_SYSTEM_2','SERIAL_NUMBER_SYSTEM_2','SERIAL_NUMBER_SYSTEM_2','SERIAL_NUMBER_SYSTEM_2','SERIAL_NUMBER_SYSTEM_2','SERIAL_NUMBER_SYSTEM_2','SERIAL_NUMBER_SYSTEM_2','SERIAL_NUMBER_SYSTEM_2','SERIAL_NUMBER_SYSTEM_2','SERIAL_NUMBER_SYSTEM_2','SERIAL_NUMBER_SYSTEM_3','SERIAL_NUMBER_SYSTEM_3','SERIAL_NUMBER_SYSTEM_3','SERIAL_NUMBER_SYSTEM_3','SERIAL_NUMBER_SYSTEM_3','SERIAL_NUMBER_SYSTEM_3','SERIAL_NUMBER_SYSTEM_3','SERIAL_NUMBER_SYSTEM_3'), "h3_serial_number" => array('SERIAL_NUMBER_COMPONENT_1','SERIAL_NUMBER_COMPONENT_1','SERIAL_NUMBER_COMPONENT_1','SERIAL_NUMBER_COMPONENT_1','SERIAL_NUMBER_COMPONENT_2','SERIAL_NUMBER_COMPONENT_2','SERIAL_NUMBER_COMPONENT_2','SERIAL_NUMBER_COMPONENT_2','SERIAL_NUMBER_COMPONENT_3','SERIAL_NUMBER_COMPONENT_3','SERIAL_NUMBER_COMPONENT_3','SERIAL_NUMBER_COMPONENT_3','SERIAL_NUMBER_COMPONENT_3','SERIAL_NUMBER_COMPONENT_3','SERIAL_NUMBER_COMPONENT_3','SERIAL_NUMBER_COMPONENT_4','SERIAL_NUMBER_COMPONENT_4','SERIAL_NUMBER_COMPONENT_4','SERIAL_NUMBER_COMPONENT_4','SERIAL_NUMBER_COMPONENT_4','SERIAL_NUMBER_COMPONENT_4','SERIAL_NUMBER_COMPONENT_5','SERIAL_NUMBER_COMPONENT_5','SERIAL_NUMBER_COMPONENT_5','SERIAL_NUMBER_COMPONENT_5','SERIAL_NUMBER_COMPONENT_5','SERIAL_NUMBER_COMPONENT_6','SERIAL_NUMBER_COMPONENT_6','SERIAL_NUMBER_COMPONENT_6'), "h4_serial_number" => array('NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','SERIAL_NUMBER_PCBA_1','SERIAL_NUMBER_PCBA_1','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL'), "h1_earliest_test_date" => array('2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01','2017-12-01'), "h2_earliest_test_date" =>array('2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01','2017-11-01'), "h3_earliest_test_date" => array('2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01'), "h4_earliest_test_date" =>array('2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01','2017-10-01'), "h1_latest_test_date" =>array('2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30','2017-12-30'), "h2_latest_test_date" => array('2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30','2017-11-30'), "h3_latest_test_date" =>array('2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30'), "h4_latest_test_date" =>array('2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30','2017-10-30') ); $max = sizeof($array['h1_serial_number']); $globalArray = array(); for ($i = 0; $i < $max; $i++) { $rowArray = array( 'h1_serial_number' => $array['h1_serial_number'][$i], 'h2_serial_number' => $array['h2_serial_number'][$i], 'h3_serial_number' => $array['h3_serial_number'][$i], 'h4_serial_number' => $array['h4_serial_number'][$i], 'h1_earliest_test_date' => $array['h1_earliest_test_date'][$i], 'h1_latest_test_date' => $array['h1_latest_test_date'][$i], 'h2_earliest_test_date' => $array['h2_earliest_test_date'][$i], 'h2_latest_test_date' => $array['h2_latest_test_date'][$i], 'h3_earliest_test_date' => $array['h3_earliest_test_date'][$i], 'h3_latest_test_date' => $array['h3_latest_test_date'][$i], 'h4_earliest_test_date' => $array['h4_earliest_test_date'][$i], 'h4_latest_test_date' => $array['h4_latest_test_date'][$i] ); array_push($globalArray, $rowArray); } //var_dump($globalArray); foreach ( $globalArray as $key=>$val ){ print $val; /*foreach ( $val as $value){ print "$value \n"; }*/ } //echo json_encode($array, JSON_PRETTY_PRINT); ?>
based on 00BW6
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0beta1
Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array
Output for hhvm-3.22.0
Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 Array Notice: Array to string conversion in /in/NXquA on line -1 ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray
Output for hhvm-3.18.5 - 3.21.3
Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 Array Notice: Array to string conversion in /in/NXquA on line 39 ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray