3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { } $array = [ 'name' => 'John', 'username' => 'JohnDoe23', 'is_active' => true ]; $reflection = new ReflectionClass('Person'); foreach($array as $key => $value) { $reflection->getProperty($key)->setProperty($value); } var_dump($reflection);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/ljip0
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array, !1 = $reflection, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
   13     1        NEW                                              $5      'ReflectionClass'
          2        SEND_VAL_EX                                              'Person'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
   15     5      > FE_RESET_R                                       $8      !0, ->15
          6    > > FE_FETCH_R                                       ~9      $8, !2, ->15
          7    >   ASSIGN                                                   !3, ~9
   17     8        INIT_METHOD_CALL                                         !1, 'getProperty'
          9        SEND_VAR_EX                                              !3
         10        DO_FCALL                                      0  $11     
         11        INIT_METHOD_CALL                                         $11, 'setProperty'
         12        SEND_VAR_EX                                              !2
         13        DO_FCALL                                      0          
   15    14      > JMP                                                      ->6
         15    >   FE_FREE                                                  $8
   20    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class Person: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172 ms | 1399 KiB | 15 Q