XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).
Moderator: General Moderators
panic!
Forum Regular
Posts: 516 Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK
Post
by panic! » Tue Aug 08, 2006 4:51 am
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
Benjamin
Site Administrator
Posts: 6935 Joined: Sun May 19, 2002 10:24 pm
Post
by Benjamin » Tue Aug 08, 2006 5:00 am
Check your error_reporting level. It's issuing a notice or warning and assuming a constant I believe.
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Tue Aug 08, 2006 5:56 am
Notice: Use of undefined constant hello - assumed 'hello'
One of the more annoying features of php.
jmut
Forum Regular
Posts: 945 Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:
Post
by jmut » Tue Aug 08, 2006 7:00 am
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?
panic!
Forum Regular
Posts: 516 Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK
Post
by panic! » Tue Aug 08, 2006 8:17 am
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...
jmut
Forum Regular
Posts: 945 Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:
Post
by jmut » Tue Aug 08, 2006 8:55 am
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".