3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected function _a() { return 'waa?'; } } $c = function() { return $this->_a(); }; $a = new A; $c = $c->bindTo($a); var_dump($c); $c();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YqCj1
function name:  (null)
number of ops:  15
compiled vars:  !0 = $c, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYqCj1%3A11%240'
          1        ASSIGN                                                   !0, ~2
   12     2        NEW                                              $4      'A'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   14     5        INIT_METHOD_CALL                                         !0, 'bindTo'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !0, $7
   15     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   16    12        INIT_DYNAMIC_CALL                                        !0
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FYqCj1%3A11%240

Class A:
Function _a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YqCj1
function name:  _a
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   'waa%3F'
    8     1*     > RETURN                                                   null

End of function _a

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.66 ms | 1388 KiB | 15 Q