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
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: 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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 12:01:32 2024 UTC