3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected function _foo($v) { echo __METHOD__ . $v; } public function doit() { $that = $this; $closure = function() use ($that) { $that->_foo('value'); }; $closure(); } } $a = new A(); $a->doit();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mXEJu
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'doit'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FmXEJu%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mXEJu
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $that
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   BIND_STATIC                                              !0
   14     1        INIT_METHOD_CALL                                         !0, '_foo'
          2        SEND_VAL_EX                                              'value'
          3        DO_FCALL                                      0          
   15     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FmXEJu%3A13%240

Class A:
Function _foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mXEJu
function name:  _foo
number of ops:  4
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        CONCAT                                           ~1      'A%3A%3A_foo', !0
          2        ECHO                                                     ~1
    8     3      > RETURN                                                   null

End of function _foo

Function doit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mXEJu
function name:  doit
number of ops:  8
compiled vars:  !0 = $that, !1 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_THIS                                       ~2      
          1        ASSIGN                                                   !0, ~2
   13     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FmXEJu%3A13%240'
          3        BIND_LEXICAL                                             ~4, !0
          4        ASSIGN                                                   !1, ~4
   16     5        INIT_DYNAMIC_CALL                                        !1
          6        DO_FCALL                                      0          
   17     7      > RETURN                                                   null

End of function doit

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
134.66 ms | 1395 KiB | 13 Q