3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { public int $id = 0; public string $code; public string $name; public function __construct() { $reflect = new ReflectionClass($this); $props = $reflect->getProperties(); foreach ($props as $prop) { echo $prop->getType()->getName(), "\n"; } } } new User();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7UtO4D
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $0      'User'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
          3      > RETURN                                                   1

Class User:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/7UtO4D
function name:  __construct
number of ops:  19
compiled vars:  !0 = $reflect, !1 = $props, !2 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $3      'ReflectionClass'
          1        FETCH_THIS                                       $4      
          2        SEND_VAR_EX                                              $4
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   12     5        INIT_METHOD_CALL                                         !0, 'getProperties'
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !1, $7
   13     8      > FE_RESET_R                                       $9      !1, ->17
          9    > > FE_FETCH_R                                               $9, !2, ->17
   14    10    >   INIT_METHOD_CALL                                         !2, 'getType'
         11        DO_FCALL                                      0  $10     
         12        INIT_METHOD_CALL                                         $10, 'getName'
         13        DO_FCALL                                      0  $11     
         14        ECHO                                                     $11
         15        ECHO                                                     '%0A'
   13    16      > JMP                                                      ->9
         17    >   FE_FREE                                                  $9
   17    18      > RETURN                                                   null

End of function __construct

End of class User.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.81 ms | 1008 KiB | 13 Q