3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tz = new DateTimeZone('America/New_York'); $date_ranges = array( '7 Days Ago' => array( 'from' => new DateTime('7 days ago 00:00:00', $tz), 'to' => new DateTime('yesterday 23:59:59', $tz) ), 'Yesterday' => array( 'from' => new DateTime('yesterday 00:00:00', $tz), 'to' => new DateTime('yesterday 23:59:59', $tz) ), '30 Days Ago' => array( 'from' => new DateTime('30 days ago 00:00:00', $tz), 'to' => new DateTime('yesterday 23:59:59', $tz) ) ); usort($myArray, function($a, $b) { return $a['from']->getTimestamp() - $b['from']->getTimestamp(); }); print_r($date_ranges);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: usort(): Argument #1 ($array) must be of type array, null given in /in/CrUN7:17 Stack trace: #0 /in/CrUN7(17): usort(NULL, Object(Closure)) #1 {main} thrown in /in/CrUN7 on line 17
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
53.81 ms | 401 KiB | 8 Q