3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'original'; $refArray = [&$str]; $filtered = array_filter($refArray, fn () => true); $filtered[0] = 'MODIFIED'; echo $str; // array_filter preserves the reference!
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oR8c6
function name:  (null)
number of ops:  13
compiled vars:  !0 = $str, !1 = $refArray, !2 = $filtered
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'original'
    4     1        INIT_ARRAY                                       ~4      !0
          2        ASSIGN                                                   !1, ~4
    5     3        INIT_FCALL                                               'array_filter'
          4        SEND_VAR                                                 !1
          5        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
          6        SEND_VAL                                                 ~6
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !2, $7
    6     9        ASSIGN_DIM                                               !2, 0
         10        OP_DATA                                                  'MODIFIED'
    7    11        ECHO                                                     !0
         12      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oR8c6
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   <true>
          1*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.67 ms | 999 KiB | 14 Q