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) { switch (true) { case $prop->isProtected(): $prefix = '*'; break; case $prop->isPrivate(): $prefix = $prop->getDeclaringClass()->getName(); break; default: $prefix = ''; break; } $prop->setAccessible(true); $props[$prefix . $prop->getName()] = $prop->getValue($phpfi); } var_dump($props); // array(3) { // ["a"]=> // string(10) "A PROPERTY" // ["*b"]=> // string(10) "B PROPERTY" // ["PHPFIc"]=> // string(10) "C PROPERTY" // }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 47
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 47
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 25
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
filename:       /in/Dh3PO
function name:  (null)
number of ops:  52
compiled vars:  !0 = $phpfi, !1 = $reflect, !2 = $reflectProps, !3 = $props, !4 = $prop, !5 = $prefix
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $6      'PHPFI'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $6
   11     3        INIT_FCALL                                               'var_dump'
          4        CAST                                          7  ~9      !0
          5        SEND_VAL                                                 ~9
          6        DO_ICALL                                                 
   22     7        NEW                                              $11     'ReflectionClass'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $11
   23    11        INIT_METHOD_CALL                                         !1, 'getProperties'
         12        SEND_VAL_EX                                              7
         13        DO_FCALL                                      0  $14     
         14        ASSIGN                                                   !2, $14
   24    15        ASSIGN                                                   !3, <array>
   26    16      > FE_RESET_R                                       $17     !2, ->47
         17    > > FE_FETCH_R                                               $17, !4, ->47
   28    18    >   INIT_METHOD_CALL                                         !4, 'isProtected'
         19        DO_FCALL                                      0  $19     
         20      > JMPNZ                                                    $19, ->25
   31    21    >   INIT_METHOD_CALL                                         !4, 'isPrivate'
         22        DO_FCALL                                      0  $20     
         23      > JMPNZ                                                    $20, ->27
         24    > > JMP                                                      ->33
   29    25    >   ASSIGN                                                   !5, '%2A'
   30    26      > JMP                                                      ->35
   32    27    >   INIT_METHOD_CALL                                         !4, 'getDeclaringClass'
         28        DO_FCALL                                      0  $22     
         29        INIT_METHOD_CALL                                         $22, 'getName'
         30        DO_FCALL                                      0  $23     
         31        ASSIGN                                                   !5, $23
   33    32      > JMP                                                      ->35
   35    33    >   ASSIGN                                                   !5, ''
   36    34      > JMP                                                      ->35
   38    35    >   INIT_METHOD_CALL                                         !4, 'setAccessible'
         36        SEND_VAL_EX                                              <true>
         37        DO_FCALL                                      0          
   39    38        INIT_METHOD_CALL                                         !4, 'getName'
         39        DO_FCALL                                      0  $27     
         40        CONCAT                                           ~28     !5, $27
         41        INIT_METHOD_CALL                                         !4, 'getValue'
         42        SEND_VAR_EX                                              !0
         43        DO_FCALL                                      0  $30     
         44        ASSIGN_DIM                                               !3, ~28
         45        OP_DATA                                                  $30
   26    46      > JMP                                                      ->17
         47    >   FE_FREE                                                  $17
   42    48        INIT_FCALL                                               'var_dump'
         49        SEND_VAR                                                 !3
         50        DO_ICALL                                                 
   51    51      > RETURN                                                   1

Class PHPFI: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.84 ms | 1450 KiB | 14 Q