3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html> <head> <link type='text/css' rel='stylesheet' href='style.css'/> <title>More Coin Flips</title> </head> <body> <p>We will keep flipping a coin as long as the result is heads!</p> <?php $flipCount = 0; do { $flip = rand(1,6); $flipCount ++; if ($flip !=6 ){ echo "<div class=\"coin\">{$flip}</div>"; } else {echo "<div class=\"coin\">6</div>"; } } while ($flip !=6); $verb = "were"; $last = "flips"; if ($flipCount == 1) { $verb = "was"; $last = "flip"; } echo "<p>There {$verb} {$flipCount} {$last}!</p>"; ?> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
Branch analysis from position: 2
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 2
Branch analysis from position: 18
Branch analysis from position: 2
filename:       /in/d73Wr
function name:  (null)
number of ops:  34
compiled vars:  !0 = $flipCount, !1 = $flip, !2 = $verb, !3 = $last
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A++++%3Chead%3E%0A++++%09%3Clink+type%3D%27text%2Fcss%27+rel%3D%27stylesheet%27+href%3D%27style.css%27%2F%3E%0A%09%09%3Ctitle%3EMore+Coin+Flips%3C%2Ftitle%3E%0A%09%3C%2Fhead%3E%0A%09%3Cbody%3E%0A%09%3Cp%3EWe+will+keep+flipping+a+coin+as+long+as+the+result+is+heads%21%3C%2Fp%3E%0A%09'
   10     1        ASSIGN                                                   !0, 0
   12     2    >   INIT_FCALL                                               'rand'
          3        SEND_VAL                                                 1
          4        SEND_VAL                                                 6
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
   13     7        PRE_INC                                                  !0
   14     8        IS_NOT_EQUAL                                             !1, 6
          9      > JMPZ                                                     ~8, ->15
   15    10    >   ROPE_INIT                                     3  ~10     '%3Cdiv+class%3D%22coin%22%3E'
         11        ROPE_ADD                                      1  ~10     ~10, !1
         12        ROPE_END                                      2  ~9      ~10, '%3C%2Fdiv%3E'
         13        ECHO                                                     ~9
         14      > JMP                                                      ->16
   19    15    >   ECHO                                                     '%3Cdiv+class%3D%22coin%22%3E6%3C%2Fdiv%3E'
   21    16    >   IS_NOT_EQUAL                                             !1, 6
         17      > JMPNZ                                                    ~12, ->2
   22    18    >   ASSIGN                                                   !2, 'were'
   23    19        ASSIGN                                                   !3, 'flips'
   24    20        IS_EQUAL                                                 !0, 1
         21      > JMPZ                                                     ~15, ->24
   25    22    >   ASSIGN                                                   !2, 'was'
   26    23        ASSIGN                                                   !3, 'flip'
   28    24    >   ROPE_INIT                                     7  ~19     '%3Cp%3EThere+'
         25        ROPE_ADD                                      1  ~19     ~19, !2
         26        ROPE_ADD                                      2  ~19     ~19, '+'
         27        ROPE_ADD                                      3  ~19     ~19, !0
         28        ROPE_ADD                                      4  ~19     ~19, '+'
         29        ROPE_ADD                                      5  ~19     ~19, !3
         30        ROPE_END                                      6  ~18     ~19, '%21%3C%2Fp%3E'
         31        ECHO                                                     ~18
   30    32        ECHO                                                     '++++%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   31    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.73 ms | 1400 KiB | 15 Q