# overload extension

- Thread: https://externals.io/message/4928
- Original archive: https://news-web.php.net/php.internals/4928
- Started by LingWitt@insightbb.com on 2003-10-22T23:33:24+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #4928 — LingWitt@insightbb.com — 2003-10-22T23:33:24+00:00

URL: https://externals.io/message/4928#4928

The methods of an object that has been passed to the overload() 
function lose their ability to have parameters passed by reference. For 
example:

class Foo
{
     function hello(&$array)
     {
         $array[] = "hello";
     }
}

$array = null;
$foo = & new foo();
$foo->hello($array);
print_r($array)

Output:
Array
(
     [0] => hello
)

class Foo extends PEAR_Autoloader
{
     function hello(&$array)
     {
         $array[] = "hello";
     }
}

$array = null;
$foo = & new foo();
$foo->hello($array);
print_r($array)

Output:

Nothing!

---

## #4930 — Dennis Sterzenbach — 2003-10-22T23:43:34+00:00

URL: https://externals.io/message/4928#4930 · In reply to: #4928

Hi,

> The methods of an object that has been passed to the overload()
> function lose their ability to have parameters passed by
> reference. For
> example:
>
> class Foo
> {
>      function hello(&$array)
>      {
>          $array[] = "hello";
>      }
> }
>
> $array = null;
> $foo = & new foo();
> $foo->hello($array);
> print_r($array)
>
> Output:
> Array
> (
>      [0] => hello
> )
>
> class Foo extends PEAR_Autoloader
> {
>      function hello(&$array)
>      {
>          $array[] = "hello";
>      }
> }
>
> $array = null;
> $foo = & new foo();
> $foo->hello($array);
> print_r($array)
>
> Output:
>
> Nothing!

I'm not into this topic, but I suppose you should send a bug
report about it (visit http://bugs.php.net and enter info there).
This should then enable the php internal people to refer to that
bug when fixing the problem and committing the changes needed.

Regards
  Dennis

---

## #4934 — Alan Knowles — 2003-10-23T00:47:54+00:00

URL: https://externals.io/message/4928#4934 · In reply to: #4928

There is already a bug report on it, however It sounds like it's 
unlikely to be fixed in PHP4...

Regards
Alan

LingWitt@insightbb.com wrote:
> The methods of an object that has been passed to the overload() function 
> lose their ability to have parameters passed by reference. For example:
> 
> class Foo
> {
>     function hello(&$array)
>     {
>         $array[] = "hello";
>     }
> }
> 
> $array = null;
> $foo = & new foo();
> $foo->hello($array);
> print_r($array)
> 
> Output:
> Array
> (
>     [0] => hello
> )
> 
> class Foo extends PEAR_Autoloader
> {
>     function hello(&$array)
>     {
>         $array[] = "hello";
>     }
> }
> 
> $array = null;
> $foo = & new foo();
> $foo->hello($array);
> print_r($array)
> 
> Output:
> 
> Nothing!
> 


-- 
Can you help out?
Need Consulting Services or Know of a Job?
http://www.akbkhome.com
