3v4l.org

run code in 300+ PHP versions simultaneously
<?php // PHP Slots Script by Jonesy44 // // http://www.hawkee.com // session_start(); echo '<style> #slots { border: 1px solid green; background: lightgreen url(\'slots.jpg\'); padding: 10px; width: 200px; text-align:left; } #gborder { border: 1px solid green; background: lightgreen; padding: 10px; width: 200px; text-align:center; } #rborder { border: 1px solid red; background: pink; padding: 10px; width: 200px; text-align:center; } #border { border: 1px solid orange; background: white; padding: 10px; width: 200px; text-align:center; } </style>'; function playSlots() { $r1 = rand(0,9); $r2 = rand(0,9); $r3 = rand(0,9); echo '<div id="slots"><h1>&nbsp;&nbsp;&nbsp;' .$r1. ' &nbsp;&nbsp;&nbsp;&nbsp; ' .$r2. ' &nbsp;&nbsp;&nbsp; ' .$r3. '</h1></div>'; if ($r1 == $r2) { if ($r2 == $r3) { echo '<div id="gborder">Complete win!<br><b> + $2000</b></div>'; $_SESSION["slots"] = $_SESSION["slots"] + 2000; } else { echo '<div id="gborder">First two!<br><b> + $250</b></div>'; $_SESSION["slots"] = $_SESSION["slots"] + 250; } } elseif ($r2 == $r3) { if ($r1 != $r2) { echo '<div id="gborder">Second two!<br><b> + $250</b></div>'; $_SESSION["slots"] = $_SESSION["slots"] + 250; } } elseif ($r1 == $r3) { echo '<div id="gborder">First and last!<br><b> + $250</b></div>'; $_SESSION["slots"] = $_SESSION["slots"] + 250; } else { echo '<div id="rborder">You Lose!<br><i> - $100</i></div>'; $_SESSION["slots"] = $_SESSION["slots"] - 100; } } if ($_GET["play"]) { if (!isset($_SESSION["slots"])) { $_SESSION["slots"] = 1000; } echo '<center>'; playSlots(); echo '<br><form action=' .$_SERVER['PHP_SELF']. ' method=get>'; echo '<input type=hidden name=play value=slots> <input type=submit value="Spin Wheels!"> </form>'; } else { echo '<form action=' .$_SERVER['PHP_SELF']. ' method=get>'; echo '<input type=hidden name=play value=slots> <input type=submit value="Play Slots!"> </form>'; exit(); } echo '<div id="border">Cash: $' .$_SESSION["slots"]. '<hr><a href=http://wfs.myartsonline.com><i>PHP Slots Script By Jonesy44</a> - <a href=http://www.hawkee.com>Hawkee.com</a><hr></div>'; echo '</center>'; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 23
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 23
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/VSjOG
function name:  (null)
number of ops:  37
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
    8     2        ECHO                                                     '%3Cstyle%3E%0A++++++%23slots+%7B%0A++++++++border%3A+1px+solid+green%3B%0A++++++++background%3A+lightgreen+url%28%27slots.jpg%27%29%3B+%0A++++++++padding%3A+10px%3B%0A++++++++width%3A+200px%3B+%0A++++++++text-align%3Aleft%3B%0A++++++%7D%0A++++++%23gborder+%7B%0A++++++++border%3A+1px+solid+green%3B%0A++++++++background%3A+lightgreen%3B+%0A++++++++padding%3A+10px%3B%0A++++++++width%3A+200px%3B+%0A++++++++text-align%3Acenter%3B%0A++++++%7D%0A++++++%23rborder+%7B%0A++++++++border%3A+1px+solid+red%3B%0A++++++++background%3A+pink%3B+%0A++++++++padding%3A+10px%3B%0A++++++++width%3A+200px%3B+%0A++++++++text-align%3Acenter%3B%0A++++++%7D%0A++++++%23border+%7B%0A++++++++border%3A+1px+solid+orange%3B%0A++++++++background%3A+white%3B+%0A++++++++padding%3A+10px%3B%0A++++++++width%3A+200px%3B+%0A++++++++text-align%3Acenter%3B%0A++++++%7D%0A++++++%3C%2Fstyle%3E'
   70     3        FETCH_R                      global              ~1      '_GET'
          4        FETCH_DIM_R                                      ~2      ~1, 'play'
          5      > JMPZ                                                     ~2, ->23
   71     6    >   FETCH_IS                                         ~3      '_SESSION'
          7        ISSET_ISEMPTY_DIM_OBJ                         0  ~4      ~3, 'slots'
          8        BOOL_NOT                                         ~5      ~4
          9      > JMPZ                                                     ~5, ->13
   72    10    >   FETCH_W                      global              $6      '_SESSION'
         11        ASSIGN_DIM                                               $6, 'slots'
         12        OP_DATA                                                  1000
   74    13    >   ECHO                                                     '%3Ccenter%3E'
   75    14        INIT_FCALL                                               'playslots'
         15        DO_FCALL                                      0          
   76    16        FETCH_R                      global              ~9      '_SERVER'
         17        FETCH_DIM_R                                      ~10     ~9, 'PHP_SELF'
         18        CONCAT                                           ~11     '%3Cbr%3E%3Cform+action%3D', ~10
         19        CONCAT                                           ~12     ~11, '+method%3Dget%3E'
         20        ECHO                                                     ~12
   77    21        ECHO                                                     '%3Cinput+type%3Dhidden+name%3Dplay+value%3Dslots%3E%0A++++++++%3Cinput+type%3Dsubmit+value%3D%22Spin+Wheels%21%22%3E%0A++++++++%3C%2Fform%3E'
         22      > JMP                                                      ->30
   82    23    >   FETCH_R                      global              ~13     '_SERVER'
         24        FETCH_DIM_R                                      ~14     ~13, 'PHP_SELF'
         25        CONCAT                                           ~15     '%3Cform+action%3D', ~14
         26        CONCAT                                           ~16     ~15, '+method%3Dget%3E'
         27        ECHO                                                     ~16
   83    28        ECHO                                                     '%3Cinput+type%3Dhidden+name%3Dplay+value%3Dslots%3E%0A++++++++%3Cinput+type%3Dsubmit+value%3D%22Play+Slots%21%22%3E%0A++++++++%3C%2Fform%3E'
   86    29      > EXIT                                                     
   88    30    >   FETCH_R                      global              ~17     '_SESSION'
         31        FETCH_DIM_R                                      ~18     ~17, 'slots'
         32        CONCAT                                           ~19     '%3Cdiv+id%3D%22border%22%3ECash%3A+%24', ~18
         33        CONCAT                                           ~20     ~19, '%3Chr%3E%3Ca+href%3Dhttp%3A%2F%2Fwfs.myartsonline.com%3E%3Ci%3EPHP+Slots+Script+By+Jonesy44%3C%2Fa%3E+-+%3Ca+href%3Dhttp%3A%2F%2Fwww.hawkee.com%3EHawkee.com%3C%2Fa%3E%3Chr%3E%3C%2Fdiv%3E'
         34        ECHO                                                     ~20
   89    35        ECHO                                                     '%3C%2Fcenter%3E'
   91    36      > RETURN                                                   1

