3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple"); function test_alter(&$item1, $key, $prefix) { $item1 = "$prefix: $item1"; } function test_print($item2, $key) { echo "$key. $item2<br />\n"; } echo "До ...:\n"; array_walk($fruits, 'test_print'); array_walk($fruits, 'test_alter', 'fruit'); echo "... и после:\n"; array_walk($fruits, 'test_print');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vEDAa
function name:  (null)
number of ops:  17
compiled vars:  !0 = $fruits
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        ECHO                                                     '%D0%94%D0%BE+...%3A%0A'
   16     2        INIT_FCALL                                               'array_walk'
          3        SEND_REF                                                 !0
          4        SEND_VAL                                                 'test_print'
          5        DO_ICALL                                                 
   18     6        INIT_FCALL                                               'array_walk'
          7        SEND_REF                                                 !0
          8        SEND_VAL                                                 'test_alter'
          9        SEND_VAL                                                 'fruit'
         10        DO_ICALL                                                 
   19    11        ECHO                                                     '...+%D0%B8+%D0%BF%D0%BE%D1%81%D0%BB%D0%B5%3A%0A'
   21    12        INIT_FCALL                                               'array_walk'
         13        SEND_REF                                                 !0
         14        SEND_VAL                                                 'test_print'
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function test_alter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vEDAa
function name:  test_alter
number of ops:  8
compiled vars:  !0 = $item1, !1 = $key, !2 = $prefix
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    7     3        ROPE_INIT                                     3  ~4      !2
          4        ROPE_ADD                                      1  ~4      ~4, '%3A+'
          5        ROPE_END                                      2  ~3      ~4, !0
          6        ASSIGN                                                   !0, ~3
    8     7      > RETURN                                                   null

End of function test_alter

Function test_print:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vEDAa
function name:  test_print
number of ops:  8
compiled vars:  !0 = $item2, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        ROPE_INIT                                     4  ~3      !1
          3        ROPE_ADD                                      1  ~3      ~3, '.+'
          4        ROPE_ADD                                      2  ~3      ~3, !0
          5        ROPE_END                                      3  ~2      ~3, '%3Cbr+%2F%3E%0A'
          6        ECHO                                                     ~2
   13     7      > RETURN                                                   null

End of function test_print

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.4 ms | 1396 KiB | 15 Q