3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar = Array ( 0 => Array ( 'name' => "The 5th Wave", 'releaseDate' => '2016-01-22', 'dates' => Array ( 'date' => Array ( 0 => '2016-01-27', 1 => '2016-01-26' ) ) ), 1 => Array ( 'name' => 'Dirty Grandpa', 'releaseDate' => '2016-01-21', 'dates' => Array ( 'date' => Array ( 0 => '2016-01-27', 1 => '2016-01-26' ) ) ), 2 => Array ( 'name' => 'The Revenant', 'releaseDate' => '2016-01-14', 'dates' => Array ( 'date' => Array ( 0 => '2016-01-27', 1 => '2016-01-26' ) ) ) ); print_r($ar); echo "================Sort============="; $uasort($ar, function($a, $b){ if( end($array['dates']['date']) < $array['releaseDate'] OR end($a['dates']['date']) > date("Y-m-d", strtotime('next thursday')) ){ return -1; } else{ return 0; } }); print_r($ar);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [name] => The 5th Wave [releaseDate] => 2016-01-22 [dates] => Array ( [date] => Array ( [0] => 2016-01-27 [1] => 2016-01-26 ) ) ) [1] => Array ( [name] => Dirty Grandpa [releaseDate] => 2016-01-21 [dates] => Array ( [date] => Array ( [0] => 2016-01-27 [1] => 2016-01-26 ) ) ) [2] => Array ( [name] => The Revenant [releaseDate] => 2016-01-14 [dates] => Array ( [date] => Array ( [0] => 2016-01-27 [1] => 2016-01-26 ) ) ) ) ================Sort============= Warning: Undefined variable $uasort in /in/WcbXT on line 54 Fatal error: Uncaught Error: Value of type null is not callable in /in/WcbXT:54 Stack trace: #0 {main} thrown in /in/WcbXT on line 54
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:
47.05 ms | 403 KiB | 8 Q