Page 1 of 1

php.ini: strings outside of quotes

Posted: Tue Aug 08, 2006 4:51 am
by panic!
Hello all,

for some reason in my scripts i can use


print hello;

instead of

print "hello";

and they both do the same thing, is there anyway I can make this throw up an error instead of letting me print it?

-Thanks in advance

Posted: Tue Aug 08, 2006 5:00 am
by Benjamin
Check your error_reporting level. It's issuing a notice or warning and assuming a constant I believe.

Posted: Tue Aug 08, 2006 5:56 am
by volka
Notice: Use of undefined constant hello - assumed 'hello'
One of the more annoying features of php.

Posted: Tue Aug 08, 2006 7:00 am
by jmut
volka wrote:
Notice: Use of undefined constant hello - assumed 'hello'
One of the more annoying features of php.
sorry for offtopic but why is this annoying feature?

Posted: Tue Aug 08, 2006 8:17 am
by panic!
I dunno if you're talking to me.

but i just think being able to use


print hello;

could potentially bring up some weird stuff.

like maybe if i used

print mysql_error instead of mysql_error()

by accident...

Posted: Tue Aug 08, 2006 8:55 am
by jmut
panic! wrote:I dunno if you're talking to me.

but i just think being able to use


print hello;

could potentially bring up some weird stuff.

like maybe if i used

print mysql_error instead of mysql_error()

by accident...
just develop on error_reporting(E_ALL)

as long as you don't have notices,warnings etc...
there will be no accident/weird stuff. programming language cannot protect you from "shooting yourself".