为什么$row[’id’] 的速度是$row[id]的7倍

$row[’id’] 的速度是$row[id]的7倍

 

这是为什么呢?

 

刚找到的

This is wrong, but it works. The reason is that this code has an undefined constant (bar) rather than a string ('bar' - notice the quotes). PHP may in future define constants which, unfortunately for such code, have the same name. It works because PHP automatically converts a bare string (an unquoted string which does not correspond to any known symbol) into a string which contains the bare string. For instance, if there is no defined constant named bar, then PHP will substitute in the string 'bar' and use that.

你可能感兴趣的:(id)