3v4l.org

run code in 300+ PHP versions simultaneously
<?php $proxies = array('10.0.0.4', '192.168.0.1', '10.1.0.1'); function get_proxy($proxies) { static $i = 0, $keys; if (!isset($keys)) $keys = array_keys($proxies); if ($i == 0) shuffle($keys); $proxy = $proxies[$keys[$i]]; $i = ($i + 1) % count($keys); return $proxy; } for ($i= 0; $i < 9; $i++) { echo get_proxy($proxies) . "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 3
Branch analysis from position: 11
Branch analysis from position: 3
filename:       /in/UDHjd
function name:  (null)
number of ops:  12
compiled vars:  !0 = $proxies, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   14     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->9
   15     3    >   INIT_FCALL                                               'get_proxy'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $4      
          6        CONCAT                                           ~5      $4, '%0A'
          7        ECHO                                                     ~5
   14     8        PRE_INC                                                  !1
          9    >   IS_SMALLER                                               !1, 9
         10      > JMPNZ                                                    ~7, ->3
   16    11    > > RETURN                                                   1

Function get_proxy:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
Branch analysis from position: 10
filename:       /in/UDHjd
function name:  get_proxy
number of ops:  24
compiled vars:  !0 = $proxies, !1 = $i, !2 = $keys, !3 = $proxy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
    7     3        ISSET_ISEMPTY_CV                                 ~4      !2
          4        BOOL_NOT                                         ~5      ~4
          5      > JMPZ                                                     ~5, ->10
          6    >   INIT_FCALL                                               'array_keys'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !2, $6
    8    10    >   IS_EQUAL                                                 !1, 0
         11      > JMPZ                                                     ~8, ->15
         12    >   INIT_FCALL                                               'shuffle'
         13        SEND_REF                                                 !2
         14        DO_ICALL                                                 
    9    15    >   FETCH_DIM_R                                      ~10     !2, !1
         16        FETCH_DIM_R                                      ~11     !0, ~10
         17        ASSIGN                                                   !3, ~11
   10    18        ADD                                              ~13     !1, 1
         19        COUNT                                            ~14     !2
         20        MOD                                              ~15     ~13, ~14
         21        ASSIGN                                                   !1, ~15
   11    22      > RETURN                                                   !3
   12    23*     > RETURN                                                   null

End of function get_proxy

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.13 ms | 1403 KiB | 18 Q