Re: [PHP] Unable to return object references from functions

2001-12-16 Thread Manuel Lemos
Hello, Tom Rogers wrote: > > Hi > What is the scope of the array that holds the object ? global > Maybe a bit of code to show what you are after :) It is to implement another function that will return a reference (not a copy) of a object stored in a global array passing the index of the array

Re: [PHP] Unable to return object references from functions

2001-12-16 Thread Tom Rogers
Hi What is the scope of the array that holds the object ? Maybe a bit of code to show what you are after :) Tom At 03:37 PM 17/12/01, Manuel Lemos wrote: >Hello, > >Tom Rogers wrote: > > > > Hi again > > Got a bit sidetracked ... here is your original code :) > >Thanks, I managed to make it work

Re: [PHP] Unable to return object references from functions

2001-12-16 Thread Manuel Lemos
Hello, Tom Rogers wrote: > > Hi again > Got a bit sidetracked ... here is your original code :) Thanks, I managed to make it work for me similarly to that. Now, a different problem, I already have array variable with a object. Is there a way to make a function return a reference to that object

Re: [PHP] Unable to return object references from functions

2001-12-15 Thread Tom Rogers
Hi again Got a bit sidetracked ... here is your original code :) class test_class2 { var $dummy="nothing"; }; Function not_assigning(&$not_returned,&$copy) { global $object; $object = new test_class; $object->dummy="original"; $success=1; $n

Re: [PHP] Unable to return object references from functions

2001-12-15 Thread Tom Rogers
Hi Is this doing what you want, seems you have to use an array to create the ref (just getting a handle on objects :) dummy="original"; $success=1; $copy=$object; $copy->dummy="copy"; $returned[] = &$object; var_dump("In the function"

[PHP] Unable to return object references from functions

2001-12-14 Thread Manuel Lemos
Hello, I am trying to return a reference from an object created inside a function and at the same time have the object stored in a global variable. It seems that when I try doing it by assigning the object reference to a function argument that is passed by reference, nothing is returned in that