3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a = ['a']; function &set_a($value) { static $a = []; if (!in_array($value, $a, TRUE)) { $a[] = $value; } return $a; } $a = &set_a('a'); while ($value = current($a)) { var_dump($value); set_a('b'); next($a); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 6
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 6
Branch analysis from position: 20
Branch analysis from position: 6
filename:       /in/clIom
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   13     1        INIT_FCALL                                                   'set_a'
          2        SEND_VAL                                                     'a'
          3        DO_FCALL                                          0  $3      
          4        ASSIGN_REF                                                   !0, $3
   14     5      > JMP                                                          ->15
   15     6    >   INIT_FCALL                                                   'var_dump'
          7        SEND_VAR                                                     !1
          8        DO_ICALL                                                     
   16     9        INIT_FCALL                                                   'set_a'
         10        SEND_VAL                                                     'b'
         11        DO_FCALL                                          0          
   17    12        INIT_FCALL                                                   'next'
         13        SEND_REF                                                     !0
         14        DO_ICALL                                                     
   14    15    >   INIT_FCALL                                                   'current'
         16        SEND_VAR                                                     !0
         17        DO_ICALL                                             $8      
         18        ASSIGN                                               ~9      !1, $8
         19      > JMPNZ                                                        ~9, ->6
   18    20    > > RETURN                                                       1

Function set_a:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
Return found
Branch analysis from position: 8
filename:       /in/clIom
function name:  set_a
number of ops:  10
compiled vars:  !0 = $value, !1 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    6     1        BIND_STATIC                                                  !1
    7     2        FRAMELESS_ICALL_3                in_array            ~2      !0, !1
          3        OP_DATA                                                      <true>
          4        BOOL_NOT                                             ~3      ~2
          5      > JMPZ                                                         ~3, ->8
    8     6    >   ASSIGN_DIM                                                   !1
          7        OP_DATA                                                      !0
   10     8    > > RETURN_BY_REF                                                !1
   11     9*     > RETURN_BY_REF                                                null

End of function set_a

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
233.95 ms | 2103 KiB | 18 Q