Skip to main content
Damon Edwards
Inspiring
July 9, 2012
Question

php5 static class method access syntax error

  • July 9, 2012
  • 1 reply
  • 1355 views

Dreamweaver is complaining about this syntax

$class = 'ClassName';

$class::method(); // static method

Is there a way to omit these error warnings?

This topic has been closed for replies.

1 reply

David_Powers
Inspiring
July 10, 2012

I haven't done much work with PHP classes recently, but your first line of code is assigning a string to $class. Are you sure that a class can be assigned to a variable in that way?

Dreamweaver's syntax checker is compliant with PHP 5.3. So unless it's a new feature in PHP 5.4, the error message should be correct.

Damon Edwards
Inspiring
July 11, 2012

Yea, as of 5.3 that's valid and it's in running as we type

edit: http://php.net/manual/en/language.oop5.paamayim-nekudotayim.php

David_Powers
Inspiring
July 11, 2012

Thanks for pointing out the reference to the change in PHP syntax.

To the best of my knowledge, there is no way to turn off the syntax checking. You can turn off code hints, but that doesn't have any effect on the syntax checker.

I suggest that you file a bug report to Adobe using the form at https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform. Include the reference to the syntax change with your report.