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 = sprintf('%05d%05d', $this->randomGenerator->generate(10000, 99999), $this->randomGenerator->generate(0, 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 = 36, Position 2 = 2
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
filename:       /in/oIkot
function name:  (null)
number of ops:  38
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
   12    13    >   INIT_FCALL                                               'sprintf'
         14        SEND_VAL                                                 '%2505d%2505d'
         15        FETCH_THIS                                       $10     
         16        FETCH_OBJ_R                                      ~11     $10, 'randomGenerator'
         17        INIT_METHOD_CALL                                         ~11, 'generate'
         18        SEND_VAL_EX                                              10000
         19        SEND_VAL_EX                                              99999
         20        DO_FCALL                                      0  $12     
         21        SEND_VAR                                                 $12
         22        FETCH_THIS                                       $13     
         23        FETCH_OBJ_R                                      ~14     $13, 'randomGenerator'
         24        INIT_METHOD_CALL                                         ~14, 'generate'
         25        SEND_VAL_EX                                              0
         26        SEND_VAL_EX                                              99999
         27        DO_FCALL                                      0  $15     
         28        SEND_VAR                                                 $15
         29        DO_ICALL                                         $16     
         30        ASSIGN                                                   !2, $16
   14    31        INIT_FCALL                                               'in_array'
         32        SEND_VAR                                                 !2
         33        SEND_VAL                                                 <array>
         34        DO_ICALL                                         $18     
         35      > JMPNZ                                                    $18, ->2
   16    36    >   ECHO                                                     !2
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.64 ms | 1396 KiB | 17 Q