By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 941 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Why did this not give an error?

P: n/a
This line

while(!adminok && ($i>=0))

was missing a $-sign, should be while(!$adminok && ($i>=0))

Though, it did not give an error, and I do not have any adminok
elsewhere... so how come, that it accepted this, and the programme
failed instead...?

WBR
Sonnich

Dec 17 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
This line
>
while(!adminok && ($i>=0))

was missing a $-sign, should be while(!$adminok && ($i>=0))

Though, it did not give an error, and I do not have any adminok
elsewhere... so how come, that it accepted this, and the programme
failed instead...?
Probably because error display was off and you did not provide any error
handling. Mind you, not displaying errors is good on a production
machine, as it won't help any hackers by showing internals of your code.

Furthermore, any word that is not defined as a constant and used as a
value is taken as an unquoted string. So your code actually was treated as:

while(!'adminok' && ($i>=0))

Regards,
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Dec 17 '07 #2

P: n/a
On Dec 17, 9:47 am, Willem Bogaerts
<w.bogae...@kratz.maardanzonderditstuk.nlwrote:
This line
while(!adminok && ($i>=0))
was missing a $-sign, should be while(!$adminok && ($i>=0))
Though, it did not give an error, and I do not have any adminok
elsewhere... so how come, that it accepted this, and the programme
failed instead...?

Probably because error display was off and you did not provide any error
handling. Mind you, not displaying errors is good on a production
machine, as it won't help any hackers by showing internals of your code.
Error handling is on...
Furthermore, any word that is not defined as a constant and used as a
value is taken as an unquoted string. So your code actually was treated as:

while(!'adminok' && ($i>=0))
But this might explain it.
Dec 17 '07 #3

P: n/a
Error handling is on...
>
>Furthermore, any word that is not defined as a constant and used as a
value is taken as an unquoted string. So your code actually was treated as:

while(!'adminok' && ($i>=0))

But this might explain it.
I think such an unquoted string generates a warning and not an error...

--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Dec 17 '07 #4

P: n/a
Though, it did not give an error, and I do not have any adminok
elsewhere...
Probably because your error level is misconfigured, which - in my opinion -
means "not E_ALL || E_STRICT".
So the warning(?) that the undefined constant was taken as string has not
been displayed.
Dec 17 '07 #5

P: n/a
..oO(jodleren)
>Error handling is on...
Set error_reporting to E_ALL|E_STRICT in your php.ini.

Micha
Dec 17 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.