3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getLinks() : array { if (rand(1,4) === 1) return ['a', 'b', 'c']; return []; } $links = []; foreach (range(1,7) as $a) { $links = getLinks(); if (count($links)) break; } print implode("\n", $links);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 14
Branch analysis from position: 14
filename:       /in/IArR3
function name:  (null)
number of ops:  21
compiled vars:  !0 = $links, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 1
          3        SEND_VAL                                                 7
          4        DO_ICALL                                         $3      
          5      > FE_RESET_R                                       $4      $3, ->14
          6    > > FE_FETCH_R                                               $4, !1, ->14
   10     7    >   INIT_FCALL                                               'getlinks'
          8        DO_FCALL                                      0  $5      
          9        ASSIGN                                                   !0, $5
   11    10        COUNT                                            ~7      !0
         11      > JMPZ                                                     ~7, ->13
         12    > > JMP                                                      ->14
    9    13    > > JMP                                                      ->6
         14    >   FE_FREE                                                  $4
   14    15        INIT_FCALL                                               'implode'
         16        SEND_VAL                                                 '%0A'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $8      
         19        ECHO                                                     $8
         20      > RETURN                                                   1

Function getlinks:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IArR3
function name:  getLinks
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'rand'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 4
          3        DO_ICALL                                         $0      
          4        IS_IDENTICAL                                             $0, 1
          5      > JMPZ                                                     ~1, ->7
          6    > > RETURN                                                   <array>
    5     7    > > RETURN                                                   <array>
    6     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function getlinks

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.97 ms | 1399 KiB | 20 Q