3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { function __construct(GUASS\WHAT\I\DONT\EXIST $class = null) { echo 'yay'; } } new Test; $r = new \ReflectionClass('Test'); foreach ($r->getMethod('__construct')->getParameters() as $param) { var_dump($param->getName(), $param->getClass()); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 23
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/aH5b6
function name:  (null)
number of ops:  25
compiled vars:  !0 = $r, !1 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        FREE                                                     $2
   14     3        NEW                                              $4      'ReflectionClass'
          4        SEND_VAL_EX                                              'Test'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $4
   16     7        INIT_METHOD_CALL                                         !0, 'getMethod'
          8        SEND_VAL_EX                                              '__construct'
          9        DO_FCALL                                      0  $7      
         10        INIT_METHOD_CALL                                         $7, 'getParameters'
         11        DO_FCALL                                      0  $8      
         12      > FE_RESET_R                                       $9      $8, ->23
         13    > > FE_FETCH_R                                               $9, !1, ->23
   17    14    >   INIT_FCALL                                               'var_dump'
         15        INIT_METHOD_CALL                                         !1, 'getName'
         16        DO_FCALL                                      0  $10     
         17        SEND_VAR                                                 $10
         18        INIT_METHOD_CALL                                         !1, 'getClass'
         19        DO_FCALL                                      0  $11     
         20        SEND_VAR                                                 $11
         21        DO_ICALL                                                 
   16    22      > JMP                                                      ->13
         23    >   FE_FREE                                                  $9
   18    24      > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aH5b6
function name:  __construct
number of ops:  3
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                        !0      null
    8     1        ECHO                                                     'yay'
    9     2      > RETURN                                                   null

End of function __construct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.42 ms | 941 KiB | 16 Q