3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Sample { private $value = 10; public function something() { return function() { echo $this->value; $this->someProtectedMethod(); }; } protected function someProtectedMethod() { echo 'hello world'; } } $x = new Sample(); $g = $x->something(); $g = Closure::bind($g, $x); $g();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aouY5
function name:  (null)
number of ops:  14
compiled vars:  !0 = $x, !1 = $g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'Sample'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   19     3        INIT_METHOD_CALL                                         !0, 'something'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   20     6        INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0  $7      
         10        ASSIGN                                                   !1, $7
   21    11        INIT_DYNAMIC_CALL                                        !1
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Class Sample:
Function something:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aouY5
function name:  something
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_LAMBDA_FUNCTION                          ~0      [0]
   10     1      > RETURN                                                   ~0
   11     2*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aouY5
function name:  {closure}
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'value'
          2        ECHO                                                     ~1
    9     3        FETCH_THIS                                       $2      
          4        INIT_METHOD_CALL                                         $2, 'someProtectedMethod'
          5        DO_FCALL                                      0          
   10     6      > RETURN                                                   null

End of Dynamic Function 0

End of function something

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

End of function someprotectedmethod

End of class Sample.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
126.47 ms | 1008 KiB | 13 Q