php语言,未赋值的变量?
http://docs.php.net/manual/zh/language.types.null.php
问题:
1.
ubuntu@ubuntu:~$ php /var/www/b.php
php notice: undefined variable: x in /var/www/b.php on line 3
上面代码,第3行错了!
php语法,变量可以不赋值。
如果,变量不赋值,其值是:null。对么?
为什么编译,第3行出错呢?
分享到:
------解决方案--------------------
这与你的 php 错误检查级别设置有关
只在屏蔽掉 e_notice 级别检查时,才不会报 notice 警告
程序中 error_reporting(e_all ^ e_notice);
php.ini 中 error_reporting=e_all ^ e_notice
这少要有一个
------解决方案--------------------
错误报告级别