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 210521 - PHP predefined variables $argc and $argv not well handled
Summary: PHP predefined variables $argc and $argv not well handled
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.1.1
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords: SIMPLEFIX
: 210696 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-04-02 10:41 UTC by maxevron
Modified: 2012-04-04 13:11 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 maxevron 2012-04-02 10:41:08 UTC
Product Version = NetBeans IDE 7.1.1 (Build 201203091344)
Operating System = Linux version 3.0.0-17-generic-pae running on i386
Java; VM; Vendor = 1.6.0_23
Runtime = OpenJDK Client VM 20.0-b11

Netbeans considers $argc and $argv as regular PHP variables whereas they are predifined variables (like $_SERVER, etc.). As a result, Netbeans displays a warning icon in IDE informing these variables seems to be uninitialized.
Comment 1 Ondrej Brejla 2012-04-02 12:51:24 UTC
Fixed in web-main: http://hg.netbeans.org/web-main/rev/935ebeb36744
Comment 2 Quality Engineering 2012-04-03 11:13:03 UTC
Integrated into 'main-golden', will be available in build *201204030400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/935ebeb36744
User: Ondrej Brejla <obrejla@netbeans.org>
Log: #210521 - PHP predefined variables $argc and $argv not well handled
Comment 3 maxevron 2012-04-03 11:19:23 UTC
Inspecting changes in 
php.editor/src/org/netbeans/modules/php/editor/verification/UninitializedVariableHint.java, I noticed some other predefined variables are missing :

$php_errormsg — The previous error message
$HTTP_RAW_POST_DATA — Raw POST data
$http_response_header — HTTP response headers

See http://www.php.net/manual/en/reserved.variables.php

Same thing for php.editor/test/unit/data/testfiles/verification/testUninitializedVariableHint.php
Comment 4 maxevron 2012-04-03 11:20:04 UTC
Marked Resolved incomplete for revision
Comment 5 Ondrej Brejla 2012-04-03 11:41:36 UTC
Fixed in web-main: http://hg.netbeans.org/web-main/rev/5549acf6b0da
Comment 6 maxevron 2012-04-03 11:43:29 UTC
Thanks for being so reactive. :)
Comment 7 Ondrej Brejla 2012-04-03 11:44:17 UTC
You are welcome ;)
Comment 8 Quality Engineering 2012-04-04 10:10:13 UTC
Integrated into 'main-golden', will be available in build *201204040400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/5549acf6b0da
User: Ondrej Brejla <obrejla@netbeans.org>
Log: #210521 - PHP predefined variables $argc and $argv not well handled (just another variables)
Comment 9 Ondrej Brejla 2012-04-04 13:11:18 UTC
*** Bug 210696 has been marked as a duplicate of this bug. ***