3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $test = 'sd'; private $test2 = [ 'test' => true, 'foo' => ['test'=>'asdasdads' ] ]; public function dismount() { $object = $this; $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( $foo->dismount());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ul2PK
function name:  (null)
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   30     3        INIT_FCALL                                               'print_r'
          4        INIT_METHOD_CALL                                         !0, 'dismount'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

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

End of function dismount

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.95 ms | 1400 KiB | 15 Q