7 kyu

Object-Oriented PHP #3 - Class Constants and Static Methods

Description
Loading description...
Fundamentals
Tutorials
Object-oriented Programming
  • Please sign in or sign up to leave a comment.
  • Inkognitoo Avatar

    PSR-1 tell us: «Class constants MUST be declared in all upper case with underscore separators» http://www.php-fig.org/psr/psr-1/

    I think it is better to use recommend syntax in your lessons.

    • donaldsebleung Avatar

      Thanks for the article, interesting read :) I wasn't aware of this naming convention back when I authored this Kata but I will be sure to keep this in mind when authoring future PHP Kata :D

  • geeves Avatar

    It might be good to mention that $this becomes "self::".

  • mn113 Avatar

    By convention, class constants are usually written in uppercase. One test for this kata failed when I used "const NAME" instead of "const name", which I don't think it should. Both should be allowed, and it's up to the author whether the case convention is mentioned or not.

  • ZozoFouchtra Avatar

    Happy to deal with some basic PHP kata ! 多谢 || Thanks a lot ! ;)