3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array('1', '2', '3'); foreach ($arr as $key=>&$val) { if (count($arr)<4) array_push($arr, '999'); echo $val."\n"; }
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 2, Position 2 = 16
Branch analysis from position: 2
Jump found. Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
Jump found. Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
Jump found. Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 13
Branch analysis from position: 16
Jump found. Position 1 = -2
Branch analysis from position: 16
filename:       /in/n0k6O
function name:  (null)
number of ops:  18
compiled vars:  !0 = $arr, !1 = $val, !2 = $key
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, <array>
   4     1      > FE_RESET_RW                                      $4      !0, ->16
         2    > > FE_FETCH_RW                                      ~5      $4, !1, ->16
         3    >   ASSIGN                                                   !2, ~5
   6     4        INIT_FCALL                                               'count'
         5        SEND_VAR                                                 !0
         6        DO_ICALL                                         $7      
         7        IS_SMALLER                                       ~8      $7, 4
         8      > JMPZ                                                     ~8, ->13
         9    >   INIT_FCALL                                               'array_push'
        10        SEND_REF                                                 !0
        11        SEND_VAL                                                 '999'
        12        DO_ICALL                                                 
   7    13    >   CONCAT                                           ~10     !1, '%0A'
        14        ECHO                                                     ~10
        15      > JMP                                                      ->2
        16    >   FE_FREE                                                  $4
        17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.1.0