3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $foo; } function hydrate($properties, $object) { foreach ($properties as $name => &$value) { $object->$name = &$value; } }; $object = new Foo; hydrate(['foo' => 123], $object); var_dump(ReflectionReference::fromArrayElement((array) $object, 'foo'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L9WpO
function name:  (null)
number of ops:  16
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_FCALL                                               'hydrate'
          4        SEND_VAL                                                 <array>
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0          
   18     7        INIT_FCALL                                               'var_dump'
          8        INIT_STATIC_METHOD_CALL                                  'ReflectionReference', 'fromArrayElement'
          9        CAST                                          7  ~5      !0
         10        SEND_VAL                                                 ~5
         11        SEND_VAL                                                 'foo'
         12        DO_FCALL                                      0  $6      
         13        SEND_VAR                                                 $6
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function hydrate:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/L9WpO
function name:  hydrate
number of ops:  10
compiled vars:  !0 = $properties, !1 = $object, !2 = $value, !3 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2      > FE_RESET_RW                                      $4      !0, ->8
          3    > > FE_FETCH_RW                                      ~5      $4, !2, ->8
          4    >   ASSIGN                                                   !3, ~5
   10     5        ASSIGN_OBJ_REF                                           !1, !3
          6        OP_DATA                                                  !2
    9     7      > JMP                                                      ->3
          8    >   FE_FREE                                                  $4
   12     9      > RETURN                                                   null

End of function hydrate

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.74 ms | 1013 KiB | 15 Q