3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits[0]["expiryDate"] = "20142646"; $fruits[1]["expiryDate"] = "20142643"; $fruits[2]["expiryDate"] = "201426445"; usort($fruits, "compareDates"); print_r($fruits); function compareDates($a, $b) { $t1 = strtotime($a['expiryDate']); $t2 = strtotime($b['expiryDate']); if ( $t1 == $t2) { return 0; } return ( $t1 > $t2) ? +1 : -1; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BUN3k
function name:  (null)
number of ops:  17
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'
    6     6        FETCH_DIM_W                                      $5      !0, 2
          7        ASSIGN_DIM                                               $5, 'expiryDate'
          8        OP_DATA                                                  '201426445'
    8     9        INIT_FCALL                                               'usort'
         10        SEND_REF                                                 !0
         11        SEND_VAL                                                 'compareDates'
         12        DO_ICALL                                                 
    9    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
   19    16      > RETURN                                                   1

Function comparedates:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BUN3k
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      
   12     2        INIT_FCALL                                               'strtotime'
          3        FETCH_DIM_R                                      ~4      !0, 'expiryDate'
          4        SEND_VAL                                                 ~4
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
   13     7        INIT_FCALL                                               'strtotime'
          8        FETCH_DIM_R                                      ~7      !1, 'expiryDate'
          9        SEND_VAL                                                 ~7
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !3, $8
   14    12        IS_EQUAL                                                 !2, !3
         13      > JMPZ                                                     ~10, ->15
   15    14    > > RETURN                                                   0
   17    15    >   IS_SMALLER                                               !3, !2
         16      > JMPZ                                                     ~11, ->19
         17    >   QM_ASSIGN                                        ~12     1
         18      > JMP                                                      ->20
         19    >   QM_ASSIGN                                        ~12     -1
         20    > > RETURN                                                   ~12
   19    21*     > RETURN                                                   null

End of function comparedates

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.7 ms | 1400 KiB | 19 Q