3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function cmp($a, $b) { if($a->date == $b->date) { return 0; } return ($a->date < $b->date) ? -1 : 1; } $images = array(); $i1 = new ImageMetadata("2", "3", "3"); $i2 = new ImageMetadata("2", "1", "3"); $i3 = new ImageMetadata("2", "2", "3"); array_push($images, $i1); array_push($images, $i2); array_push($images, $i3); usort($images, "cmp"); echo json_encode($images); ?>
based on kIYHW
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Class 'ImageMetadata' not found in /in/KoXif:13 Stack trace: #0 {main} thrown in /in/KoXif on line 13
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Fatal error: Class 'ImageMetadata' not found in /in/KoXif on line 13
Process exited with code 255.