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 188160 - Parameters list cannot be invoked after array
Summary: Parameters list cannot be invoked after array
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0
Hardware: PC Windows 7 x64
: P2 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-28 14:57 UTC by Raazy
Modified: 2011-02-19 10:32 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raazy 2010-06-28 14:57:28 UTC
----------------------------------------------------------------------------------------
Product Version = NetBeans IDE 6.9 (Build 201006101454)
Operating System = Windows Vista version 6.0 running on x86
Java; VM; Vendor = 1.6.0_17
Runtime = Java HotSpot(TM) Client VM 14.3-b01
----------------------------------------------------------------------------------------

When you passing an array as an parameter, invocation the rest of parameters declared after such parameter does not work.

How to reproduce:

<?php

function foo($a, $b, array $c, $d, $e) {
	//nothing
}

//this does not work after third parameter:
foo("a", "b", array("c"), "d", "e"); //list of parameters does not work after third parameter

//this works as expeceted
$c = array("c");
foo("a", "b", $c, "d", "e");  // if an array is passed as simple variable, it works


?>

This also apply if function i a method within class.

Thanks,
Raazy
Comment 1 Raazy 2010-07-01 11:30:50 UTC
It also doesn't work after you use other function call within parenthesis:
$color = imagecolorallocatealpha($image, 1, mt_rand(0, $o_contrast), mt_rand(0, $o_contrast), self::$object_alpha);
Parameter list of imagecolorallocatealpha works until 3rd parameter, after it fails.

It seems it is caused by other parenthesis within function parenthesis:
str_replace( ($expression==1?$one:$two), $replace, $subject); //after 1st parameter fails

but this:
str_replace( "search", (int)$replace, $subject);
is working.

R.
Comment 3 Quality Engineering 2010-08-17 03:15:16 UTC
Integrated into 'main-golden', will be available in build *201008170001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/b9342ce4eb45
User: Radek Matous <rmatous@netbeans.org>
Log: #188160 - Parameters list cannot be invoked after array
Comment 4 Filip Zamboj 2010-08-17 13:34:07 UTC
Product Version: NetBeans IDE Dev (Build 100817-0818e024a845)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01

verified
Comment 5 Raazy 2011-01-13 10:36:23 UTC
I does not work again

Product Version: NetBeans IDE Dev (Build 2011-01-13_03-03-33 )
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Windows Vista version 6.1 running on x86; Cp1250; cs_CZ (nb)
Comment 6 Raazy 2011-01-28 13:53:20 UTC
Problem exists also in this:

Product Version: NetBeans IDE Dev (Build 2011-01-28_09-04-45 )
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Windows Vista version 6.1 running on x86; Cp1250; cs_CZ (nb)
Comment 7 Raazy 2011-01-28 14:09:37 UTC
I just discovered, that this error is related to member functions
within the class. Try this piece of code

<?php



class Foo {
	
	public static function a($a,$b,$c) {
	}
	private static function b($a,$b,$c) {
	}
	public function c($a,$b,$c) {
	}
	private function d($a,$b,$c) {
	}
	protected function e($a,$b,$c) {
	}
	
	function __construct() {
		$b = " a ";
		self::a( $b, trim($b), $b);//after 2nd parameter fails
		self::b( $b, trim($b), $b);//after 2nd parameter fails
		$this->c($b, trim($b), $b);//after 2nd parameter fails
		$this->d($b, trim($b), $b);//after 2nd parameter fails
		$this->e($b, trim($b), $b);//after 2nd parameter fails
	}
	
}


//but plain function are OK
function a($a,$b,$c) {
}

a("", trim(' '), '');//after 2nd parameter OK
?>
Comment 8 Petr Pisl 2011-02-18 09:06:28 UTC
Should be fixed now in web-main.
Comment 9 Quality Engineering 2011-02-19 10:32:50 UTC
Integrated into 'main-golden', will be available in build *201102190501* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/d94c82e4f2b3
User: Petr Pisl <ppisl@netbeans.org>
Log: #188160 - Parameters list cannot be invoked after array