3v4l.org

run code in 300+ PHP versions simultaneously
<?php $letters = array('a','b','c','d','e','f','g','h'); $array = array(); // mt_rand used just for filling array, it may be filled manually if neccessary for ($i=0; $i< 200; ++$i) { $array[] = $letters[mt_rand(0,count($letters)-1)]; } for ($i=0; $i< 10000; ++$i) { echo randTest($array)."<br />"; } function randTest($array) { $out = array(); while (count($array) > 0) { $index = array_rand($array,1); $out[] = $array[$index]; unset($array[$index]); } return implode('', $out); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 18
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 18
Branch analysis from position: 26
Branch analysis from position: 18
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
Branch analysis from position: 4
filename:       /in/ais5q
function name:  (null)
number of ops:  27
compiled vars:  !0 = $letters, !1 = $array, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->14
    6     4    >   INIT_FCALL                                               'mt_rand'
          5        SEND_VAL                                                 0
          6        COUNT                                            ~7      !0
          7        SUB                                              ~8      ~7, 1
          8        SEND_VAL                                                 ~8
          9        DO_ICALL                                         $9      
         10        FETCH_DIM_R                                      ~10     !0, $9
         11        ASSIGN_DIM                                               !1
         12        OP_DATA                                                  ~10
    5    13        PRE_INC                                                  !2
         14    >   IS_SMALLER                                               !2, 200
         15      > JMPNZ                                                    ~12, ->4
    8    16    >   ASSIGN                                                   !2, 0
         17      > JMP                                                      ->24
    9    18    >   INIT_FCALL_BY_NAME                                       'randTest'
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0  $14     
         21        CONCAT                                           ~15     $14, '%3Cbr+%2F%3E'
         22        ECHO                                                     ~15
    8    23        PRE_INC                                                  !2
         24    >   IS_SMALLER                                               !2, 10000
         25      > JMPNZ                                                    ~17, ->18
   19    26    > > RETURN                                                   1

Function randtest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 3
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 3
Branch analysis from position: 15
Branch analysis from position: 3
filename:       /in/ais5q
function name:  randTest
number of ops:  21
compiled vars:  !0 = $array, !1 = $out, !2 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        ASSIGN                                                   !1, <array>
   13     2      > JMP                                                      ->12
   14     3    >   INIT_FCALL                                               'array_rand'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !2, $4
   15     8        FETCH_DIM_R                                      ~7      !0, !2
          9        ASSIGN_DIM                                               !1
         10        OP_DATA                                                  ~7
   16    11        UNSET_DIM                                                !0, !2
   13    12    >   COUNT                                            ~8      !0
         13        IS_SMALLER                                               0, ~8
         14      > JMPNZ                                                    ~9, ->3
   18    15    >   INIT_FCALL                                               'implode'
         16        SEND_VAL                                                 ''
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $10     
         19      > RETURN                                                   $10
   19    20*     > RETURN                                                   null

End of function randtest

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.49 ms | 1400 KiB | 19 Q