3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a = 1; $f1 = fn() => $a = 2; $b = &$a; $f2 = fn() => $b = 3; echo $f1(); echo $a; echo PHP_EOL; echo $f2(); echo $a; echo PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SZdGS
function name:  (null)
number of ops:  19
compiled vars:  !0 = $a, !1 = $f1, !2 = $b, !3 = $f2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 1
    4     1        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          2        BIND_LEXICAL                                                 ~5, !0
          3        ASSIGN                                                       !1, ~5
    6     4        ASSIGN_REF                                                   !2, !0
    7     5        DECLARE_LAMBDA_FUNCTION                              ~8      [1]
          6        BIND_LEXICAL                                                 ~8, !2
          7        ASSIGN                                                       !3, ~8
    9     8        INIT_DYNAMIC_CALL                                            !1
          9        DO_FCALL                                          0  $10     
         10        ECHO                                                         $10
   10    11        ECHO                                                         !0
   11    12        ECHO                                                         '%0A'
   13    13        INIT_DYNAMIC_CALL                                            !3
         14        DO_FCALL                                          0  $11     
         15        ECHO                                                         $11
   14    16        ECHO                                                         !0
   15    17        ECHO                                                         '%0A'
   16    18      > 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/SZdGS
function name:  {closure:/in/SZdGS:4}
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                                  !0
          1        ASSIGN                                               ~1      !0, 2
          2      > RETURN                                                       ~1
          3*     > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SZdGS
function name:  {closure:/in/SZdGS:7}
number of ops:  4
compiled vars:  !0 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                                  !0
          1        ASSIGN                                               ~1      !0, 3
          2      > RETURN                                                       ~1
          3*     > RETURN                                                       null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.95 ms | 1442 KiB | 13 Q