[php-objects] FW: types in php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is there any way to tell what type a variable is?  My problem is this:

I query a db table for a primary key that is an integer.  If the key exists
I return it,
otherwise I return false.  Then I can do some like this:

$key = getKey("bob");
//if false was not returned
if ($key) {
	//do stuff
}

But what happens if I get back a key of 0, since 0 in php is equivalent to
false?  Is there any way to check whether
$key came back as an int or a bool?

Thanks

---
Rob

**************************
Rob Cherry
mailto:rob@jamwarehouse.com
+27 21 447 7440
Jam Warehouse RSA
Smart Business Innovation
http://www.jamwarehouse.com
**************************


-----Original Message-----
From: Markus Wolff [mailto:wolff@21st.de]
Sent: Friday, December 13, 2002 1:43 PM
To: php-objects@yahoogroups.com
Subject: Re: [php-objects] Using object


Am Fri, 13 Dec 2002 12:40:48 +0100 schrieb Markus Wolff <wolff@21st.de>:

> This is what PHP does not offer:
>
> - Interfaces
> - Multiple inheritance
> - Method overloading
> - Private classes/methods/properties
> - Sophisticated object dereferencing
> - Passing objects by reference as a default
> - Standardized error handling with try/throw/catch
>
> ...at least the last three points will be resolved with PHP5, but I
> don´t think we´ll see a release before another 6-8 months :-(

Oops, make that the last _four_ points :-)

--
*21st Media*    | Consulting, Konzeption, Produktion für die Bereiche:
Markus Wolff    | Internet, Intranet, eCommerce, Content Management,
Hamburg,Germany | Softwareentwicklung, 3D-Animation, Videostreaming
http://21st.de  | Tel. [+49](0)40/6887949-0, Fax: [+49](0)40/6887949-1



Look here for Free PHP Classes of objects:
http://phpclasses.UpperDesign.com/
To unsubscribe from this group, send an email to:
php-objects-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/






------------------------ Yahoo! Groups Sponsor ---------------------~-->
Flexible Keyboard is the ideal accessory for PDA users that are on the move.
http://us.click.yahoo.com/dCBVZC/WnCFAA/xGHJAA/saFolB/TM
---------------------------------------------------------------------~->

Look here for Free PHP Classes of objects:
http://phpclasses.UpperDesign.com/
To unsubscribe from this group, send an email to:
php-objects-unsubscribe@egroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux