为什么PHP变量要以$开头

查看:181
本文介绍了为什么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 shell

scripting:
http://en.wikipedia.org/wiki/Sigil_%28computer_programming%29

http://stackoverflow.com/questions/3073812/why-php-variables-start-with-a-sign-symbol

这篇关于为什么PHP变量要以$开头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