I was wondering why php does not complain when we reference a non existing variable (being it a plain variable or array), is this just the way it is, or there is something e
If memory of the PHP interpreter reference var allocation serves me right, PHP will create a null element in the hash table with a key like the one you sent and reference it. This is visible by running the following test:
Until the default heap size, PHP will return exactly an extra 0 memory used - as it is still allocating already "prepared" array items (PHP keeps a few extra hash table elements empty but allocated for performance purposes). You can see this by setting it from 0 to 16 (which is the heap size!).
When you get over 16, PHP will have to allocate extra items, and will do so on i=17, i=18 etc..., creating null items in order to reference them.
P.S: contrary to what people said, this does NOT throw an error, warning or notice. Recalling an empty item without reference would - referencing an inexistent item does not. Big big BIG difference.