|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2826 $a->b[$i]->c does not work
Submitted: 1999-11-25 07:05 UTC Modified: 1999-11-25 13:35 UTC
From: svassili at midway dot uchicago dot edu Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0.11 OS: Windows NT Server 4.0
Private report: No CVE-ID: None
 [1999-11-25 07:05 UTC] svassili at midway dot uchicago dot edu
The following script gives parser error on the last line:

class Sample{
   var $b;
   function Sample(){
      $b[] = new Crash;    

class Crash{
   var $c; 

$a = new Sample;

As I understand there is only one way to modify the content of property $a->b[0]->c:
But it is too awkward.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-11-25 13:35 UTC] rasmus at cvs dot php dot net
Yes, it is a limitation of the parser in PHP 3.  Fixed in PHP 4.  Your workaround is the solution.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 08 23:01:28 2023 UTC