3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function a() { return $this; } public function b() { return [42 => 42]; } public function c() { return function () { return $this; }; } } var_dump((new Test)->a()->a()); var_dump((new Test)->b()[42]); var_dump(((new Test)->c())()); var_dump((new Test)->c()());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EhT1G
function name:  (null)
number of ops:  36
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'Test'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'a'
          4        DO_FCALL                                      0  $2      
          5        INIT_METHOD_CALL                                         $2, 'a'
          6        DO_FCALL                                      0  $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                                 
   22     9        INIT_FCALL                                               'var_dump'
         10        NEW                                              $5      'Test'
         11        DO_FCALL                                      0          
         12        INIT_METHOD_CALL                                         $5, 'b'
         13        DO_FCALL                                      0  $7      
         14        FETCH_DIM_R                                      ~8      $7, 42
         15        SEND_VAL                                                 ~8
         16        DO_ICALL                                                 
   24    17        INIT_FCALL                                               'var_dump'
         18        NEW                                              $10     'Test'
         19        DO_FCALL                                      0          
         20        INIT_METHOD_CALL                                         $10, 'c'
         21        DO_FCALL                                      0  $12     
         22        INIT_DYNAMIC_CALL                                        $12
         23        DO_FCALL                                      0  $13     
         24        SEND_VAR                                                 $13
         25        DO_ICALL                                                 
   26    26        INIT_FCALL                                               'var_dump'
         27        NEW                                              $15     'Test'
         28        DO_FCALL                                      0          
         29        INIT_METHOD_CALL                                         $15, 'c'
         30        DO_FCALL                                      0  $17     
         31        INIT_DYNAMIC_CALL                                        $17
         32        DO_FCALL                                      0  $18     
         33        SEND_VAR                                                 $18
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FEhT1G%3A16%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EhT1G
function name:  {closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FETCH_THIS                                       ~0      
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FEhT1G%3A16%240

Class Test:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EhT1G
function name:  a
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_THIS                                       ~0      
          1      > RETURN                                                   ~0
    7     2*     > RETURN                                                   null

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EhT1G
function name:  b
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   <array>
   12     1*     > RETURN                                                   null

End of function b

Function c:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EhT1G
function name:  c
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FEhT1G%3A16%240'
          1      > RETURN                                                   ~0
   17     2*     > RETURN                                                   null

End of function c

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.65 ms | 1404 KiB | 16 Q