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

Summary: >php7.0 Accessing member of freshly cloned object gives syntax error
Product: php Reporter: Tenso
Component: PHPDocAssignee: issues@php <issues>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 10 x64   
Issue Type: ENHANCEMENT Exception Reporter:

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.