3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function publicMethod() { return function() { return $this->privateMethod(); }; } private function privateMethod() { return 'works'; } } $test = new Test; echo $test->publicMethod();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MXdI9
function name:  (null)
number of ops:  7
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'publicMethod'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FMXdI9%3A7%240

Class Test:
Function publicmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MXdI9
function name:  publicMethod
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FMXdI9%3A7%240'
    9     1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function publicmethod

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

End of function privatemethod

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.13 ms | 1395 KiB | 13 Q