php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31141 wrong type of variable reference with DOMDocument Class
Submitted: 2004-12-17 01:31 UTC Modified: 2005-01-11 11:40 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: saschal at saschal dot ch Assigned:
Status: Closed Package: DOM XML related
PHP Version: 5.0.3 OS: Win 32 / Linux
Private report: No CVE-ID: None
 [2004-12-17 01:31 UTC] saschal at saschal dot ch
Description:
------------
If my test class is extended with the DOMDocument class, the alias variable becomes a wrong type (NULL).


Reproduce code:
---------------
class Test extends DOMDocument
{
	public $array = array();

	function __construct()
	{
        parent::__construct();

        if(!$ar_test) {
            $ar_test = array();
        }
        $this->array = &$ar_test;
        echo gettype($this->array);
	}
}
$newtest = new Test;

// $this->array is NULL

Expected result:
----------------
type should be array

Actual result:
--------------
type is NULL

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-17 04:17 UTC] jed@php.net
I can verify this on Win32, but please fill in your OS. Are you using Win32 as well?
 [2004-12-17 09:07 UTC] saschal at saschal dot ch
I use win32 XAMPP 1.4.10 ( http://www.apachefriends.org/en/xampp-windows.html )
and 
Linux PHP 5.0.3RC2 (cli) (built: Dec 15 2004 14:43:51)
 [2004-12-17 12:29 UTC] saschal at saschal dot ch
I installed a testsystem (Linux / Apache 2 / PHP 5.03) on my public-server. There you can see the problem:
http://knowhow.ethz.ch:81/php/testclass.php
 [2004-12-17 16:53 UTC] chregu@php.net
I can reproduce that with 5.0.4-dev, but not with 5.0.2. Something has changed ;)
 [2004-12-25 15:00 UTC] georg@php.net
Sams problem in mysqli. Assigned to myself 
 [2005-01-11 11:40 UTC] rrichards@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 01:01:30 2024 UTC