3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = Array ( 0 => Array ( 0 => 'Max tide', 'marks_obt' => Array ( '0' => 2.00, '1' => 5.00 ), 'passing_marks' => Array ( '0' => 3.00, '1' => 3.00 ) ), 1 => Array ( 0 => 'David pixal', 'marks_obt' => Array ( '0' => 5.00, '1' => 5.00 ), 'passing_marks' => Array ( '0' => 3.00, '1' => 3.00 ) ) ); $finalOutput = array(); foreach ($data as $key => $value) { $innerArray = array(); $innerArray[] = array('data'=>$value[0],'style'=> 'background-color: red; text-align: center'); foreach($value['marks_obt'] as $k=>$v){ if( isset($value['passing_marks'][$k]) && $v > $value['passing_marks'][$k] ){ $innerArray[] = array('data'=>$v,'style'=> 'background-color: pink; text-align: center'); }else{ $innerArray[] = array('data'=>$v,'style'=> 'background-color: red; text-align: center'); } } $finalOutput[] = array('data'=> $innerArray); } print_r($finalOutput);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [data] => Array ( [0] => Array ( [data] => Max tide [style] => background-color: red; text-align: center ) [1] => Array ( [data] => 2 [style] => background-color: red; text-align: center ) [2] => Array ( [data] => 5 [style] => background-color: pink; text-align: center ) ) ) [1] => Array ( [data] => Array ( [0] => Array ( [data] => David pixal [style] => background-color: red; text-align: center ) [1] => Array ( [data] => 5 [style] => background-color: pink; text-align: center ) [2] => Array ( [data] => 5 [style] => background-color: pink; text-align: center ) ) ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
35.23 ms | 409 KiB | 5 Q