3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generateNotes($start, $numbers) { $notes = ['A', 'B', 'C', 'D', 'E', 'F', 'G']; $num_notes = count($notes); $indice = array_search($start, $notes); foreach (range(0, $numbers-1) as $number) { echo (($number + $indice) % $num_notes) . " "; } } echo generateNotes('E', 24);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1mBPr
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'generatenotes'
          1        SEND_VAL                                                 'E'
          2        SEND_VAL                                                 24
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
          5      > RETURN                                                   1

Function generatenotes:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/1mBPr
function name:  generateNotes
number of ops:  24
compiled vars:  !0 = $start, !1 = $numbers, !2 = $notes, !3 = $num_notes, !4 = $indice, !5 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN                                                   !2, <array>
    5     3        COUNT                                            ~7      !2
          4        ASSIGN                                                   !3, ~7
    6     5        INIT_FCALL                                               'array_search'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !4, $9
    8    10        INIT_FCALL                                               'range'
         11        SEND_VAL                                                 0
         12        SUB                                              ~11     !1, 1
         13        SEND_VAL                                                 ~11
         14        DO_ICALL                                         $12     
         15      > FE_RESET_R                                       $13     $12, ->22
         16    > > FE_FETCH_R                                               $13, !5, ->22
    9    17    >   ADD                                              ~14     !5, !4
         18        MOD                                              ~15     ~14, !3
         19        CONCAT                                           ~16     ~15, '+'
         20        ECHO                                                     ~16
    8    21      > JMP                                                      ->16
         22    >   FE_FREE                                                  $13
   11    23      > RETURN                                                   null

End of function generatenotes

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.71 ms | 1009 KiB | 16 Q