3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d = [ "first", "second" ]; test($d); echo $d[0]; function test(array $data = []) { printer('string', ...$data); } function printer($string, &$first, &$last) { echo $string . ', ' . $first . ' ' . $last; $first = "changed first"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MKt7N
function name:  (null)
number of ops:  7
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL_BY_NAME                                       'test'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
    9     4        FETCH_DIM_R                                      ~3      !0, 0
          5        ECHO                                                     ~3
   18     6      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MKt7N
function name:  test
number of ops:  7
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV_INIT                                        !0      <array>
   12     1        INIT_FCALL_BY_NAME                                       'printer'
          2        SEND_VAL_EX                                              'string'
          3        SEND_UNPACK                                              !0
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      1          
   13     6      > RETURN                                                   null

End of function test

Function printer:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MKt7N
function name:  printer
number of ops:  10
compiled vars:  !0 = $string, !1 = $first, !2 = $last
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   16     3        CONCAT                                           ~3      !0, '%2C+'
          4        CONCAT                                           ~4      ~3, !1
          5        CONCAT                                           ~5      ~4, '+'
          6        CONCAT                                           ~6      ~5, !2
          7        ECHO                                                     ~6
   17     8        ASSIGN                                                   !1, 'changed+first'
   18     9      > RETURN                                                   null

End of function printer

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.19 ms | 1395 KiB | 13 Q