3v4l.org

run code in 300+ 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 array_rand($numberPrefixes) , randomNumberSequence , "\n"; }
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 = 3
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
Branch analysis from position: 3
filename:       /in/Zi98C
function name:  (null)
number of ops:  14
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                                                      ->11
   12     3    >   INIT_FCALL                                               'array_rand'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        ECHO                                                     $4
          7        FETCH_CONSTANT                                   ~5      'randomNumberSequence'
          8        ECHO                                                     ~5
          9        ECHO                                                     '%0A'
   11    10        PRE_INC                                                  !1
         11    >   IS_SMALLER                                               !1, 21
         12      > JMPNZ                                                    ~7, ->3
   13    13    > > 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/Zi98C
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                                               !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 8.0.0


preferences:
152.57 ms | 1396 KiB | 17 Q