[PHP] Casting nulls

2003-09-24 Thread Carl Furst
IF $int is null and I have a test

If($int  1) {
//do some foobar
}

will $int be evaluated as a zero? IF I cast (int) $int.. will that turn a
null $int into a zero??

Documentation aint too clear.

Thanks,

Carl.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Casting nulls

2003-09-24 Thread Robert Cummings
In the time you've waited for an answer so far, you could have made
yourself a 3 line script to find out.

Rob.


On Wed, 2003-09-24 at 11:30, Carl Furst wrote:
 IF $int is null and I have a test
 
 If($int  1) {
 //do some foobar
 }
 
 will $int be evaluated as a zero? IF I cast (int) $int.. will that turn a
 null $int into a zero??
 
 Documentation aint too clear.
 
 Thanks,
 
 Carl.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Casting nulls

2003-09-24 Thread CPT John W. Holmes
From: Carl Furst [EMAIL PROTECTED]


 IF $int is null and I have a test

 If($int  1) {
 //do some foobar
 }

 will $int be evaluated as a zero? IF I cast (int) $int.. will that turn a
 null $int into a zero??

 Documentation aint too clear.

No idea what you're doing here, but you may want to look into the isset()
and/or empty() functions for identifying NULLs.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Casting nulls

2003-09-24 Thread Gerard Samuel
If I understood the question wouldn't this work???
if (!is_null($int)  $int  1)
{
   // do some foobar
}
Carl Furst wrote:

IF $int is null and I have a test

If($int  1) {
//do some foobar
}
will $int be evaluated as a zero? IF I cast (int) $int.. will that turn a
null $int into a zero??
Documentation aint too clear.

Thanks,

Carl.

 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Casting nulls

2003-09-24 Thread Curt Zirzow
* Thus wrote Carl Furst ([EMAIL PROTECTED]):
 IF $int is null and I have a test
 
 If($int  1) {
 //do some foobar
 }


 
 will $int be evaluated as a zero? IF I cast (int) $int.. will that turn a
 null $int into a zero??

?php
echo (int) null;
?

0

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php