3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Create an array and push on the names // of your closest family and friends $everyone = array("Tsuji", "Cover", "WildWind", "Grim", "Cupcake", "SoulWind", "Madara"); $contestants = array(); $numcontestants = rand(3,5); for ($i = 1; $i <= $numcontestants; $i++) { $indextoadd = rand(0,count($everyone)-1); array_push($contestants,$everyone[$indextoadd]); array_splice($everyone,$indextoadd,1); $search = true; } // Sort the list sort($contestants); ?> <h3>Contestants</h3> <ul> <?php foreach ($contestants as $person) { echo "<li>{$person}"; } ?> </ul> <?php // Randomly select a winner! $winner = $contestants[rand(0,count($contestants)-1)]; // Print the winner's name in ALL CAPS echo "<p>The winner is " . strtoupper($winner) . "!</p>"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 9
Branch analysis from position: 30
2 jumps found. (Code = 77) Position 1 = 35, Position 2 = 40
Branch analysis from position: 35
2 jumps found. (Code = 78) Position 1 = 36, Position 2 = 40
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 9
Branch analysis from position: 30
Branch analysis from position: 9
filename:       /in/pO3q2
function name:  (null)
number of ops:  57
compiled vars:  !0 = $everyone, !1 = $contestants, !2 = $numcontestants, !3 = $i, !4 = $indextoadd, !5 = $search, !6 = $person, !7 = $winner
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'rand'
          3        SEND_VAL                                                 3
          4        SEND_VAL                                                 5
          5        DO_ICALL                                         $10     
          6        ASSIGN                                                   !2, $10
    7     7        ASSIGN                                                   !3, 1
          8      > JMP                                                      ->28
    8     9    >   INIT_FCALL                                               'rand'
         10        SEND_VAL                                                 0
         11        COUNT                                            ~13     !0
         12        SUB                                              ~14     ~13, 1
         13        SEND_VAL                                                 ~14
         14        DO_ICALL                                         $15     
         15        ASSIGN                                                   !4, $15
    9    16        INIT_FCALL                                               'array_push'
         17        SEND_REF                                                 !1
         18        FETCH_DIM_R                                      ~17     !0, !4
         19        SEND_VAL                                                 ~17
         20        DO_ICALL                                                 
   10    21        INIT_FCALL                                               'array_splice'
         22        SEND_REF                                                 !0
         23        SEND_VAR                                                 !4
         24        SEND_VAL                                                 1
         25        DO_ICALL                                                 
   11    26        ASSIGN                                                   !5, <true>
    7    27        PRE_INC                                                  !3
         28    >   IS_SMALLER_OR_EQUAL                                      !3, !2
         29      > JMPNZ                                                    ~22, ->9
   15    30    >   INIT_FCALL                                               'sort'
         31        SEND_REF                                                 !1
         32        DO_ICALL                                                 
   17    33        ECHO                                                     '++++%3Ch3%3EContestants%3C%2Fh3%3E%0A++++%3Cul%3E%0A++++'
   20    34      > FE_RESET_R                                       $24     !1, ->40
         35    > > FE_FETCH_R                                               $24, !6, ->40
   21    36    >   NOP                                                      
         37        FAST_CONCAT                                      ~25     '%3Cli%3E', !6
         38        ECHO                                                     ~25
   20    39      > JMP                                                      ->35
         40    >   FE_FREE                                                  $24
   24    41        ECHO                                                     '++++%3C%2Ful%3E%0A++++'
   28    42        INIT_FCALL                                               'rand'
         43        SEND_VAL                                                 0
         44        COUNT                                            ~26     !1
         45        SUB                                              ~27     ~26, 1
         46        SEND_VAL                                                 ~27
         47        DO_ICALL                                         $28     
         48        FETCH_DIM_R                                      ~29     !1, $28
         49        ASSIGN                                                   !7, ~29
   31    50        INIT_FCALL                                               'strtoupper'
         51        SEND_VAR                                                 !7
         52        DO_ICALL                                         $31     
         53        CONCAT                                           ~32     '%3Cp%3EThe+winner+is+', $31
         54        CONCAT                                           ~33     ~32, '%21%3C%2Fp%3E'
         55        ECHO                                                     ~33
   32    56      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.54 ms | 1400 KiB | 23 Q