Function playslots:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 42
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 34
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 71
Branch analysis from position: 71
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 71
Branch analysis from position: 71
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 54
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 53
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 71
Branch analysis from position: 71
Branch analysis from position: 53
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 64
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 71
Branch analysis from position: 71
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VSjOG
function name:  playSlots
number of ops:  72
compiled vars:  !0 = $r1, !1 = $r2, !2 = $r3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   INIT_FCALL                                               'rand'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 9
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
   41     5        INIT_FCALL                                               'rand'
          6        SEND_VAL                                                 0
          7        SEND_VAL                                                 9
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !1, $5
   42    10        INIT_FCALL                                               'rand'
         11        SEND_VAL                                                 0
         12        SEND_VAL                                                 9
         13        DO_ICALL                                         $7      
         14        ASSIGN                                                   !2, $7
   43    15        CONCAT                                           ~9      '%3Cdiv+id%3D%22slots%22%3E%3Ch1%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B', !0
         16        CONCAT                                           ~10     ~9, '+%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B+'
         17        CONCAT                                           ~11     ~10, !1
         18        CONCAT                                           ~12     ~11, '+%26nbsp%3B%26nbsp%3B%26nbsp%3B+'
         19        CONCAT                                           ~13     ~12, !2
         20        CONCAT                                           ~14     ~13, '%3C%2Fh1%3E%3C%2Fdiv%3E'
         21        ECHO                                                     ~14
   44    22        IS_EQUAL                                                 !0, !1
         23      > JMPZ                                                     ~15, ->42
   45    24    >   IS_EQUAL                                                 !1, !2
         25      > JMPZ                                                     ~16, ->34
   46    26    >   ECHO                                                     '%3Cdiv+id%3D%22gborder%22%3EComplete+win%21%3Cbr%3E%3Cb%3E+%2B+%242000%3C%2Fb%3E%3C%2Fdiv%3E'
   47    27        FETCH_R                      global              ~19     '_SESSION'
         28        FETCH_DIM_R                                      ~20     ~19, 'slots'
         29        ADD                                              ~21     ~20, 2000
         30        FETCH_W                      global              $17     '_SESSION'
         31        ASSIGN_DIM                                               $17, 'slots'
         32        OP_DATA                                                  ~21
         33      > JMP                                                      ->41
   50    34    >   ECHO                                                     '%3Cdiv+id%3D%22gborder%22%3EFirst+two%21%3Cbr%3E%3Cb%3E+%2B+%24250%3C%2Fb%3E%3C%2Fdiv%3E'
   51    35        FETCH_R                      global              ~24     '_SESSION'
         36        FETCH_DIM_R                                      ~25     ~24, 'slots'
         37        ADD                                              ~26     ~25, 250
         38        FETCH_W                      global              $22     '_SESSION'
         39        ASSIGN_DIM                                               $22, 'slots'
         40        OP_DATA                                                  ~26
         41    > > JMP                                                      ->71
   54    42    >   IS_EQUAL                                                 !1, !2
         43      > JMPZ                                                     ~27, ->54
   55    44    >   IS_NOT_EQUAL                                             !0, !1
         45      > JMPZ                                                     ~28, ->53
   56    46    >   ECHO                                                     '%3Cdiv+id%3D%22gborder%22%3ESecond+two%21%3Cbr%3E%3Cb%3E+%2B+%24250%3C%2Fb%3E%3C%2Fdiv%3E'
   57    47        FETCH_R                      global              ~31     '_SESSION'
         48        FETCH_DIM_R                                      ~32     ~31, 'slots'
         49        ADD                                              ~33     ~32, 250
         50        FETCH_W                      global              $29     '_SESSION'
         51        ASSIGN_DIM                                               $29, 'slots'
         52        OP_DATA                                                  ~33
         53    > > JMP                                                      ->71
   60    54    >   IS_EQUAL                                                 !0, !2
         55      > JMPZ                                                     ~34, ->64
   61    56    >   ECHO                                                     '%3Cdiv+id%3D%22gborder%22%3EFirst+and+last%21%3Cbr%3E%3Cb%3E+%2B+%24250%3C%2Fb%3E%3C%2Fdiv%3E'
   62    57        FETCH_R                      global              ~37     '_SESSION'
         58        FETCH_DIM_R                                      ~38     ~37, 'slots'
         59        ADD                                              ~39     ~38, 250
         60        FETCH_W                      global              $35     '_SESSION'
         61        ASSIGN_DIM                                               $35, 'slots'
         62        OP_DATA                                                  ~39
         63      > JMP                                                      ->71
   65    64    >   ECHO                                                     '%3Cdiv+id%3D%22rborder%22%3EYou+Lose%21%3Cbr%3E%3Ci%3E+-+%24100%3C%2Fi%3E%3C%2Fdiv%3E'
   66    65        FETCH_R                      global              ~42     '_SESSION'
         66        FETCH_DIM_R                                      ~43     ~42, 'slots'
         67        SUB                                              ~44     ~43, 100
         68        FETCH_W                      global              $40     '_SESSION'
         69        ASSIGN_DIM                                               $40, 'slots'
         70        OP_DATA                                                  ~44
   68    71    > > RETURN                                                   null

End of function playslots

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.7 ms | 1415 KiB | 18 Q