3v4l.org

run code in 500+ PHP versions simultaneously
<?php function heaven_knows_why($text, $start, $elements, $step = 1) { $arr = []; for( $i = $start, $j=1, $s=$start; $j <= $elements; $j++, $i++, $s += $step ){ $arr[] = $text . $s; } return $arr; } var_export(heaven_knows_why('file', 2, 5, 3)); echo "\n---\n"; var_export(heaven_knows_why('file', 5, 4, 20)); echo "\n---\n"; var_export(heaven_knows_why('file', 8, 3, 4)); echo "\n---\n"; var_export(heaven_knows_why('file', 3, 3, 7)); echo "\n---\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R1PuN
function name:  (null)
number of ops:  41
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                                   'var_export'
          1        INIT_FCALL                                                   'heaven_knows_why'
          2        SEND_VAL                                                     'file'
          3        SEND_VAL                                                     2
          4        SEND_VAL                                                     5
          5        SEND_VAL                                                     3
          6        DO_FCALL                                          0  $0      
          7        SEND_VAR                                                     $0
          8        DO_ICALL                                                     
   12     9        ECHO                                                         '%0A---%0A'
   13    10        INIT_FCALL                                                   'var_export'
         11        INIT_FCALL                                                   'heaven_knows_why'
         12        SEND_VAL                                                     'file'
         13        SEND_VAL                                                     5
         14        SEND_VAL                                                     4
         15        SEND_VAL                                                     20
         16        DO_FCALL                                          0  $2      
         17        SEND_VAR                                                     $2
         18        DO_ICALL                                                     
   14    19        ECHO                                                         '%0A---%0A'
   15    20        INIT_FCALL                                                   'var_export'
         21        INIT_FCALL                                                   'heaven_knows_why'
         22        SEND_VAL                                                     'file'
         23        SEND_VAL                                                     8
         24        SEND_VAL                                                     3
         25        SEND_VAL                                                     4
         26        DO_FCALL                                          0  $4      
         27        SEND_VAR                                                     $4
         28        DO_ICALL                                                     
   16    29        ECHO                                                         '%0A---%0A'
   17    30        INIT_FCALL                                                   'var_export'
         31        INIT_FCALL                                                   'heaven_knows_why'
         32        SEND_VAL                                                     'file'
         33        SEND_VAL                                                     3
         34        SEND_VAL                                                     3
         35        SEND_VAL                                                     7
         36        DO_FCALL                                          0  $6      
         37        SEND_VAR                                                     $6
         38        DO_ICALL                                                     
   18    39        ECHO                                                         '%0A---%0A'
         40      > RETURN                                                       1

Function heaven_knows_why:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 9
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 9
Branch analysis from position: 17
Branch analysis from position: 9
filename:       /in/R1PuN
function name:  heaven_knows_why
number of ops:  19
compiled vars:  !0 = $text, !1 = $start, !2 = $elements, !3 = $step, !4 = $arr, !5 = $i, !6 = $j, !7 = $s
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV                                                 !2      
          3        RECV_INIT                                            !3      1
    5     4        ASSIGN                                                       !4, <array>
    6     5        ASSIGN                                                       !5, !1
          6        ASSIGN                                                       !6, 1
          7        ASSIGN                                                       !7, !1
          8      > JMP                                                          ->15
    7     9    >   CONCAT                                               ~13     !0, !7
         10        ASSIGN_DIM                                                   !4
         11        OP_DATA                                                      ~13
    6    12        PRE_INC                                                      !6
         13        PRE_INC                                                      !5
         14        ASSIGN_OP                                         1          !7, !3
         15    >   IS_SMALLER_OR_EQUAL                                          !6, !2
         16      > JMPNZ                                                        ~17, ->9
    9    17    > > RETURN                                                       !4
   10    18*     > RETURN                                                       null

End of function heaven_knows_why

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.03 ms | 1945 KiB | 18 Q