Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

php5 static class method access syntax error

Mentor ,
Jul 09, 2012 Jul 09, 2012

Dreamweaver is complaining about this syntax

$class = 'ClassName';

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

Is there a way to omit these error warnings?

TOPICS
Server side applications
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 10, 2012 Jul 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jul 10, 2012 Jul 10, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 11, 2012 Jul 11, 2012
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines