3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Foo { public function foo($callback) { $callback(); } } class Bar { use Foo; public function bar() { $this->foo(function() { $this->baz(); }); } protected function baz() { echo 'made it'; } } $bar = new Bar; $bar->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ig0mv
function name:  (null)
number of ops:  7
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'bar'
   28     1        NEW                                              $1      'Bar'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   29     4        INIT_METHOD_CALL                                         !0, 'bar'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fig0mv%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ig0mv
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_THIS                                       $0      
          1        INIT_METHOD_CALL                                         $0, 'baz'
          2        DO_FCALL                                      0          
   19     3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fig0mv%3A17%240

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

End of function foo

End of class Foo.

Class Bar:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ig0mv
function name:  bar
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_METHOD_CALL                                         'foo'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fig0mv%3A17%240'
   19     2        SEND_VAL_EX                                              ~0
          3        DO_FCALL                                      0          
   20     4      > RETURN                                                   null

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ig0mv
function name:  baz
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   ECHO                                                     'made+it'
   25     1      > RETURN                                                   null

End of function baz

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.54 ms | 1395 KiB | 13 Q