3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct (public readonly array $ary = [0,1,2,3]) {} } $obj = new A; var_dump(current($obj->ary)); next($obj->ary); var_dump(current($obj->ary));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/edgYU
function name:  (null)
number of ops:  22
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'current'
          5        FETCH_OBJ_R                                      ~4      !0, 'ary'
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
   12    10        INIT_FCALL                                               'next'
         11        FETCH_OBJ_W                                      $7      !0, 'ary'
         12        SEND_REF                                                 $7
         13        DO_ICALL                                                 
   14    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'current'
         16        FETCH_OBJ_R                                      ~9      !0, 'ary'
         17        SEND_VAL                                                 ~9
         18        DO_ICALL                                         $10     
         19        SEND_VAR                                                 $10
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/edgYU
function name:  __construct
number of ops:  4
compiled vars:  !0 = $ary
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      <array>
          1        ASSIGN_OBJ                                               'ary'
          2        OP_DATA                                                  !0
          3      > RETURN                                                   null

End of function __construct

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.71 ms | 1069 KiB | 16 Q