3v4l.org

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

Function %00%7Bclosure%7D%2Fin%2F1Zd1K%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Zd1K
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $context
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   BIND_STATIC                                              !0
   10     1        INIT_METHOD_CALL                                         !0, 'a'
          2        DO_FCALL                                      0          
   11     3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1Zd1K%3A9%240

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

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Zd1K
function name:  b
number of ops:  6
compiled vars:  !0 = $context, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_THIS                                       ~2      
          1        ASSIGN                                                   !0, ~2
    9     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1Zd1K%3A9%240'
          3        BIND_LEXICAL                                             ~4, !0
          4        ASSIGN                                                   !1, ~4
   12     5      > RETURN                                                   null

End of function b

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.42 ms | 1386 KiB | 13 Q