3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = '{"id":41,"userId":9,"description":null,"updated_by":"Juan Dela Cruz","created_at":"2019-09-18 10:07:34","updated_at":"2019-09-18 10:07:34"}'; $b = '{"id":2,"userId":9,"description":null,"updated_by":null,"created_at":"2019-09-16 12:46:56","updated_at":"2019-09-16 12:46:56"}'; $arr1 = json_decode($a, true); $key1 = strtotime($arr1['created_at']); $arr[$key1] = $arr1; $arr2 = json_decode($b, true); $key2 = strtotime($arr2['created_at']); $arr[$key2] = $arr2; //print_r($arr); $key = max(array_keys($arr)); print_r($arr[$key]);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [id] => 41 [userId] => 9 [description] => [updated_by] => Juan Dela Cruz [created_at] => 2019-09-18 10:07:34 [updated_at] => 2019-09-18 10:07:34 )

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:
28.7 ms | 405 KiB | 5 Q