3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function foo() { } public function bar() { var_dump(is_callable([$this, 'foo'])); var_dump(is_callable([$this, 'baz'])); } } $obj = new Foo; $obj->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rM7ZW
function name:  (null)
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rM7ZW
function name:  bar
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'is_callable'
          2        FETCH_THIS                                       ~0      
          3        INIT_ARRAY                                       ~1      ~0
          4        ADD_ARRAY_ELEMENT                                ~1      'foo'
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
   11     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'is_callable'
         11        FETCH_THIS                                       ~4      
         12        INIT_ARRAY                                       ~5      ~4
         13        ADD_ARRAY_ELEMENT                                ~5      'baz'
         14        SEND_VAL                                                 ~5
         15        DO_ICALL                                         $6      
         16        SEND_VAR                                                 $6
         17        DO_ICALL                                                 
   12    18      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.52 ms | 1388 KiB | 17 Q