3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function foo() { return function() { $this->bar(); }; } function bar() { echo "Yolo Foo\n"; } function exec($callable) { $callable(); } } class Qux { function bar() { echo "Yolo Bar\n"; } function exec($callable) { $callable(); } } $foo = new Foo(); $qux = new Qux(); $fooer = $foo->foo(); $fooer(); $foo->exec($fooer); $qux->exec($fooer);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rQQvZ
function name:  (null)
number of ops:  18
compiled vars:  !0 = $foo, !1 = $qux, !2 = $fooer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $3      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   30     3        NEW                                              $6      'Qux'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   32     6        INIT_METHOD_CALL                                         !0, 'foo'
          7        DO_FCALL                                      0  $9      
          8        ASSIGN                                                   !2, $9
   34     9        INIT_DYNAMIC_CALL                                        !2
         10        DO_FCALL                                      0          
   35    11        INIT_METHOD_CALL                                         !0, 'exec'
         12        SEND_VAR_EX                                              !2
         13        DO_FCALL                                      0          
   36    14        INIT_METHOD_CALL                                         !1, 'exec'
         15        SEND_VAR_EX                                              !2
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FrQQvZ%3A6%240

Class Foo:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rQQvZ
function name:  foo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FrQQvZ%3A6%240'
          1      > RETURN                                                   ~0
    7     2*     > 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/rQQvZ
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     'Yolo+Foo%0A'
   11     1      > RETURN                                                   null

End of function bar

Function exec:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rQQvZ
function name:  exec
number of ops:  4
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
   15     3      > RETURN                                                   null

End of function exec

End of class Foo.

Class Qux:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rQQvZ
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ECHO                                                     'Yolo+Bar%0A'
   22     1      > RETURN                                                   null

End of function bar

Function exec:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rQQvZ
function name:  exec
number of ops:  4
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   25     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
   26     3      > RETURN                                                   null

End of function exec

End of class Qux.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.14 ms | 1390 KiB | 13 Q