3v4l.org

run code in 200+ PHP versions simultaneously
<?php function randomNumberSequence($requiredLength = 7, $highestDigit = 8) { $sequence = ''; for ($i = 0; $i < $requiredLength; ++$i) { $sequence .= mt_rand(0, $highestDigit); } return $sequence; } $numberPrefixes = ['0812', '0813', '0814', '0815', '0816', '0817', '0818', '0819', '0909', '0908']; for ($i = 0; $i < 21; ++$i) { echo $numberPrefixes[array_rand($numberPrefixes)] , randomNumberSequence() , "\n"; }
based on vbUkS
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
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/T49Ne
function name:  (null)
number of ops:  16
compiled vars:  !0 = $numberPrefixes, !1 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  10     0  E >   ASSIGN                                                   !0, <array>
  11     1        ASSIGN                                                   !1, 0
         2      > JMP                                                      ->13
  12     3    >   INIT_FCALL                                               'array_rand'
         4        SEND_VAR                                                 !0
         5        DO_ICALL                                         $4      
         6        FETCH_DIM_R                                      ~5      !0, $4
         7        ECHO                                                     ~5
         8        INIT_FCALL                                               'randomnumbersequence'
         9        DO_FCALL                                      0  $6      
        10        ECHO                                                     $6
        11        ECHO                                                     '%0A'
  11    12        PRE_INC                                                  !1
        13    >   IS_SMALLER_OR_EQUAL                              ~8      !1, 21
        14      > JMPNZ                                                    ~8, ->3
  13    15    > > RETURN                                                   1

Function randomnumbersequence:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 5
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 5
Branch analysis from position: 13
Branch analysis from position: 5
filename:       /in/T49Ne
function name:  randomNumberSequence
number of ops:  15
compiled vars:  !0 = $requiredLength, !1 = $highestDigit, !2 = $sequence, !3 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   RECV_INIT                                        !0      7
         1        RECV_INIT                                        !1      8
   3     2        ASSIGN                                                   !2, ''
   4     3        ASSIGN                                                   !3, 0
         4      > JMP                                                      ->11
   5     5    >   INIT_FCALL                                               'mt_rand'
         6        SEND_VAL                                                 0
         7        SEND_VAR                                                 !1
         8        DO_ICALL                                         $6      
         9        ASSIGN_OP                                     8          !2, $6
   4    10        PRE_INC                                                  !3
        11    >   IS_SMALLER_OR_EQUAL                              ~9      !3, !0
        12      > JMPNZ                                                    ~9, ->5
   7    13    > > RETURN                                                   !2
   8    14*     > RETURN                                                   null

End of function randomnumbersequence

Generated using Vulcan Logic Dumper, using php 7.4.0