|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-25 02:26 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 12 17:00:01 2025 UTC |
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