3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'code' => 'Custom discount', 'amount' => 3514.55, 'type' => 'fixed_amount' ], [ 'code' => 'MerOrder300', 'amount' => 400.00, 'type' => 'fixed_amount' ], [ 'code' => 'MerOrder400', 'amount' => 3514.55, 'type' => 'fixed_amount' ], [ 'code' => 'MerOrder450', 'amount' => 450.00, 'type' => 'fixed_amount' ] ]; $max = max( array_column($array, 'amount') ); var_export( array_filter( $array, function($subarray) use ($max) { return $subarray['amount'] == $max; } ) );

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
221.61 ms | 2152 KiB | 12 Q