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

Zend Certification PHP 5 : Difference between isset() and other is_*() functions

P: n/a
Hello
I try to answer this question for the Zend Certification PHP 5 :
"What is the difference between isset() and other is_*() functions
(is_alpha(), is_number(), etc.)?"

Do you have a solution ?

Thanks

Dec 27 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

oggy wrote:
Hello
I try to answer this question for the Zend Certification PHP 5 :
"What is the difference between isset() and other is_*() functions
(is_alpha(), is_number(), etc.)?"

Do you have a solution ?

Thanks
Read this:
<http://www.php.net/isset>

In particular the warning that "isset() only works with variables as
passing anything else will result in a parse error" and the note that
"Because this is a language construct and not a function, it cannot be
called using variable functions."

Dec 27 '06 #2

P: n/a
thanks a lot
"isset() only works with variables" means that its not working with
constants (only).

On 27 déc, 20:21, "ZeldorBlat" <zeldorb...@gmail.comwrote:
oggy wrote:
Hello
I try to answer this question for the Zend Certification PHP 5 :
"What is the difference between isset() and other is_*() functions
(is_alpha(), is_number(), etc.)?"
Do you have a solution ?
ThanksRead this:
<http://www.php.net/isset>

In particular the warning that "isset() only works with variables as
passing anything else will result in a parse error" and the note that
"Because this is a language construct and not a function, it cannot be
called using variable functions."
Dec 28 '06 #3

P: n/a

oggy wrote:
thanks a lot
"isset() only works with variables" means that its not working with
constants (only).
That's half of it. The other half is that it won't work with the
return value of a function call (directly). Consider the following:

function foo() {
return 1;
}

//This is ok:
$x = foo();
isset($x);

//But this throws a fatal error:
isset(foo());

Dec 28 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.