3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A extends \ArrayObject {} $a = new A; $a->offsetSet('test', 'testValue'); $reflection = new \ReflectionObject($a); $properties = $reflection->getProperties(); $c = count($properties); echo $c . PHP_EOL; if ($c) { echo $properties[0]->getValue($a) . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/Y2CkO
function name:  (null)
number of ops:  26
compiled vars:  !0 = $a, !1 = $reflection, !2 = $properties, !3 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $4      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    6     3        INIT_METHOD_CALL                                         !0, 'offsetSet'
          4        SEND_VAL_EX                                              'test'
          5        SEND_VAL_EX                                              'testValue'
          6        DO_FCALL                                      0          
    8     7        NEW                                              $8      'ReflectionObject'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $8
    9    11        INIT_METHOD_CALL                                         !1, 'getProperties'
         12        DO_FCALL                                      0  $11     
         13        ASSIGN                                                   !2, $11
   11    14        COUNT                                            ~13     !2
         15        ASSIGN                                                   !3, ~13
   13    16        CONCAT                                           ~15     !3, '%0A'
         17        ECHO                                                     ~15
   15    18      > JMPZ                                                     !3, ->25
   16    19    >   FETCH_DIM_R                                      ~16     !2, 0
         20        INIT_METHOD_CALL                                         ~16, 'getValue'
         21        SEND_VAR_EX                                              !0
         22        DO_FCALL                                      0  $17     
         23        CONCAT                                           ~18     $17, '%0A'
         24        ECHO                                                     ~18
   17    25    > > RETURN                                                   1

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.44 ms | 1394 KiB | 13 Q