3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ct($array) { var_dump('1'); return count($array); } $ar = [1,2,3,4,5,6]; for ($counter = 0, $length = ct($ar); $counter < $length; $counter++) { var_dump('loop'); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 7
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 7
Branch analysis from position: 13
Branch analysis from position: 7
filename:       /in/sovm4
function name:  (null)
number of ops:  14
compiled vars:  !0 = $ar, !1 = $counter, !2 = $length
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, 0
          2        INIT_FCALL                                               'ct'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !2, $5
          6      > JMP                                                      ->11
   12     7    >   INIT_FCALL                                               'var_dump'
          8        SEND_VAL                                                 'loop'
          9        DO_ICALL                                                 
   11    10        PRE_INC                                                  !1
         11    >   IS_SMALLER                                               !1, !2
         12      > JMPNZ                                                    ~9, ->7
   13    13    > > RETURN                                                   1

Function ct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sovm4
function name:  ct
number of ops:  7
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 '1'
          3        DO_ICALL                                                 
    5     4        COUNT                                            ~2      !0
          5      > RETURN                                                   ~2
    6     6*     > RETURN                                                   null

End of function ct

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.04 ms | 1397 KiB | 16 Q