php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1261 Cannot access an array of class objects stored in object
Submitted: 1999-03-24 04:56 UTC Modified: 1999-03-24 09:31 UTC
From: alsol at ssu dot sumy dot com Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0.6 OS: FreeBSD 3.1-RELEASE
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: alsol at ssu dot sumy dot com
New email:
PHP Version: OS:

 

 [1999-03-24 04:56 UTC] alsol at ssu dot sumy dot com
<?
class B
{
	var $y;
	function B( $n )
	{
		$this->y = "test_$n";
	}
};

class A
{
	var $x;
	function A()
	{
		$this->x[0] = new B( 0 );
		$this->x[1] = new B( 1 );
	}
};

$t = new A;
echo $t->x[1]->y;
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-03-24 09:31 UTC] rasmus
This is a known limitation in the object dereferencing code in PHP3 and will not be fixed until PHP4.  The
workaround is to dereference it in two steps like this:

$t = new A;
$tt = $t->x[1];
echo $tt->y; 
 [2011-05-16 17:34 UTC] dtajchreber@php.net
Automatic comment from SVN on behalf of dtajchreber
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=311086
Log: Doc Bug #54751 missing default value in openssl_x509_export() - added default value for notext in signature

http://lxr.php.net/opengrok/xref/PHP_5_3/ext/openssl/openssl.c#1261
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 12:01:27 2024 UTC