3v4l.org

run code in 300+ PHP versions simultaneously
<?php class waitaminute{ function _sorter() { return function($elem1, $elem2) { if(strcmp($elem1['sequenceName'], $elem2['sequenceName']) < 0) { return -1; } else if (strcmp($elem1['sequenceName'], $elem2['sequenceName']) === 0) { $elem1DT = $elem1['dateTime']; $elem2DT = $elem2['dateTime']; if ($elem1DT->isBefore($elem2DT)) { return -1; } else if ($elem1DT->isAfter($elem2DT)) { return 1; } else { return 0; } } else if (strcmp($elem1['sequenceName'], $elem2['sequenceName']) > 0) { return 1; } }; } public function __construct() { $tmp = array("apples", "bananas","bananas","argyles"); usort($tmp, array($this, '_sorter')); var_dump($tmp); } } $a = new waitaminute();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ife3e
function name:  (null)
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   NEW                                              $1      'waitaminute'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fife3e%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 38
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 47
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ife3e
function name:  {closure}
number of ops:  48
compiled vars:  !0 = $elem1, !1 = $elem2, !2 = $elem1DT, !3 = $elem2DT
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_FCALL                                               'strcmp'
          3        FETCH_DIM_R                                      ~4      !0, 'sequenceName'
          4        SEND_VAL                                                 ~4
          5        FETCH_DIM_R                                      ~5      !1, 'sequenceName'
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                         $6      
          8        IS_SMALLER                                               $6, 0
          9      > JMPZ                                                     ~7, ->12
    6    10    > > RETURN                                                   -1
         11*       JMP                                                      ->47
    7    12    >   INIT_FCALL                                               'strcmp'
         13        FETCH_DIM_R                                      ~8      !0, 'sequenceName'
         14        SEND_VAL                                                 ~8
         15        FETCH_DIM_R                                      ~9      !1, 'sequenceName'
         16        SEND_VAL                                                 ~9
         17        DO_ICALL                                         $10     
         18        IS_IDENTICAL                                             $10, 0
         19      > JMPZ                                                     ~11, ->38
    8    20    >   FETCH_DIM_R                                      ~12     !0, 'dateTime'
         21        ASSIGN                                                   !2, ~12
    9    22        FETCH_DIM_R                                      ~14     !1, 'dateTime'
         23        ASSIGN                                                   !3, ~14
   10    24        INIT_METHOD_CALL                                         !2, 'isBefore'
         25        SEND_VAR_EX                                              !3
         26        DO_FCALL                                      0  $16     
         27      > JMPZ                                                     $16, ->30
   11    28    > > RETURN                                                   -1
         29*       JMP                                                      ->37
   12    30    >   INIT_METHOD_CALL                                         !2, 'isAfter'
         31        SEND_VAR_EX                                              !3
         32        DO_FCALL                                      0  $17     
         33      > JMPZ                                                     $17, ->36
   13    34    > > RETURN                                                   1
         35*       JMP                                                      ->37
   15    36    > > RETURN                                                   0
         37*       JMP                                                      ->47
   17    38    >   INIT_FCALL                                               'strcmp'
         39        FETCH_DIM_R                                      ~18     !0, 'sequenceName'
         40        SEND_VAL                                                 ~18
         41        FETCH_DIM_R                                      ~19     !1, 'sequenceName'
         42        SEND_VAL                                                 ~19
         43        DO_ICALL                                         $20     
         44        IS_SMALLER                                               0, $20
         45      > JMPZ                                                     ~21, ->47
   18    46    > > RETURN                                                   1
   20    47    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fife3e%3A4%240

Class waitaminute:
Function _sorter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ife3e
function name:  _sorter
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fife3e%3A4%240'
   20     1      > RETURN                                                   ~0
   21     2*     > RETURN                                                   null

End of function _sorter

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ife3e
function name:  __construct
number of ops:  12
compiled vars:  !0 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   ASSIGN                                                   !0, <array>
   26     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        FETCH_THIS                                       ~2      
          4        INIT_ARRAY                                       ~3      ~2
          5        ADD_ARRAY_ELEMENT                                ~3      '_sorter'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                                 
   27     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   29    11      > RETURN                                                   null

End of function __construct

End of class waitaminute.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.57 ms | 1404 KiB | 19 Q