3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyCharacter { /* some stuff here */ } class MyString { public function __construct(MyCharacter $char, array $type, int $foo, $bar) { /* do something useful here */ } } $method = new ReflectionMethod('MyString', '__construct'); foreach ($method->getParameters() as $parameter) { echo "Type hint for ".$param->getName()." is ".$param->getClass().".\r\n"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/uTYsM
function name:  (null)
number of ops:  21
compiled vars:  !0 = $method, !1 = $parameter, !2 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $3      'ReflectionMethod'
          1        SEND_VAL_EX                                              'MyString'
          2        SEND_VAL_EX                                              '__construct'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   11     5        INIT_METHOD_CALL                                         !0, 'getParameters'
          6        DO_FCALL                                      0  $6      
          7      > FE_RESET_R                                       $7      $6, ->19
          8    > > FE_FETCH_R                                               $7, !1, ->19
   12     9    >   INIT_METHOD_CALL                                         !2, 'getName'
         10        DO_FCALL                                      0  $8      
         11        CONCAT                                           ~9      'Type+hint+for+', $8
         12        CONCAT                                           ~10     ~9, '+is+'
         13        INIT_METHOD_CALL                                         !2, 'getClass'
         14        DO_FCALL                                      0  $11     
         15        CONCAT                                           ~12     ~10, $11
         16        CONCAT                                           ~13     ~12, '.%0D%0A'
         17        ECHO                                                     ~13
   11    18      > JMP                                                      ->8
         19    >   FE_FREE                                                  $7
   15    20      > RETURN                                                   1

Class MyCharacter: [no user functions]
Class MyString:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uTYsM
function name:  __construct
number of ops:  5
compiled vars:  !0 = $char, !1 = $type, !2 = $foo, !3 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    7     4      > RETURN                                                   null

End of function __construct

End of class MyString.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.77 ms | 1395 KiB | 13 Q