3v4l.org

run code in 500+ PHP versions simultaneously
<?php $base = array_merge(range(0,9), range(0,9)); $i = 1; $scratch_card =[0]; While(max(array_count_values($scratch_card)) != 3){ $winning_number = range(mt_rand(0,9), mt_rand(0,9)); $all_numbers = array_merge($base, $winning_number); shuffle($all_numbers); $scratch_card = array_slice($all_numbers, 0,9); $i++; } echo $i . "\n"; echo join($scratch_card);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 16
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 16
Branch analysis from position: 52
Branch analysis from position: 16
filename:       /in/OdQP2
function name:  (null)
number of ops:  59
compiled vars:  !0 = $base, !1 = $i, !2 = $scratch_card, !3 = $winning_number, !4 = $all_numbers
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                                   'array_merge'
          1        INIT_FCALL                                                   'range'
          2        SEND_VAL                                                     0
          3        SEND_VAL                                                     9
          4        DO_ICALL                                             $5      
          5        SEND_VAR                                                     $5
          6        INIT_FCALL                                                   'range'
          7        SEND_VAL                                                     0
          8        SEND_VAL                                                     9
          9        DO_ICALL                                             $6      
         10        SEND_VAR                                                     $6
         11        DO_ICALL                                             $7      
         12        ASSIGN                                                       !0, $7
    3    13        ASSIGN                                                       !1, 1
    5    14        ASSIGN                                                       !2, <array>
    7    15      > JMP                                                          ->44
    9    16    >   INIT_FCALL                                                   'range'
         17        INIT_FCALL                                                   'mt_rand'
         18        SEND_VAL                                                     0
         19        SEND_VAL                                                     9
         20        DO_ICALL                                             $11     
         21        SEND_VAR                                                     $11
         22        INIT_FCALL                                                   'mt_rand'
         23        SEND_VAL                                                     0
         24        SEND_VAL                                                     9
         25        DO_ICALL                                             $12     
         26        SEND_VAR                                                     $12
         27        DO_ICALL                                             $13     
         28        ASSIGN                                                       !3, $13
   11    29        INIT_FCALL                                                   'array_merge'
         30        SEND_VAR                                                     !0
         31        SEND_VAR                                                     !3
         32        DO_ICALL                                             $15     
         33        ASSIGN                                                       !4, $15
   12    34        INIT_FCALL                                                   'shuffle'
         35        SEND_REF                                                     !4
         36        DO_ICALL                                                     
   14    37        INIT_FCALL                                                   'array_slice'
         38        SEND_VAR                                                     !4
         39        SEND_VAL                                                     0
         40        SEND_VAL                                                     9
         41        DO_ICALL                                             $18     
         42        ASSIGN                                                       !2, $18
   15    43        PRE_INC                                                      !1
    7    44    >   INIT_FCALL                                                   'max'
         45        INIT_FCALL                                                   'array_count_values'
         46        SEND_VAR                                                     !2
         47        DO_ICALL                                             $21     
         48        SEND_VAR                                                     $21
         49        DO_ICALL                                             $22     
         50        IS_NOT_EQUAL                                                 $22, 3
         51      > JMPNZ                                                        ~23, ->16
   18    52    >   CONCAT                                               ~24     !1, '%0A'
         53        ECHO                                                         ~24
   19    54        INIT_FCALL                                                   'join'
         55        SEND_VAR                                                     !2
         56        DO_ICALL                                             $25     
         57        ECHO                                                         $25
         58      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
173.05 ms | 1199 KiB | 21 Q