为什么PHP变量要以$开头
问题描述
为什么PHP变量要以$开头???
$$又是什么意思?
Because PHP was based on Perl which used $, though the symbols Perl used were meaningful and plenty used to indicate the data type, ( such as @ used to indicate an array ) PHP just has
$
.PHP in its early stages was a simplistic version of Perl but over time incorporated more of Perl's features, though one may argue PHP is still a simplistic primitive version of Perl since to this day most installed versions of it don't include features that have been around in other languages forever, such as closures/namespacing.
http://en.wikipedia.org/wiki/PHP
Larry Wall, the creator of Perl, was inspired to use
$
from shellscripting:
http://en.wikipedia.org/wiki/Sigil_%28computer_programming%29
http://stackoverflow.com/questions/3073812/why-php-variables-start-with-a-sign-symbol
这篇关于为什么PHP变量要以$开头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!