php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70663 Object operator not accepted after parenthesis enclosing assignment
Submitted: 2015-10-07 21:42 UTC Modified: 2015-10-07 21:44 UTC
From: teo8976 at gmail dot com Assigned: nikic (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.6.14 OS:
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: teo8976 at gmail dot com
New email:
PHP Version: OS:

 

 [2015-10-07 21:42 UTC] teo8976 at gmail dot com
Description:
------------
See below

Test script:
---------------
<?php

class Test {
    public $test=3;
}

echo ($test=new Test())->test;

Expected result:
----------------
3

Actual result:
--------------
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting ',' or ';'


I may be wrong but I seem to remember the same bug with the [] operator being fixed ages ago.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-07 21:44 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2015-10-07 21:44 UTC] nikic@php.net
This will be supported in PHP 7, see https://wiki.php.net/rfc/uniform_variable_syntax.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 07 12:01:35 2025 UTC