3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attachments = [ [ "year" => 2018, "id" => 14689 ], [ "year" => 2017, "id" => 14690 ], [ "year" => 2018, "id" => 14688 ], [ "year" => 2018, "id" => 14687 ] ]; usort($attachments, function ($first, $second) { return $first["year"] < $second["year"]; }); print_r($attachments);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
153.66 ms | 2701 KiB | 12 Q