3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PHPFI { public $a = 'A PROPERTY'; protected $b = 'B PROPERTY'; private $c = 'C PROPERTY'; } $phpfi = new PHPFI(); var_dump((array) $phpfi); // array(3) { // ["a"]=> // string(10) "A PROPERTY" // ["*b"]=> // string(10) "B PROPERTY" // ["PHPFIc"]=> // string(10) "C PROPERTY" // } $reflect = new ReflectionClass($phpfi); $reflectProps = $reflect->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED | ReflectionProperty::IS_PRIVATE); $props = []; foreach ($reflectProps as $prop) { $prop->setAccessible(true); $props[$prop->getName()] = $prop->getValue($phpfi); } var_dump($props); // array(3) { // ["a"]=> // string(10) "A PROPERTY" // ["b"]=> // string(10) "B PROPERTY" // ["c"]=> // string(10) "C PROPERTY" // }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 29
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 29
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/Ab51l
function name:  (null)
number of ops:  34
compiled vars:  !0 = $phpfi, !1 = $reflect, !2 = $reflectProps, !3 = $props, !4 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $5      'PHPFI'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
   11     3        INIT_FCALL                                               'var_dump'
          4        CAST                                          7  ~8      !0
          5        SEND_VAL                                                 ~8
          6        DO_ICALL                                                 
   22     7        NEW                                              $10     'ReflectionClass'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $10
   23    11        INIT_METHOD_CALL                                         !1, 'getProperties'
         12        SEND_VAL_EX                                              7
         13        DO_FCALL                                      0  $13     
         14        ASSIGN                                                   !2, $13
   24    15        ASSIGN                                                   !3, <array>
   26    16      > FE_RESET_R                                       $16     !2, ->29
         17    > > FE_FETCH_R                                               $16, !4, ->29
   27    18    >   INIT_METHOD_CALL                                         !4, 'setAccessible'
         19        SEND_VAL_EX                                              <true>
         20        DO_FCALL                                      0          
   28    21        INIT_METHOD_CALL                                         !4, 'getName'
         22        DO_FCALL                                      0  $18     
         23        INIT_METHOD_CALL                                         !4, 'getValue'
         24        SEND_VAR_EX                                              !0
         25        DO_FCALL                                      0  $20     
         26        ASSIGN_DIM                                               !3, $18
         27        OP_DATA                                                  $20
   26    28      > JMP                                                      ->17
         29    >   FE_FREE                                                  $16
   31    30        INIT_FCALL                                               'var_dump'
         31        SEND_VAR                                                 !3
         32        DO_ICALL                                                 
   40    33      > RETURN                                                   1

Class PHPFI: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.76 ms | 1446 KiB | 14 Q