3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Sample { protected function someProtectedMethod() { echo 'hello world'; } } $x = new Sample(); $g = function() { $this->someProtectedMethod(); }; $g = $g->BindTo($x); $g();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BdneA
function name:  (null)
number of ops:  12
compiled vars:  !0 = $x, !1 = $g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $2      'Sample'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   11     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FBdneA%3A11%240'
          4        ASSIGN                                                   !1, ~5
   14     5        INIT_METHOD_CALL                                         !1, 'BindTo'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !1, $7
   15     9        INIT_DYNAMIC_CALL                                        !1
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

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

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

Class Sample:
Function someprotectedmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BdneA
function name:  someProtectedMethod
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'hello+world'
    6     1      > RETURN                                                   null

End of function someprotectedmethod

End of class Sample.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.12 ms | 1385 KiB | 13 Q