3v4l.org

run code in 300+ PHP versions simultaneously
<?php function MakeCouponCode() { $res = "BADPERK-"; for($i = 0; $i < 5; ++$i) $res .= chr(mt_rand(0, 1) == 0 ? mt_rand(65, 90) : mt_rand(48, 57)); return $res; } $coupons = array(); for($i = 0; $i < 5; ++$i) $coupons[] = MakeCouponCode(); echo $coupons;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/QD6YH
function name:  (null)
number of ops:  12
compiled vars:  !0 = $coupons, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->8
   11     3    >   INIT_FCALL                                               'makecouponcode'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  $5
   10     7        PRE_INC                                                  !1
          8    >   IS_SMALLER                                               !1, 5
          9      > JMPNZ                                                    ~7, ->3
   13    10    >   ECHO                                                     !0
         11      > RETURN                                                   1

Function makecouponcode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 3
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 3
Branch analysis from position: 27
Branch analysis from position: 3
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 3
Branch analysis from position: 27
Branch analysis from position: 3
filename:       /in/QD6YH
function name:  MakeCouponCode
number of ops:  29
compiled vars:  !0 = $res, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'BADPERK-'
    4     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->25
    5     3    >   INIT_FCALL                                               'chr'
          4        INIT_FCALL                                               'mt_rand'
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 1
          7        DO_ICALL                                         $4      
          8        IS_EQUAL                                                 $4, 0
          9      > JMPZ                                                     ~5, ->16
         10    >   INIT_FCALL                                               'mt_rand'
         11        SEND_VAL                                                 65
         12        SEND_VAL                                                 90
         13        DO_ICALL                                         $6      
         14        QM_ASSIGN                                        ~7      $6
         15      > JMP                                                      ->21
         16    >   INIT_FCALL                                               'mt_rand'
         17        SEND_VAL                                                 48
         18        SEND_VAL                                                 57
         19        DO_ICALL                                         $8      
         20        QM_ASSIGN                                        ~7      $8
         21    >   SEND_VAL                                                 ~7
         22        DO_ICALL                                         $9      
         23        ASSIGN_OP                                     8          !0, $9
    4    24        PRE_INC                                                  !1
         25    >   IS_SMALLER                                               !1, 5
         26      > JMPNZ                                                    ~12, ->3
    6    27    > > RETURN                                                   !0
    7    28*     > RETURN                                                   null

End of function makecouponcode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.21 ms | 1394 KiB | 18 Q