3v4l.org

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

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

End of function callback

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

End of function set

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
72.45 ms | 411 KiB | 7 Q