3v4l.org

run code in 500+ PHP versions simultaneously
<?php function multi_reset(&...$arrays) { foreach ($arrays as &$array) { reset($array); } } $a = $b = $c = [1, 2, 3]; next($a); next($b); next($b); echo 'Before multi_reset(): ' . current($a) . ' ' . current($b) . ' ' . current($c) . "\n"; multi_reset($a, $b, $c); echo 'After multi_reset(): ' . current($a) . ' ' . current($b) . ' ' . current($c) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t0PoN
function name:  (null)
number of ops:  50
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                               ~3      !2, <array>
          1        ASSIGN                                               ~4      !1, ~3
          2        ASSIGN                                                       !0, ~4
   11     3        INIT_FCALL                                                   'next'
          4        SEND_REF                                                     !0
          5        DO_ICALL                                                     
   12     6        INIT_FCALL                                                   'next'
          7        SEND_REF                                                     !1
          8        DO_ICALL                                                     
          9        INIT_FCALL                                                   'next'
         10        SEND_REF                                                     !1
         11        DO_ICALL                                                     
   14    12        INIT_FCALL                                                   'current'
         13        SEND_VAR                                                     !0
         14        DO_ICALL                                             $9      
         15        CONCAT                                               ~10     'Before+multi_reset%28%29%3A+', $9
         16        CONCAT                                               ~11     ~10, '+'
         17        INIT_FCALL                                                   'current'
         18        SEND_VAR                                                     !1
         19        DO_ICALL                                             $12     
         20        CONCAT                                               ~13     ~11, $12
         21        CONCAT                                               ~14     ~13, '+'
         22        INIT_FCALL                                                   'current'
         23        SEND_VAR                                                     !2
         24        DO_ICALL                                             $15     
         25        CONCAT                                               ~16     ~14, $15
         26        CONCAT                                               ~17     ~16, '%0A'
         27        ECHO                                                         ~17
   15    28        INIT_FCALL                                                   'multi_reset'
         29        SEND_REF                                                     !0
         30        SEND_REF                                                     !1
         31        SEND_REF                                                     !2
         32        DO_FCALL                                          0          
   16    33        INIT_FCALL                                                   'current'
         34        SEND_VAR                                                     !0
         35        DO_ICALL                                             $19     
         36        CONCAT                                               ~20     'After+multi_reset%28%29%3A+', $19
         37        CONCAT                                               ~21     ~20, '+'
         38        INIT_FCALL                                                   'current'
         39        SEND_VAR                                                     !1
         40        DO_ICALL                                             $22     
         41        CONCAT                                               ~23     ~21, $22
         42        CONCAT                                               ~24     ~23, '+'
         43        INIT_FCALL                                                   'current'
         44        SEND_VAR                                                     !2
         45        DO_ICALL                                             $25     
         46        CONCAT                                               ~26     ~24, $25
         47        CONCAT                                               ~27     ~26, '%0A'
         48        ECHO                                                         ~27
         49      > RETURN                                                       1

Function multi_reset:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/t0PoN
function name:  multi_reset
number of ops:  9
compiled vars:  !0 = $arrays, !1 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV_VARIADIC                                        !0      
    5     1      > FE_RESET_RW                                          $2      !0, ->7
          2    > > FE_FETCH_RW                                                  $2, !1, ->7
    6     3    >   INIT_FCALL                                                   'reset'
          4        SEND_REF                                                     !1
          5        DO_ICALL                                                     
    5     6      > JMP                                                          ->2
          7    >   FE_FREE                                                      $2
    8     8      > RETURN                                                       null

End of function multi_reset

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
129.93 ms | 487 KiB | 11 Q