|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16613 Function called from class treats GLOBAL vars in different way...
Submitted: 2002-04-15 05:53 UTC Modified: 2002-04-15 19:50 UTC
From: daniel at webdevelopers dot cz Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.1.2 OS: Windows 2000, Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
45 + 30 = ?
Subscribe to this entry?

 [2002-04-15 05:53 UTC] daniel at webdevelopers dot cz
There is the line marked with '#*' in the following script. One line up you will find other line that should make the exactly same action (I think). Try to comment this line and uncomment line with '#*'. The output will differ. Why?


class test {
	function test() {

function extfunc(&$ref) {
global $obj;
	$GLOBALS["obj"]=&$ref; # This is the same as '$obj=&$ref;'. Isn't it?
	#* $obj=&$ref;

$test=new test();

--- SCRIPT: END ---


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-15 06:27 UTC] daniel at webdevelopers dot cz
Duplicate submission. Sorry.
 [2002-04-15 19:50 UTC]
Please do not submit the same bug more than once.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 12:01:29 2024 UTC