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]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dST92
function name:  (null)
number of ops:  38
compiled vars:  !0 = $a, !1 = $b, !2 = $arr1, !3 = $key1, !4 = $arr, !5 = $arr2, !6 = $key2, !7 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%22id%22%3A41%2C%22userId%22%3A9%2C%22description%22%3Anull%2C%22updated_by%22%3A%22Juan+Dela+Cruz%22%2C%22created_at%22%3A%222019-09-18+10%3A07%3A34%22%2C%22updated_at%22%3A%222019-09-18+10%3A07%3A34%22%7D'
    4     1        ASSIGN                                                   !1, '%7B%22id%22%3A2%2C%22userId%22%3A9%2C%22description%22%3Anull%2C%22updated_by%22%3Anull%2C%22created_at%22%3A%222019-09-16+12%3A46%3A56%22%2C%22updated_at%22%3A%222019-09-16+12%3A46%3A56%22%7D'
    5     2        INIT_FCALL                                               'json_decode'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $10     
          6        ASSIGN                                                   !2, $10
    6     7        INIT_FCALL                                               'strtotime'
          8        FETCH_DIM_R                                      ~12     !2, 'created_at'
          9        SEND_VAL                                                 ~12
         10        DO_ICALL                                         $13     
         11        ASSIGN                                                   !3, $13
    7    12        ASSIGN_DIM                                               !4, !3
         13        OP_DATA                                                  !2
    8    14        INIT_FCALL                                               'json_decode'
         15        SEND_VAR                                                 !1
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $16     
         18        ASSIGN                                                   !5, $16
    9    19        INIT_FCALL                                               'strtotime'
         20        FETCH_DIM_R                                      ~18     !5, 'created_at'
         21        SEND_VAL                                                 ~18
         22        DO_ICALL                                         $19     
         23        ASSIGN                                                   !6, $19
   10    24        ASSIGN_DIM                                               !4, !6
         25        OP_DATA                                                  !5
   12    26        INIT_FCALL                                               'max'
         27        INIT_FCALL                                               'array_keys'
         28        SEND_VAR                                                 !4
         29        DO_ICALL                                         $22     
         30        SEND_VAR                                                 $22
         31        DO_ICALL                                         $23     
         32        ASSIGN                                                   !7, $23
   13    33        INIT_FCALL                                               'print_r'
         34        FETCH_DIM_R                                      ~25     !4, !7
         35        SEND_VAL                                                 ~25
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.65 ms | 1007 KiB | 18 Q