3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits[0]["expiryDate"] = "20142646"; $fruits[1]["expiryDate"] = "20142643"; usort($fruits, "compareDates"); function compareDates($a, $b) { if (!(isset($a['expiryDate']) && isset($b['expiryDate']))) { return false; } $t1 = strtotime($a['expiryDate']); $t2 = strtotime($b['expiryDate']); return $t1 - $t2; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8jOup
function name:  (null)
number of ops:  11
compiled vars:  !0 = $fruits
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FETCH_DIM_W                                      $1      !0, 0
          1        ASSIGN_DIM                                               $1, 'expiryDate'
          2        OP_DATA                                                  '20142646'
    5     3        FETCH_DIM_W                                      $3      !0, 1
          4        ASSIGN_DIM                                               $3, 'expiryDate'
          5        OP_DATA                                                  '20142643'
    8     6        INIT_FCALL                                               'usort'
          7        SEND_REF                                                 !0
          8        SEND_VAL                                                 'compareDates'
          9        DO_ICALL                                                 
   17    10      > RETURN                                                   1

Function comparedates:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/8jOup
function name:  compareDates
number of ops:  22
compiled vars:  !0 = $a, !1 = $b, !2 = $t1, !3 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        ISSET_ISEMPTY_DIM_OBJ                         0  ~4      !0, 'expiryDate'
          3      > JMPZ_EX                                          ~4      ~4, ->6
          4    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~5      !1, 'expiryDate'
          5        BOOL                                             ~4      ~5
          6    >   BOOL_NOT                                         ~6      ~4
          7      > JMPZ                                                     ~6, ->9
   12     8    > > RETURN                                                   <false>
   14     9    >   INIT_FCALL                                               'strtotime'
         10        FETCH_DIM_R                                      ~7      !0, 'expiryDate'
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
   15    14        INIT_FCALL                                               'strtotime'
         15        FETCH_DIM_R                                      ~10     !1, 'expiryDate'
         16        SEND_VAL                                                 ~10
         17        DO_ICALL                                         $11     
         18        ASSIGN                                                   !3, $11
   16    19        SUB                                              ~13     !2, !3
         20      > RETURN                                                   ~13
   17    21*     > RETURN                                                   null

End of function comparedates

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.98 ms | 1396 KiB | 17 Q