3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = ['a' => 'A', 'b' => 'B']; $key = 'b'; [$key => $b, 'a' => $a] = $arr; var_dump($a); var_dump($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WR54k
function name:  (null)
number of ops:  15
compiled vars:  !0 = $arr, !1 = $key, !2 = $b, !3 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    5     1        ASSIGN                                                       !1, 'b'
    6     2        QM_ASSIGN                                            ~6      !0
          3        FETCH_LIST_R                                         $7      ~6, !1
          4        ASSIGN                                                       !2, $7
          5        FETCH_LIST_R                                         $9      ~6, 'a'
          6        ASSIGN                                                       !3, $9
          7        FREE                                                         ~6
    8     8        INIT_FCALL                                                   'var_dump'
          9        SEND_VAR                                                     !3
         10        DO_ICALL                                                     
    9    11        INIT_FCALL                                                   'var_dump'
         12        SEND_VAR                                                     !2
         13        DO_ICALL                                                     
         14      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.72 ms | 1583 KiB | 14 Q