3v4l.org

run code in 300+ PHP versions simultaneously
<? function main(){ $cards = array("ah", "ac", "ad", "as", "2h", "2c", "2d", "2s", "3h", "3c", "3d", "3s", "4h", "4c", "4d", "4s", "5h", "5c", "5d", "5s", "6h", "6c", "6d", "6s", "7h", "7c", "7d", "7s", "8h", "8c", "8d", "8s", "9h", "9c", "9d", "9s", "th", "tc", "td", "ts", "jh", "jc", "jd", "js", "qh", "qc", "qd", "qs", "kh", "kc", "kd", "ks"); srand(time()); for($i = 0; $i < 52; $i++) { $count = count($cards); $random = (rand()%$count); if($cards[$random] == "") { $i--; } else { $deck[] = $cards[$random]; $cards[$random] = ""; } } srand(time()); $starting_point = (rand()%51); print("Starting point for cut cards is: $starting_point<p>"); // display shuffled cards (EXAMPLE ONLY) for ($index = 0; $index < 52; $index++) { if ($starting_point == 52) { $starting_point = 0; } print("Uncut Point: <strong>$deck[$index]</strong> "); print("Starting Point: <strong>$deck[$starting_point]</strong><br>"); $starting_point++; } } main(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rBPOm
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E >   INIT_FCALL                                               'main'
          1        DO_FCALL                                      0          
   46     2      > RETURN                                                   1

Function main:
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 = 8
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 42
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 45
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 42
Branch analysis from position: 59
Branch analysis from position: 42
Branch analysis from position: 45
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 8
Branch analysis from position: 27
Branch analysis from position: 8
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 8
Branch analysis from position: 27
Branch analysis from position: 8
filename:       /in/rBPOm
function name:  main
number of ops:  60
compiled vars:  !0 = $cards, !1 = $i, !2 = $count, !3 = $random, !4 = $deck, !5 = $starting_point, !6 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   16     1        INIT_FCALL                                               'srand'
          2        INIT_FCALL                                               'time'
          3        DO_ICALL                                         $8      
          4        SEND_VAR                                                 $8
          5        DO_ICALL                                                 
   17     6        ASSIGN                                                   !1, 0
          7      > JMP                                                      ->25
   19     8    >   COUNT                                            ~11     !0
          9        ASSIGN                                                   !2, ~11
   20    10        INIT_FCALL                                               'rand'
         11        DO_ICALL                                         $13     
         12        MOD                                              ~14     $13, !2
         13        ASSIGN                                                   !3, ~14
   21    14        FETCH_DIM_R                                      ~16     !0, !3
         15        IS_EQUAL                                                 ~16, ''
         16      > JMPZ                                                     ~17, ->19
   23    17    >   PRE_DEC                                                  !1
         18      > JMP                                                      ->24
   27    19    >   FETCH_DIM_R                                      ~20     !0, !3
         20        ASSIGN_DIM                                               !4
         21        OP_DATA                                                  ~20
   28    22        ASSIGN_DIM                                               !0, !3
         23        OP_DATA                                                  ''
   17    24    >   PRE_INC                                                  !1
         25    >   IS_SMALLER                                               !1, 52
         26      > JMPNZ                                                    ~23, ->8
   32    27    >   INIT_FCALL                                               'srand'
         28        INIT_FCALL                                               'time'
         29        DO_ICALL                                         $24     
         30        SEND_VAR                                                 $24
         31        DO_ICALL                                                 
   33    32        INIT_FCALL                                               'rand'
         33        DO_ICALL                                         $26     
         34        MOD                                              ~27     $26, 51
         35        ASSIGN                                                   !5, ~27
   34    36        ROPE_INIT                                     3  ~30     'Starting+point+for+cut+cards+is%3A+'
         37        ROPE_ADD                                      1  ~30     ~30, !5
         38        ROPE_END                                      2  ~29     ~30, '%3Cp%3E'
         39        ECHO                                                     ~29
   37    40        ASSIGN                                                   !6, 0
         41      > JMP                                                      ->57
   39    42    >   IS_EQUAL                                                 !5, 52
         43      > JMPZ                                                     ~33, ->45
         44    >   ASSIGN                                                   !5, 0
   40    45    >   ROPE_INIT                                     3  ~37     'Uncut+Point%3A+%3Cstrong%3E'
         46        FETCH_DIM_R                                      ~35     !4, !6
         47        ROPE_ADD                                      1  ~37     ~37, ~35
         48        ROPE_END                                      2  ~36     ~37, '%3C%2Fstrong%3E+'
         49        ECHO                                                     ~36
   41    50        ROPE_INIT                                     3  ~41     'Starting+Point%3A+%3Cstrong%3E'
         51        FETCH_DIM_R                                      ~39     !4, !5
         52        ROPE_ADD                                      1  ~41     ~41, ~39
         53        ROPE_END                                      2  ~40     ~41, '%3C%2Fstrong%3E%3Cbr%3E'
         54        ECHO                                                     ~40
   42    55        PRE_INC                                                  !5
   37    56        PRE_INC                                                  !6
         57    >   IS_SMALLER                                               !6, 52
         58      > JMPNZ                                                    ~45, ->42
   44    59    > > RETURN                                                   null

End of function main

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.65 ms | 1403 KiB | 20 Q