3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits[0]["expiryDate"] = ""; $fruits[1]["expiryDate"] = "20142643"; usort($fruits, "compareDates"); print_r($fruits); function compareDates($a, $b) { $t1 = $a['expiryDate']; $t2 = $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/fHn1m
function name:  (null)
number of ops:  14
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                                                  ''
    5     3        FETCH_DIM_W                                      $3      !0, 1
          4        ASSIGN_DIM                                               $3, 'expiryDate'
          5        OP_DATA                                                  '20142643'
    7     6        INIT_FCALL                                               'usort'
          7        SEND_REF                                                 !0
          8        SEND_VAL                                                 'compareDates'
          9        DO_ICALL                                                 
    8    10        INIT_FCALL                                               'print_r'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   18    13      > RETURN                                                   1

Function comparedates:
Finding entry points
Branch analysis from position: 0
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
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fHn1m
function name:  compareDates
number of ops:  16
compiled vars:  !0 = $a, !1 = $b, !2 = $t1, !3 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        FETCH_DIM_R                                      ~4      !0, 'expiryDate'
          3        ASSIGN                                                   !2, ~4
   12     4        FETCH_DIM_R                                      ~6      !1, 'expiryDate'
          5        ASSIGN                                                   !3, ~6
   13     6        IS_EQUAL                                                 !2, !3
          7      > JMPZ                                                     ~8, ->9
   14     8    > > RETURN                                                   0
   16     9    >   IS_SMALLER                                               !3, !2
         10      > JMPZ                                                     ~9, ->13
         11    >   QM_ASSIGN                                        ~10     1
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~10     -1
         14    > > RETURN                                                   ~10
   18    15*     > RETURN                                                   null

End of function comparedates

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.07 ms | 1396 KiB | 17 Q