3v4l.org

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

Function %00%7Bclosure%7D%2Fin%2FJCBKZ%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JCBKZ
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, 'hello'
          2        DO_FCALL                                      0          
    7     3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FJCBKZ%3A5%240

Class Test:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JCBKZ
function name:  test
number of ops:  7
compiled vars:  !0 = $self, !1 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FETCH_THIS                                       ~2      
          1        ASSIGN                                                   !0, ~2
    5     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FJCBKZ%3A5%240'
          3        ASSIGN                                                   !1, ~4
    8     4        INIT_DYNAMIC_CALL                                        !1
          5        DO_FCALL                                      0          
    9     6      > RETURN                                                   null

End of function test

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

End of function hello

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.61 ms | 1395 KiB | 13 Q