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 $param) { echo "Type hint for ".$param->getName()." is ".$param->getType().".\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/IU15G
function name:  (null)
number of ops:  21
compiled vars:  !0 = $method, !1 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $2      'ReflectionMethod'
          1        SEND_VAL_EX                                              'MyString'
          2        SEND_VAL_EX                                              '__construct'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   11     5        INIT_METHOD_CALL                                         !0, 'getParameters'
          6        DO_FCALL                                      0  $5      
          7      > FE_RESET_R                                       $6      $5, ->19
          8    > > FE_FETCH_R                                               $6, !1, ->19
   12     9    >   INIT_METHOD_CALL                                         !1, 'getName'
         10        DO_FCALL                                      0  $7      
         11        CONCAT                                           ~8      'Type+hint+for+', $7
         12        CONCAT                                           ~9      ~8, '+is+'
         13        INIT_METHOD_CALL                                         !1, 'getType'
         14        DO_FCALL                                      0  $10     
         15        CONCAT                                           ~11     ~9, $10
         16        CONCAT                                           ~12     ~11, '.%0D%0A'
         17        ECHO                                                     ~12
   11    18      > JMP                                                      ->8
         19    >   FE_FREE                                                  $6
   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/IU15G
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:
161.46 ms | 1395 KiB | 13 Q