3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new stdClass(); $a->foo = '*'; $b = new stdClass(); $b->foo = 'b'; $objects = array($a, $b); usort($objects, 'compareMethod'); var_dump($objects); function compareMethod($a,$b) { if ($a->foo === '*' || $b->foo === '*' ) { return 0; } return 1; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1MsoN
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $b, !2 = $objects
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    4     3        ASSIGN_OBJ                                               !0, 'foo'
          4        OP_DATA                                                  '%2A'
    6     5        NEW                                              $7      'stdClass'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
    7     8        ASSIGN_OBJ                                               !1, 'foo'
          9        OP_DATA                                                  'b'
    9    10        INIT_ARRAY                                       ~11     !0
         11        ADD_ARRAY_ELEMENT                                ~11     !1
         12        ASSIGN                                                   !2, ~11
   10    13        INIT_FCALL                                               'usort'
         14        SEND_REF                                                 !2
         15        SEND_VAL                                                 'compareMethod'
         16        DO_ICALL                                                 
   12    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   22    20      > RETURN                                                   1

Function comparemethod:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/1MsoN
function name:  compareMethod
number of ops:  12
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        FETCH_OBJ_R                                      ~2      !0, 'foo'
          3        IS_IDENTICAL                                     ~3      ~2, '%2A'
          4      > JMPNZ_EX                                         ~3      ~3, ->8
   17     5    >   FETCH_OBJ_R                                      ~4      !1, 'foo'
          6        IS_IDENTICAL                                     ~5      ~4, '%2A'
          7        BOOL                                             ~3      ~5
          8    > > JMPZ                                                     ~3, ->10
   19     9    > > RETURN                                                   0
   21    10    > > RETURN                                                   1
   22    11*     > RETURN                                                   null

End of function comparemethod

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.76 ms | 1396 KiB | 17 Q