3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar = 'baz'; private $xyz = 'www'; } $f = new Foo(); var_dump(key($f)); var_dump(current($f)); var_dump(next($f)); var_dump(key($f)); var_dump(current($f),"---"); class Foo1 { protected $bar = 'baz'; protected $xyz = 'www'; } $f = new Foo1(); var_dump(key($f)); var_dump(current($f)); var_dump(next($f)); var_dump(key($f)); var_dump(current($f),"---"); class Foo2 { public $bar = 'baz'; public $xyz = 'www'; } $f = new Foo2(); var_dump(key($f)); var_dump(current($f)); var_dump(next($f)); var_dump(key($f)); var_dump(current($f),"---");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z0N6k
function name:  (null)
number of ops:  103
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'key'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
   11     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'current'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $6      
         13        SEND_VAR                                                 $6
         14        DO_ICALL                                                 
   12    15        INIT_FCALL                                               'var_dump'
         16        INIT_FCALL                                               'next'
         17        SEND_REF                                                 !0
         18        DO_ICALL                                         $8      
         19        SEND_VAR                                                 $8
         20        DO_ICALL                                                 
   13    21        INIT_FCALL                                               'var_dump'
         22        INIT_FCALL                                               'key'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $10     
         25        SEND_VAR                                                 $10
         26        DO_ICALL                                                 
   14    27        INIT_FCALL                                               'var_dump'
         28        INIT_FCALL                                               'current'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $12     
         31        SEND_VAR                                                 $12
         32        SEND_VAL                                                 '---'
         33        DO_ICALL                                                 
   22    34        NEW                                              $14     'Foo1'
         35        DO_FCALL                                      0          
         36        ASSIGN                                                   !0, $14
   23    37        INIT_FCALL                                               'var_dump'
         38        INIT_FCALL                                               'key'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                         $17     
         41        SEND_VAR                                                 $17
         42        DO_ICALL                                                 
   24    43        INIT_FCALL                                               'var_dump'
         44        INIT_FCALL                                               'current'
         45        SEND_VAR                                                 !0
         46        DO_ICALL                                         $19     
         47        SEND_VAR                                                 $19
         48        DO_ICALL                                                 
   25    49        INIT_FCALL                                               'var_dump'
         50        INIT_FCALL                                               'next'
         51        SEND_REF                                                 !0
         52        DO_ICALL                                         $21     
         53        SEND_VAR                                                 $21
         54        DO_ICALL                                                 
   26    55        INIT_FCALL                                               'var_dump'
         56        INIT_FCALL                                               'key'
         57        SEND_VAR                                                 !0
         58        DO_ICALL                                         $23     
         59        SEND_VAR                                                 $23
         60        DO_ICALL                                                 
   27    61        INIT_FCALL                                               'var_dump'
         62        INIT_FCALL                                               'current'
         63        SEND_VAR                                                 !0
         64        DO_ICALL                                         $25     
         65        SEND_VAR                                                 $25
         66        SEND_VAL                                                 '---'
         67        DO_ICALL                                                 
   35    68        NEW                                              $27     'Foo2'
         69        DO_FCALL                                      0          
         70        ASSIGN                                                   !0, $27
   36    71        INIT_FCALL                                               'var_dump'
         72        INIT_FCALL                                               'key'
         73        SEND_VAR                                                 !0
         74        DO_ICALL                                         $30     
         75        SEND_VAR                                                 $30
         76        DO_ICALL                                                 
   37    77        INIT_FCALL                                               'var_dump'
         78        INIT_FCALL                                               'current'
         79        SEND_VAR                                                 !0
         80        DO_ICALL                                         $32     
         81        SEND_VAR                                                 $32
         82        DO_ICALL                                                 
   38    83        INIT_FCALL                                               'var_dump'
         84        INIT_FCALL                                               'next'
         85        SEND_REF                                                 !0
         86        DO_ICALL                                         $34     
         87        SEND_VAR                                                 $34
         88        DO_ICALL                                                 
   39    89        INIT_FCALL                                               'var_dump'
         90        INIT_FCALL                                               'key'
         91        SEND_VAR                                                 !0
         92        DO_ICALL                                         $36     
         93        SEND_VAR                                                 $36
         94        DO_ICALL                                                 
   40    95        INIT_FCALL                                               'var_dump'
         96        INIT_FCALL                                               'current'
         97        SEND_VAR                                                 !0
         98        DO_ICALL                                         $38     
         99        SEND_VAR                                                 $38
        100        SEND_VAL                                                 '---'
        101        DO_ICALL                                                 
        102      > RETURN                                                   1

Class Foo: [no user functions]
Class Foo1: [no user functions]
Class Foo2: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
130.28 ms | 1409 KiB | 21 Q