3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tries = 0; $regenerateLimit = 10; do { if ($tries++ > $regenerateLimit) { throw new \RuntimeException(sprintf('Generation failed after %d tries', $tries)); } $orderNumber = $this->randomGenerator->generate(10000, 99999); } while (in_array($orderNumber, [2, 5])); echo $orderNumber;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
filename:       /in/V9969
function name:  (null)
number of ops:  27
compiled vars:  !0 = $tries, !1 = $regenerateLimit, !2 = $orderNumber
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    4     1        ASSIGN                                                   !1, 10
    8     2    >   POST_INC                                         ~5      !0
          3        IS_SMALLER                                               !1, ~5
          4      > JMPZ                                                     ~6, ->13
    9     5    >   NEW                                              $7      'RuntimeException'
          6        INIT_FCALL                                               'sprintf'
          7        SEND_VAL                                                 'Generation+failed+after+%25d+tries'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $8      
         10        SEND_VAR_NO_REF_EX                                       $8
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $7
   11    13    >   FETCH_THIS                                       $10     
         14        FETCH_OBJ_R                                      ~11     $10, 'randomGenerator'
         15        INIT_METHOD_CALL                                         ~11, 'generate'
         16        SEND_VAL_EX                                              10000
         17        SEND_VAL_EX                                              99999
         18        DO_FCALL                                      0  $12     
         19        ASSIGN                                                   !2, $12
   13    20        INIT_FCALL                                               'in_array'
         21        SEND_VAR                                                 !2
         22        SEND_VAL                                                 <array>
         23        DO_ICALL                                         $14     
         24      > JMPNZ                                                    $14, ->2
   15    25    >   ECHO                                                     !2
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.33 ms | 940 KiB | 18 Q