3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar, $baz; } $foo_reflection = new ReflectionObject(new Foo); var_dump( array_map( function (ReflectionProperty $prop) { $visibility = null; switch ($prop->getModifiers()) { case ReflectionProperty::IS_PUBLIC: $visibility = 'public'; break; case ReflectionProperty::IS_PROTECTED: $visibility = 'protected'; break; case ReflectionProperty::IS_PRIVATE: $visibility = 'private'; break; } return [ 'Name' => $prop->getName(), 'Visibility' => $visibility, ]; }, $foo_reflection->getProperties() ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0n3jt
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo_reflection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'ReflectionObject'
          1        NEW                                              $2      'Foo'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $2
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
    9     6        INIT_FCALL                                               'var_dump'
   10     7        INIT_FCALL                                               'array_map'
   11     8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F0n3jt%3A11%240'
   30     9        SEND_VAL                                                 ~6
   31    10        INIT_METHOD_CALL                                         !0, 'getProperties'
         11        DO_FCALL                                      0  $7      
         12        SEND_VAR                                                 $7
         13        DO_ICALL                                         $8      
         14        SEND_VAR                                                 $8
         15        DO_ICALL                                                 
   33    16      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F0n3jt%3A11%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
filename:       /in/0n3jt
function name:  {closure}
number of ops:  24
compiled vars:  !0 = $prop, !1 = $visibility
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        ASSIGN                                                   !1, null
   14     2        INIT_METHOD_CALL                                         !0, 'getModifiers'
          3        DO_FCALL                                      0  $3      
          4        CASE                                                     $3, 1
          5      > JMPNZ                                                    ~4, ->11
          6    >   CASE                                                     $3, 2
          7      > JMPNZ                                                    ~4, ->13
          8    >   CASE                                                     $3, 4
          9      > JMPNZ                                                    ~4, ->15
         10    > > JMP                                                      ->17
   16    11    >   ASSIGN                                                   !1, 'public'
   17    12      > JMP                                                      ->17
   19    13    >   ASSIGN                                                   !1, 'protected'
   20    14      > JMP                                                      ->17
   22    15    >   ASSIGN                                                   !1, 'private'
   23    16      > JMP                                                      ->17
         17    >   FREE                                                     $3
   27    18        INIT_METHOD_CALL                                         !0, 'getName'
         19        DO_FCALL                                      0  $8      
         20        INIT_ARRAY                                       ~9      $8, 'Name'
   28    21        ADD_ARRAY_ELEMENT                                ~9      !1, 'Visibility'
         22      > RETURN                                                   ~9
   30    23*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F0n3jt%3A11%240

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.87 ms | 1400 KiB | 17 Q