3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { static $i; if (!isset($i)) $i = 3; if ($i <= 0) return; return array('id' => $i--, 'someValue' => mt_rand()); } $rappels = array(); $i = 0; while($row = test()) { foreach($row as $key=>$val) { $rappels[$i][$key] = $val; } $i++; } var_dump($rappels);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 3
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 3
Branch analysis from position: 16
Branch analysis from position: 3
Branch analysis from position: 10
filename:       /in/NRE2o
function name:  (null)
number of ops:  20
compiled vars:  !0 = $rappels, !1 = $i, !2 = $row, !3 = $val, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, 0
   16     2      > JMP                                                      ->12
   17     3    > > FE_RESET_R                                       $7      !2, ->10
          4    > > FE_FETCH_R                                       ~8      $7, !3, ->10
          5    >   ASSIGN                                                   !4, ~8
   18     6        FETCH_DIM_W                                      $10     !0, !1
          7        ASSIGN_DIM                                               $10, !4
          8        OP_DATA                                                  !3
   17     9      > JMP                                                      ->4
         10    >   FE_FREE                                                  $7
   20    11        PRE_INC                                                  !1
   16    12    >   INIT_FCALL                                               'test'
         13        DO_FCALL                                      0  $13     
         14        ASSIGN                                           ~14     !2, $13
         15      > JMPNZ                                                    ~14, ->3
   22    16    >   INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/NRE2o
function name:  test
number of ops:  15
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                              !0
    5     1        ISSET_ISEMPTY_CV                                 ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->5
    6     4    >   ASSIGN                                                   !0, 3
    8     5    >   IS_SMALLER_OR_EQUAL                                      !0, 0
          6      > JMPZ                                                     ~4, ->8
    9     7    > > RETURN                                                   null
   11     8    >   POST_DEC                                         ~5      !0
          9        INIT_ARRAY                                       ~6      ~5, 'id'
         10        INIT_FCALL                                               'mt_rand'
         11        DO_ICALL                                         $7      
         12        ADD_ARRAY_ELEMENT                                ~6      $7, 'someValue'
         13      > RETURN                                                   ~6
   12    14*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.99 ms | 1394 KiB | 18 Q