3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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));
based on Nieq7
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/H9rY8
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  14     1        NOP                                                      
  25     2        NEW                                              $2      :-5
         3        DO_FCALL                                      0          
         4        ASSIGN                                                   !0, $2
  26     5        INIT_FCALL                                               'print_r'
         6        INIT_FCALL                                               'dismount'
         7        SEND_VAR                                                 !0
         8        DO_FCALL                                      0  $5      
         9        SEND_VAR                                                 $5
        10        DO_ICALL                                                 
        11      > RETURN                                                   1

Function dismount:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 77) Position 1 = 12, Position 2 = 27
Branch analysis from position: 12
Jump found. (Code = 78) Position 1 = 13, Position 2 = 27
Branch analysis from position: 13
Jump found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 27
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/H9rY8
function name:  dismount
number of ops:  30
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      :-5
         2        INIT_FCALL                                               'get_class'
         3        SEND_VAR                                                 !0
         4        DO_ICALL                                         $5      
         5        BRK                                                      
         6        DO_FCALL                                      0          
         7        ASSIGN                                                   !1, $4
  16     8        ASSIGN                                                   !2, <array>
  17     9        INIT_METHOD_CALL                                         !1, 'getProperties'
        10        DO_FCALL                                      0  $9      
        11      > FE_RESET_R                                       $10     $9, ->27
        12    > > FE_FETCH_R                                               $10, !3, ->27
  18    13    >   INIT_METHOD_CALL                                         !3, 'setAccessible'
        14        SEND_VAL_EX                                              <true>
        15        DO_FCALL                                      0          
  19    16        INIT_METHOD_CALL                                         !3, 'getName'
        17        DO_FCALL                                      0  $12     
        18        INIT_METHOD_CALL                                         !3, 'getValue'
        19        SEND_VAR_EX                                              !0
        20        DO_FCALL                                      0  $14     
        21        ASSIGN_DIM                                               !2, $12
        22        OP_DATA                                                  $14
  20    23        INIT_METHOD_CALL                                         !3, 'setAccessible'
        24        SEND_VAL_EX                                              <false>
        25        DO_FCALL                                      0          
        26      > JMP                                                      ->12
        27    >   FE_FREE                                                  $10
  22    28      > RETURN                                                   !2
  23    29*     > RETURN                                                   null

End of function dismount

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 7.1.0