mojuba
mojuba

Reputation: 12227

Does the word "object" have any special meaning in PHP?

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.

Upvotes: 0

Views: 83

Answers (2)

BoltClock
BoltClock

Reputation: 723708

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.

Upvotes: 2

kevingessner
kevingessner

Reputation: 18985

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

Upvotes: 0

Related Questions