3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $number = 42; public function bar() { var_dump($this->number); return __METHOD__; } } class Bar extends Foo { public function callme($callback) { echo call_user_func($callback); } } $callback = array('Foo', 'Bar'); var_dump(is_callable($callback)); $bar = new Bar(); $bar->callme($callback);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Me4UW
function name:  (null)
number of ops:  14
compiled vars:  !0 = $callback, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ASSIGN                                                   !0, <array>
   20     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                                                 
   21     7        NEW                                              $5      'Bar'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $5
   22    10        INIT_METHOD_CALL                                         !1, 'callme'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Me4UW
function name:  bar
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~0      'number'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    9     4      > RETURN                                                   'Foo%3A%3Abar'
   10     5*     > RETURN                                                   null

End of function bar

End of class Foo.

Class Bar:
Function callme:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Me4UW
function name:  callme
number of ops:  5
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        INIT_USER_CALL                                0          'call_user_func', !0
          2        DO_FCALL                                      0  $1      
          3        ECHO                                                     $1
   16     4      > RETURN                                                   null

End of function callme

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Me4UW
function name:  bar
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~0      'number'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    9     4      > RETURN                                                   'Foo%3A%3Abar'
   10     5*     > RETURN                                                   null

End of function bar

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.52 ms | 1400 KiB | 17 Q