3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function callback() {} } class Test2 { public function set(callable $callback) {} } $callback = 'Test::callback'; var_dump(is_callable($callback)); $a = new Test2(); $a->set($callback); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ilbYM
function name:  (null)
number of ops:  14
compiled vars:  !0 = $callback, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 'Test%3A%3Acallback'
   11     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'is_callable'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        SEND_VAR                                                 $3
          6        DO_ICALL                                                 
   13     7        NEW                                              $5      'Test2'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $5
   14    10        INIT_METHOD_CALL                                         !1, 'set'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0          
   15    13      > RETURN                                                   1

Class Test:
Function callback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ilbYM
function name:  callback
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > RETURN                                                   null

End of function callback

End of class Test.

Class Test2:
Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ilbYM
function name:  set
number of ops:  2
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function set

End of class Test2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.44 ms | 1395 KiB | 17 Q