3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = []; // Create empty array var_dump($array); echo "-----\n"; $array = ['abc']; // Assign the value ['abc'] (array with one element 0 => 'abc' to $array) var_dump($array); echo "-----\n"; $array[] = 'abc'; // Add a new element to the array 'abc' var_dump($array); echo "-----\n"; $array += [0 => 'NEWabc', 4 => 'anotherABC']; // Concats two arrays, but the key [0] is already existing in the left-handside array so it ignores the first value from the right hand side array and only adds the second element (key 4 is not existing) var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CmahA
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    6     4        ECHO                                                     '-----%0A'
    8     5        ASSIGN                                                   !0, <array>
   10     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   11     9        ECHO                                                     '-----%0A'
   13    10        ASSIGN_DIM                                               !0
         11        OP_DATA                                                  'abc'
   15    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
   16    15        ECHO                                                     '-----%0A'
   18    16        ASSIGN_OP                                     1          !0, <array>
   20    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.3 ms | 1399 KiB | 15 Q