This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 270402 - >php7.0 Accessing member of freshly cloned object gives syntax error
Summary: >php7.0 Accessing member of freshly cloned object gives syntax error
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: PHPDoc (show other bugs)
Version: 8.2
Hardware: PC Windows 10 x64
: P3 normal (vote)
Assignee: issues@php
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-14 14:51 UTC by Tenso
Modified: 2017-04-14 14:51 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tenso 2017-04-14 14:51:38 UTC
As it's stated in php documentation here: 
http://php.net/manual/en/language.oop5.cloning.php

"PHP 7.0.0 introduced the possibility to access a member of a freshly cloned object in a single expression"

When I'm trying to do so with example:

$start = new \DateTime($data['start']);

$dates[] = (clone $start)->add($interval); //<-this line gives syntax error


I get following warning in NetBeans:

Syntax error
 unexpected:	->
 after:	)

But code is parsed and executed in browser without any errors.