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 = Closure::bind($g, $x); $g();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jHXWP
function name:  (null)
number of ops:  13
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%2FjHXWP%3A11%240'
          4        ASSIGN                                                   !1, ~5
   14     5        INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !0
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !1, $7
   15    10        INIT_DYNAMIC_CALL                                        !1
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FjHXWP%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jHXWP
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%2FjHXWP%3A11%240

Class Sample:
Function someprotectedmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jHXWP
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:
125.62 ms | 1398 KiB | 13 Q