In PHP, the following code is valid
$a=array(0);$a[0];
but that one is invalid:
array(0)[0]
- What is the terminology corresponding to that behaviour? (has it anything to do with "dereferencing"?)
- What is the motivation behind such a behaviour (besides user spite :-P)
I am looking for the general terminology, not necessarily the terminology associated with PHP.
(Other example: in MATLAB, the following is valid:
s = size(M)
s(0)
but that is invalid:
size(M)(0)
In both PHP and MATLAB, adding parenthesis does not help, i.e., (array(0))[0]
and (size(M))(0)
are both invalid)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…