3v4l.org

run code in 300+ PHP versions simultaneously
#!/usr/bin/env php <?php $where = [ 'Péché mignon', 'McDo', 'Flunch' ]; srand(time()); $results = array_fill(0, count($where), 0); for ($i = 0; $i < 10000; $i++) { $results[rand(0, count($where) - 1)]++; } echo $where[array_search(max($results), $results)], "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 15
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 15
Branch analysis from position: 26
Branch analysis from position: 15
filename:       /in/aG6vu
function name:  (null)
number of ops:  37
compiled vars:  !0 = $where, !1 = $results, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    6     1        INIT_FCALL                                               'srand'
          2        INIT_FCALL                                               'time'
          3        DO_ICALL                                         $4      
          4        SEND_VAR                                                 $4
          5        DO_ICALL                                                 
    8     6        INIT_FCALL                                               'array_fill'
          7        SEND_VAL                                                 0
          8        COUNT                                            ~6      !0
          9        SEND_VAL                                                 ~6
         10        SEND_VAL                                                 0
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !1, $7
   10    13        ASSIGN                                                   !2, 0
         14      > JMP                                                      ->24
   11    15    >   INIT_FCALL                                               'rand'
         16        SEND_VAL                                                 0
         17        COUNT                                            ~10     !0
         18        SUB                                              ~11     ~10, 1
         19        SEND_VAL                                                 ~11
         20        DO_ICALL                                         $12     
         21        FETCH_DIM_RW                                     $13     !1, $12
         22        PRE_INC                                                  $13
   10    23        PRE_INC                                                  !2
         24    >   IS_SMALLER                                               !2, 10000
         25      > JMPNZ                                                    ~16, ->15
   14    26    >   INIT_FCALL                                               'array_search'
         27        INIT_FCALL                                               'max'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $17     
         30        SEND_VAR                                                 $17
         31        SEND_VAR                                                 !1
         32        DO_ICALL                                         $18     
         33        FETCH_DIM_R                                      ~19     !0, $18
         34        ECHO                                                     ~19
         35        ECHO                                                     '%0A'
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.23 ms | 1396 KiB | 25 Q