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 248213 - Syntax error for PHP 5.6 variadic arguments by reference
Summary: Syntax error for PHP 5.6 variadic arguments by reference
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.1
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Tomas Mysik
URL:
Keywords:
: 248571 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-10-27 17:04 UTC by ch1902
Modified: 2015-11-06 02:29 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch (1.48 MB, patch)
2015-10-28 13:19 UTC, junichi11
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ch1902 2014-10-27 17:04:31 UTC
PHP 5.6 supports variadic function arguments with the ... operator; the variadic arguments can also be passed by reference using &... according to the docs, http://php.net/manual/en/functions.arguments.php#example-176.

Netbeans throws a syntax error (after: & expected: variable) for each of the following definitions using &...$args 

-------
<?php

interface I
{
   public function test (&...$args);
}

trait T {
   public function test (&...$args) {
      var_dump($args);
   }
}

class A implements I {
   public function test (&...$args) {
      var_dump($args);
   }
}

function C (&...$args) {
   var_dump($args);
}
Comment 1 berridgeab 2014-11-14 09:13:12 UTC
*** Bug 248571 has been marked as a duplicate of this bug. ***
Comment 2 junichi11 2015-10-28 13:19:47 UTC
Created attachment 157023 [details]
patch

I've fixed. I hope that there are no missing things.

NOTE: I fixed CodeUtils.getParamDisplayName(). It is used in the doFunctionDeclaration method of DocRenderer class. But I don't know how to run it (steps).

Thanks.
Comment 3 junichi11 2015-10-28 13:23:36 UTC
Tomas, I created a patch for this issue.

Thanks.
Comment 4 Tomas Mysik 2015-11-05 11:49:07 UTC
Patch applied, thanks a lot!

http://hg.netbeans.org/web-main/rev/850409a591dc
Comment 5 Quality Engineering 2015-11-06 02:29:40 UTC
Integrated into 'main-silver', will be available in build *201511060002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/850409a591dc
User: Tomas Mysik <tmysik@netbeans.org>
Log: #248213 - Syntax error for PHP 5.6 variadic arguments by reference

Patch contributed by junichi11@netbeans.org.