Where is stdClass defined?

kriskd - March 18, 2008 - 00:01

Due in large part to Drupal and how much I love it, I enrolled myself in a PHP class at the local community college this semester so I could really understand Drupal better.

Throughout the code I am seeing the stdClass instantiated with new stdClass() of course. However, I can not find in the code where stdClass is defined. I'm looking for something like this:

class stdClass
{
definition goes here
}

Can someone tell me where to find this, or if it does not exist, why not? If it does not exist, maybe a link to something to read so you're not all trying to give me a PHP lesson?

Thanks for taking the time to answer this. I'm loving my PHP class and doing well in it. Hopefully someday I'll be able to give something back to Drupal!

stdClass is defined by PHP

nevets - March 18, 2008 - 00:17

stdClass is defined by PHP, that is it is builtin to PHP.

stdClass is the base class

jscoble - March 18, 2008 - 00:17

stdClass is the base class for PHP.

$foo = new stdClass();
$foo->bar = 'bar';
$foo->hello = 'hello world';

Still curious

kriskd - March 18, 2008 - 00:33

Keeping in mind there is nothing I'm trying to do with this, just learn more about it.

With that said where can I find (ie, documentation) what variables and functions are defined in it and how to use it?

php.net

jscoble - March 18, 2008 - 01:42

php.net

 
 

Drupal is a registered trademark of Dries Buytaert.