#35376 [Opn->Bgs]: Calling class instance inside other class produces memory issues
| From: | iliaa@php.net | Date: | Fri, 25 Nov 2005 01:26:48 +0000 |
| Subject: | #35376 [Opn->Bgs]: Calling class instance inside other class produces memory issues | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-88892@lists.php.net to get a copy of this message | ||
ID: 35376
Updated by: iliaa@php.net
Reported By: djmaze at cpgnuke dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Win2k
PHP Version: 5.1.0
New Comment:
Works fine in PHP 5.1.0
Previous Comments:
------------------------------------------------------------------------
[2005-11-25 02:05:46] djmaze at cpgnuke dot com
Description:
------------
I'm building a huge PHP5 script that is using classes.
However somehow by returning function data to a previous call thru
another class the data is not returned but a NULL instead.
The below script has a similar layout as mine but as i said mine is
huge, so if thisone works as expected i will figure out a way to
provide my huge reproducable bug.
Reproduce code:
---------------
<?php
class A
{
public function foo()
{
$foo = 'foo';
return $foo;
}
}
class B
{
public function bar()
{
global $A;
$bar = $A->foo();
return $bar;
}
}
class C
{
public function test()
{
global $B;
$test = $B->bar();
echo gettype($test);
}
}
$A = new A();
$B = new B();
C::test();
Expected result:
----------------
string
Actual result:
--------------
NULL
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35376&edit=1