3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $test = 'sd'; private $test2 = [ 'test' => true, 'foo' => ['test'=>'asdasdads' ] ]; } function dismount($object) { $reflectionClass = new ReflectionClass(get_class($object)); $array = array(); foreach ($reflectionClass->getProperties() as $property) { $property->setAccessible(true); $array[$property->getName()] = $property->getValue($object); $property->setAccessible(false); } return $array; } $foo = new Foo; print_r( dismount($foo));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H9rY8
function name:  (null)
number of ops:  10
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     3        INIT_FCALL                                               'print_r'
          4        INIT_FCALL                                               'dismount'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function dismount:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 25
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 25
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/H9rY8
function name:  dismount
number of ops:  28
compiled vars:  !0 = $object, !1 = $reflectionClass, !2 = $array, !3 = $property
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        NEW                                              $4      'ReflectionClass'
          2        GET_CLASS                                        ~5      !0
          3        SEND_VAL_EX                                              ~5
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $4
   16     6        ASSIGN                                                   !2, <array>
   17     7        INIT_METHOD_CALL                                         !1, 'getProperties'
          8        DO_FCALL                                      0  $9      
          9      > FE_RESET_R                                       $10     $9, ->25
         10    > > FE_FETCH_R                                               $10, !3, ->25
   18    11    >   INIT_METHOD_CALL                                         !3, 'setAccessible'
         12        SEND_VAL_EX                                              <true>
         13        DO_FCALL                                      0          
   19    14        INIT_METHOD_CALL                                         !3, 'getName'
         15        DO_FCALL                                      0  $12     
         16        INIT_METHOD_CALL                                         !3, 'getValue'
         17        SEND_VAR_EX                                              !0
         18        DO_FCALL                                      0  $14     
         19        ASSIGN_DIM                                               !2, $12
         20        OP_DATA                                                  $14
   20    21        INIT_METHOD_CALL                                         !3, 'setAccessible'
         22        SEND_VAL_EX                                              <false>
         23        DO_FCALL                                      0          
   17    24      > JMP                                                      ->10
         25    >   FE_FREE                                                  $10
   22    26      > RETURN                                                   !2
   23    27*     > RETURN                                                   null

End of function dismount

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.99 ms | 1402 KiB | 16 Q