3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dataset = array("a" > "one", "b" > "two", "c" => "three"); function foo($a, $b) { return false; } var_dump($dataset, "\n"); foreach($dataset as $key => $val) { $dataset[$key] = foo($val, 'bar'); var_dump($dataset[$key], $key, $val); print(PHP_EOL); } var_dump($dataset); print(PHP_EOL);
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 7, Position 2 = 23
Branch analysis from position: 7
Jump found. Position 1 = 8, Position 2 = 23
Branch analysis from position: 8
Jump found. Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 23
Jump found. Position 1 = -2
Branch analysis from position: 23
filename:       /in/9uVVS
function name:  (null)
number of ops:  29
compiled vars:  !0 = $dataset, !1 = $val, !2 = $key
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   ASSIGN                                                   !0, <array>
   4     1        NOP                                                      
   8     2        INIT_FCALL                                               'var_dump'
         3        SEND_VAR                                                 !0
         4        SEND_VAL                                                 '%0A'
         5        DO_ICALL                                                 
  10     6      > FE_RESET_R                                       $5      !0, ->23
         7    > > FE_FETCH_R                                       ~6      $5, !1, ->23
         8    >   ASSIGN                                                   !2, ~6
  11     9        INIT_FCALL                                               'foo'
        10        SEND_VAR                                                 !1
        11        SEND_VAL                                                 'bar'
        12        DO_FCALL                                      0  $9      
        13        ASSIGN_DIM                                               !0, !2
        14        OP_DATA                                                  $9
  12    15        INIT_FCALL                                               'var_dump'
        16        FETCH_DIM_R                                      $10     !0, !2
        17        SEND_VAR                                                 $10
        18        SEND_VAR                                                 !2
        19        SEND_VAR                                                 !1
        20        DO_ICALL                                                 
  13    21        ECHO                                                     '%0A'
        22      > JMP                                                      ->7
        23    >   FE_FREE                                                  $5
  16    24        INIT_FCALL                                               'var_dump'
        25        SEND_VAR                                                 !0
        26        DO_ICALL                                                 
  18    27        ECHO                                                     '%0A'
        28      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/9uVVS
function name:  foo
number of ops:  4
compiled vars:  !0 = $a, !1 = $b
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   RECV                                             !0      
         1        RECV                                             !1      
   5     2      > RETURN                                                   <false>
   6     3*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 7.3.0