Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsVariable undefined warning for array with short array syntax
https://www.eclipse.org/forums/index.php/mv/msg/1070965/1710537/#msg_1710537
$json ['success'] = 1;
I get a warning that the variable is undefined. If I do it without short array syntax it doesn't cause a warning. I am currently using Mars 4.5.1 with PDT 3.6 and DLTK 5.3.]]>Jason Siebert2015-10-07T11:32:26-00:00Re: Variable undefined warning for array with short array syntax
https://www.eclipse.org/forums/index.php/mv/msg/1070965/1710558/#msg_1710558
$json['success'] = 1; is just array assign. PHP will throw out E_NOTICE, create array and assign 1 to success property,
correct way its:
$json = ['success' => 1];
or
$json = [];
$json['success'] = 1;
You can also disable undefined variable validator in eclipse php preferences (php / validation / semantic analysis)]]>Dawid Pakula2015-10-07T14:00:28-00:00Re: Variable undefined warning for array with short array syntax
https://www.eclipse.org/forums/index.php/mv/msg/1070965/1710643/#msg_1710643
Edit: Actually without even changing the Semantic Analysis it's working without giving me a warning. I did have a bad build file which I corrected. I also couldn't find the preference "PHP|Validation|Semantic Analysis", all I have listed under "Validation" is "Task Tags"
Any thoughts?]]>Jason Siebert2015-10-08T07:37:54-00:00Re: Variable undefined warning for array with short array syntax
https://www.eclipse.org/forums/index.php/mv/msg/1070965/1710689/#msg_1710689
http://p2.pdt-extensions.org/ as PDT Extensions.]]>Dawid Pakula2015-10-08T12:17:36-00:00Re: Variable undefined warning for array with short array syntax
https://www.eclipse.org/forums/index.php/mv/msg/1070965/1710741/#msg_1710741
Btw, would you know if there is anything that provides content assist for object oriented php. When I tried to use mysqli->close it gave me the option of ($link), but that's only for procedural php. It should be nothing since the object oriented one takes no arguments.]]>Jason Siebert2015-10-08T19:29:55-00:00