扫码关注官方订阅号
说实话很多年不用PHP就是因为嫌变量前的这个符号麻烦。。别喷我,我只想知道有没有这方面的消息。
ringa_lee
美帝人民爱钱嘛,如果中国人发明的语言,估计用¥开头,jQuery也是到处$
¥
jQuery
$
Because PHP was based on Perl which used $, though the symbols Perl used were meaningfuland plenty used to indicate the data type, ( such as @ used to indicate an array ) PHP just has $
应该是没可能去掉的,而且有了$,定义变量自由,不用考虑保留字问题了,比如$class,$function,还有变量的变量$a = 'b';$b = 'c';echo $$a;,不用担心像python定义一个list=1就把真正的list覆盖了
$class,$function
$a = 'b';$b = 'c';echo $$a;
python
list=1
list
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
美帝人民爱钱嘛,如果中国人发明的语言,估计用
¥
开头,jQuery
也是到处$
Because PHP was based on Perl which used $, though the symbols Perl used were meaningfuland plenty used to indicate the data type, ( such as @ used to indicate an array ) PHP just has $
应该是没可能去掉的,而且有了
$
,定义变量自由,不用考虑保留字问题了,比如$class,$function
,还有变量的变量$a = 'b';$b = 'c';echo $$a;
,不用担心像python
定义一个list=1
就把真正的list
覆盖了