3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr=array( array('amount'=>100,'date'=>'2014-03-29'), array('amount'=>120,'date'=>'2014-03-30'), array('amount'=>200,'date'=>'2014-03-31'), array('amount'=>0,'date'=>'2014-04-31') ); function sd($a,$b) {if($a['date'] == $b['date']) return 0; return $a['date'] >$b['date'] ? 1 : -1; usort($arr, 'sd'); $amount = 0; foreach($arr as &$item) { $amount += $item['amount']; $item['amount'] = $amount; }print_r($arr);
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected end of file in /in/uvB1M on line 17
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end in /in/uvB1M on line 17
Process exited with code 255.