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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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: Sat Dec 21 17:01:58 2024 UTC