creating objects on the fly
| From: | Brian Moon | Date: | Sun, 15 Aug 1999 03:48:46 +0000 |
| Subject: | creating objects on the fly | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-9861@lists.php.net to get a copy of this message | ||
I was coding along and thought, "You know it would be cool if I could create
an object like I can an array."
So, I figured it would be possible to create a PHP function called object()
that acted just like array. I know I can use basically (object)array() and
do it, But why not put it in PHP. I figured it could just call array() and
then set the var to an object before it returned it. So, I started looking
for the array() function in the PHP 3.0.11 source I have and could not find
it.
A. Are there any reasons this could or should not be done.
B. Where is the array function?
Brian.
PS. I would also like to do a create_object and create_array function that
would take only indices as parameters instead of the values and/or indices
like array does? Thoughts?