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

Strange parse error with method call

P: n/a
Dear people,

How is it possible that this gives a parse error:
if (! empty($this->zoekopdracht->get_gezochte_vraagnummers()))
$vraagnummers_bijhouden = TRUE;

-> Parse error: parse error, unexpected '(', expecting ')'
And this does not:
$a = $this->zoekopdracht->get_gezochte_vraagnummers();
if (! empty($a))
$vraagnummers_bijhouden = TRUE;
As far as I can see, these two should be completely equivalent.

Any ideas?
Thanks,
Jan Pieter Kunst

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Jan Pieter Kunst wrote:
How is it possible that this gives a parse error:
if (! empty($this->zoekopdracht->get_gezochte_vraagnummers()))
$vraagnummers_bijhouden = TRUE;

-> Parse error: parse error, unexpected '(', expecting ')'
And this does not:
$a = $this->zoekopdracht->get_gezochte_vraagnummers();
if (! empty($a))
$vraagnummers_bijhouden = TRUE;
As far as I can see, these two should be completely equivalent.

Any ideas?


Funny :)

Seems like you can only test variables for emptiness.
.... It makes sense in a way, too
if (empty(rand())) <== error
$a = rand(); if (empty($a)) <== ok

if (empty(3+7)) <== error
$a = 3+7; if (empty($a)) <== ok

$a='b'; $b='a'; if (empty($a.$b)) <== error
$a='b'; $b='a'; $c=$a.$b; if (empty($c)) <== ok

--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.