Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Content Assist for self variables not working(How can I get all the class variables using self in content assist?)
Content Assist for self variables not working [message #1712031] Tue, 20 October 2015 23:26 Go to next message
Steve Fatula is currently offline Steve FatulaFriend
Messages: 5
Registered: July 2015
Junior Member
So, I prefer to use self::$variable instead of $this->variable. $this-> does show potential names via content assist. However, self:: only shows function calls, not class variables. If you enter the $ as in self::$, no names show up. I can manually type the names of course, and, then it will show the phpdoc for the name. But, kind of defeats the purpose of course having to remember or scroll and copy and paste names.

Is there a way to enable it, or, is that just a limitation of current Content Assist feature? Seems like a bug to me.
Re: Content Assist for self variables not working [message #1712033 is a reply to message #1712031] Wed, 21 October 2015 00:20 Go to previous messageGo to next message
Mark Dexter is currently offline Mark DexterFriend
Messages: 324
Registered: July 2009
Senior Member
Hi. self and this are not interchangeable. "self" is for static class fields and functions, "this" is for non-static members. Content assist works fine for me with self -- it shows all static members but not the non-static (normal or automatic?) members. Hope that helps. Mark
Re: Content Assist for self variables not working [message #1712061 is a reply to message #1712031] Wed, 21 October 2015 07:24 Go to previous message
Dawid Pakula is currently offline Dawid PakulaFriend
Messages: 291
Registered: March 2013
Senior Member
In general self:: should be used to access static members only.

Using it to call non-static methods will throw out E_STRICT.
Using it to access non-static variables, will throw out fatal error on php 5.6

If you thing that after self:: we should show non-static variables open a bug on PDT Bugzilla: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=PDT


Previous Topic:class constant parser bug
Next Topic:Couldn't run PHP webpage
Goto Forum:
  


Current Time: Tue Apr 16 19:56:41 GMT 2024

Powered by FUDForum. Page generated in 0.44184 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top