3v4l.org

run code in 300+ 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 = 9, Position 2 = 11
Branch analysis from position: 9
Return found
Branch analysis from position: 11
filename:       /in/clIom
function name:  set_a
number of ops:  13
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        INIT_FCALL                                               'in_array'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $2      
          7        BOOL_NOT                                         ~3      $2
          8      > JMPZ                                                     ~3, ->11
    8     9    >   ASSIGN_DIM                                               !1
         10        OP_DATA                                                  !0
   10    11    > > RETURN_BY_REF                                            !1
   11    12*     > RETURN_BY_REF                                            null

End of function set_a

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
289.1 ms | 1017 KiB | 19 Q