3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example { public function match(callable $cb) { echo $cb(); } } class Callee { public function yo() { return "If I show up, I'm allowed to do this!"; } } $ex = new Example(); $callee = new Callee(); $cases = [ [$callee, 'yo'], [$callee, ''], ]; $ex->match($cases[0]); $ex->match($cases[1]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/onm9i
function name:  (null)
number of ops:  24
compiled vars:  !0 = $ex, !1 = $callee, !2 = $cases
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $3      'Example'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   20     3        NEW                                              $6      'Callee'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   22     6        INIT_ARRAY                                       ~9      !1
          7        ADD_ARRAY_ELEMENT                                ~9      'yo'
          8        INIT_ARRAY                                       ~10     ~9
   23     9        INIT_ARRAY                                       ~11     !1
         10        ADD_ARRAY_ELEMENT                                ~11     ''
         11        ADD_ARRAY_ELEMENT                                ~10     ~11
   21    12        ASSIGN                                                   !2, ~10
   25    13        INIT_METHOD_CALL                                         !0, 'match'
         14        CHECK_FUNC_ARG                                           
         15        FETCH_DIM_FUNC_ARG                               $13     !2, 0
         16        SEND_FUNC_ARG                                            $13
         17        DO_FCALL                                      0          
   26    18        INIT_METHOD_CALL                                         !0, 'match'
         19        CHECK_FUNC_ARG                                           
         20        FETCH_DIM_FUNC_ARG                               $15     !2, 1
         21        SEND_FUNC_ARG                                            $15
         22        DO_FCALL                                      0          
         23      > RETURN                                                   1

Class Example:
Function match:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/onm9i
function name:  match
number of ops:  5
compiled vars:  !0 = $cb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0  $1      
          3        ECHO                                                     $1
    8     4      > RETURN                                                   null

End of function match

End of class Example.

Class Callee:
Function yo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/onm9i
function name:  yo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E > > RETURN                                                   'If+I+show+up%2C+I%27m+allowed+to+do+this%21'
   16     1*     > RETURN                                                   null

End of function yo

End of class Callee.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.26 ms | 1395 KiB | 13 Q