tags:

views:

50

answers:

2

Adobe Dreamweaver highlights the word object in PHP sources and I'm wondering why. It's definitely not the name of the generic class, which is generic (Edit: sorry, it's actually stdClass not generic, which I always define myself in all projects).

And as you might have guessed it's not easy to google for answers to this question.

A: 

http://www.php.net/manual/en/reserved.keywords.php does not include "object" (nor "generic", actually; maybe you mean stdClass?).

kevingessner
BoltClock has posted the correct answer (see above): `object` is used in typecasts
mojuba
+2  A: 

object is a data type in PHP. You typically find it in statements that cast stuff to objects. Additionally, passing an object to gettype() causes it to return the string 'object' (it's not a keyword, it just tells you that it's an actual PHP data type).

The "generic" class in PHP is stdClass. I haven't heard of generic being a PHP keyword, ever.

BoltClock
Great, thank you. (And yes, `generic` was my bad)
mojuba
You're welcome. After posting what ended up to be two nonsense answers in a row just now, I'm just glad I'm making sense again... it's late :P
BoltClock