3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $foo = 'foo'; protected $bar = 'two'; private $baz = 'three'; } $a = new Foo(); $b = (array)$a; var_dump($a); var_dump($b); foreach ($b as $key => $val) { var_dump($key); var_dump($val); print "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 22
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 22
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/XADPT
function name:  (null)
number of ops:  24
compiled vars:  !0 = $a, !1 = $b, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $4      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   12     3        CAST                                          7  ~7      !0
          4        ASSIGN                                                   !1, ~7
   14     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   15     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
   17    11      > FE_RESET_R                                       $11     !1, ->22
         12    > > FE_FETCH_R                                       ~12     $11, !2, ->22
         13    >   ASSIGN                                                   !3, ~12
   18    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                                 
   19    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   20    20        ECHO                                                     '%0A'
   17    21      > JMP                                                      ->12
         22    >   FE_FREE                                                  $11
   21    23      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.09 ms | 1395 KiB | 15 Q