note 18100 added to reserved
| From: | andre at fscinternet dot com | Date: | Thu, 10 Jan 2002 16:25:44 +0000 |
| Subject: | note 18100 added to reserved | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-24624@lists.php.net to get a copy of this message | ||
Creating objects dynamically (without a class definition) can be accomplished using the stdClass
keyword.
ie.:
--<snip>--
// instantiate a new object
$oNewObject = new stdClass;
// graft a few properties onto it
$oNewObject->sFirstName = 'Andre';
$oNewObject->sEmailAddress = 'andre@fscinternet.com';
$oNewObject->iFooBar = 12345;
// display the object in it's current state
print_r( $oNewObject );
--<snip>--
Will give you the following:
stdClass Object
(
[sFirstName] => Andre
[sEmailAddress] => andre@fscinternet.com
[iFooBar] => 12345
)
Note: Using PHP v4.0.6. No guarantees about how far back or forward this'll go.
**I love this language! :)**
--
http://www.php.net/manual/en/reserved.php
http://master.php.net/manage/user-notes.php?action=edit+18100
http://master.php.net/manage/user-notes.php?action=delete+18100
http://master.php.net/manage/user-notes.php?action=reject+18100