php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22504 new $foo->bar causes parse error
Submitted: 2003-03-02 05:12 UTC Modified: 2003-03-02 12:07 UTC
From: sander@php.net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5CVS-2003-03-02 (dev) OS: Debian Linux (unstable)
Private report: No CVE-ID: None
 [2003-03-02 05:12 UTC] sander@php.net
Consider the following snippet:

  class foo {
     var $bar = 'foo';
  }
  $foo = new foo();
  $bar = new $foo->bar; // let's call this line 5

It runs fine on ZE1, but ZE2 bails out with "parse error, unexpected
T_OBJECT_OPERATOR on line 5".

This works fine, though:
  $tmp = $foo->bar;
  $bar = new $tmp;

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-02 05:15 UTC] sander@php.net
Sorry, this is a dupe of #21669. The bugsystem doesn't show PHP5 bugs by default... :(
 [2003-03-02 12:07 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PHP.

there is that version box too in the advanced search.. :-p

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Feb 05 13:00:02 2026 UTC