3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( 0 => array( 0 => '', 1 => 'Man', 2 => '<p class=" td26">', 3 => '<p class=" td26">', 4 => '<p class=" td26">', 5 => 'Mining'), 1 => array ( 0 => '', 1 => 'Abc', 2 => '<p class="tr1 td26"><p class=" td26">', 3 => 'Ahsan', 4 => '<p class="tr1 td26"><p class=" td26">', 5 => 'mm', 6 => '<p class="tr1 td26"><p class=" td26">', 7 => 'oo', 8 => '<p class="tr1 td26"><p class=" td26">', 9 => 'kk', 10 => '<p class="tr1 td26"><p class=" td26">'), 2 => array ( 0 => 'Fical', 1 => '2005-06', 2 => '2006-07', 3 => '2007-08', 4 => '2008-09', 5 => '2009-10', 6 => '2010-11', 7 => '2011-12', 8 => '2012-13', 9 => 'Change', 10 => 'Change2' ) ); foreach ($d as $k => $v) { if (($v == '') && ($k !== 0)) { $d[$k] .= "\n<p class=\" td26\">"; $d[$k - 1] .= "<p class=\"tr3 td26\">"; // K-1 for previous index } } foreach ($g as $k => $v) { if (($v == '') && ($k !== 0)) { $g[$k] .= "<p class=\" td26\">"; //$g[$k-1].="<p class=\" td26\">" ; } }
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: d in /in/3muGi on line 41 Warning: Invalid argument supplied for foreach() in /in/3muGi on line 41 Notice: Undefined variable: g in /in/3muGi on line 48 Warning: Invalid argument supplied for foreach() in /in/3muGi on line 48
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: d in /in/3muGi on line 47 Warning: Invalid argument supplied for foreach() in /in/3muGi on line 47 Notice: Undefined variable: g in /in/3muGi on line 53 Warning: Invalid argument supplied for foreach() in /in/3muGi on line 53
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.0.5
Warning: Invalid argument supplied for foreach() in /in/3muGi on line 41 Warning: Invalid argument supplied for foreach() in /in/3muGi on line 48
Output for 4.3.11