0

I am using Dreamweaver CS6 at work for primarily PHP programming. The code-hinting/code-completion features which Dreamweaver provides are often highly valuable in our workflow, especially when code is being written by one person and used by another. Of course, code hinting is not exactly trivial in PHP; the loosely typed nature of the language means that not every variable's type can be known to Dreamweaver while the code is being written. We have managed to work around this limitation where it matters by ensuring that we keep a clear chain of function argument type hinting leading to the variables we care about. However, we have encountered a very strange case where Dreamweaver fails, and I'm hoping someone can shed some light on why this is happening, and ideally how to fix it.

Dreamweaver is incapable of code hinting in some situations when one of the variables involved contains a capital letter. An example:

class MyClass {
  public $var;
}

function foo(MyClass $foo) {
  return $foo;
}

$bar = foo($foo);
$foo = $bar;
$foo->var;  //Code hinting works here

$fooBar = foo($foo);
$barFoo = $fooBar;
$barFoo->var; //Code hinting fails here

Does anyone know why this happens, or if there is a way to fix it besides just using lowercase only variable names? Note that these issues will occur even if the examples are created in different files, or done in a different order, and pressing Ctrl+Space will still not bring up the code completion dropdown. If it matters, we have site-specific code hinting enabled for the directory which holds most of our library code. We are not using any major PHP framework.

David Sherron
  • 153
  • 1
  • 7
  • 1
    are you completely restricted on your choice of IDE? Netbeans, eclipse or PHPStorm are far better – DevDonkey Nov 12 '14 at 21:52
  • @MattHolbrook-Bull at the moment, yes. I could try to push for a different IDE to be adopted, but I would have to show at least equivalent functionality and enough of a benefit to convince my boss to use something not familiar to him. Is there a good resource you know of that I could use to easily compare the functionality of various IDEs with Dreamweaver? At the least, integrated FTP and SVN is a must. – David Sherron Nov 12 '14 at 22:00
  • Both netbeans and eclipse are free and PHPStorm you can trial for free. All contain those requirements and many more. I'm a contract developer and I've rarely seen an other choices used professionally. Dreamweaver is very limited for php. – DevDonkey Nov 13 '14 at 08:14

0 Answers0