3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $total = array(); $total[] = array( "id" => 1, "account" => "hello world", "item" => "package", "quantity" => 10 ); $total[] = array( "id" => 2, "account" => "foo", "item" => "world", "quantity" => 100 ); $maxtotal; foreach ($total as $key => $value) { // $value is an array() with id, account, item, quantity $maxtotal = array_search( max($value), $value); // doesn't work } print_r( $maxtotal ); // should print out the array with id=2
Output for 5.1.1 - 7.1.0
quantity
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/HqtrL on line 23
Process exited with code 255.
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: maxtotal in /in/HqtrL on line 17 quantity
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: maxtotal in /in/HqtrL on line 17 quantity