php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4293 global doesn't work with class references but $GLOBALS do
Submitted: 2000-05-02 10:36 UTC Modified: 2000-05-31 10:21 UTC
From: frip at bigfoot dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Release Candidate 1 OS: AIX 4.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: frip at bigfoot dot com
New email:
PHP Version: OS:

 

 [2000-05-02 10:36 UTC] frip at bigfoot dot com
global $ACTUAL_FORM;

$form = new my_class;
    
$GLOBALS["ACTUAL_FORM"] = &$form;
#$ACTUAL_FORM = &$form;

If we consider both lines equivalent for any other kind of variables, the second one doesn't work for class references.

Here are my compilation options:

Configure command: './configure' '--with-apache=../apache_1.3.12' '--enable-track-vars'
'--prefix=/soft/php-4.0RC1' '--with-yp' '--with-sybase-ct=/soft/sybase'
'--with-ldap=/soft/openldap-1.2.1' '--with-gdbm=/soft/gdbm-1.7.3' '--with-gd=/soft/gd-1.7.3'
'--with-zlib=/soft/zlib-1.1.3' '--enable-sysvshm' '--enable-sysvsem' '--enable-xml'
'--with-mysql=/soft/mysql-3.22.27' '--enable-trans-sid' '--disable-debug'

Greetings

Frip'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-05-31 10:21 UTC] stas at cvs dot php dot net
Not a bug. This is how it should work.
global $ACTUAL_FORM assigns local variable to be reference to global one.
If you re-assign it with another reference, it loses previous assignment.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 28 11:01:30 2024 UTC