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, ''], [], ]; $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/2idHZ
function name:  (null)
number of ops:  22
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      ''
          8        INIT_ARRAY                                       ~10     ~9
          9        ADD_ARRAY_ELEMENT                                ~10     <array>
   21    10        ASSIGN                                                   !2, ~10
   25    11        INIT_METHOD_CALL                                         !0, 'match'
         12        CHECK_FUNC_ARG                                           
         13        FETCH_DIM_FUNC_ARG                               $12     !2, 0
         14        SEND_FUNC_ARG                                            $12
         15        DO_FCALL                                      0          
   26    16        INIT_METHOD_CALL                                         !0, 'match'
         17        CHECK_FUNC_ARG                                           
         18        FETCH_DIM_FUNC_ARG                               $14     !2, 1
         19        SEND_FUNC_ARG                                            $14
         20        DO_FCALL                                      0          
         21      > RETURN                                                   1

Class Example:
Function match:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2idHZ
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/2idHZ
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:
169.57 ms | 1395 KiB | 13 Q