News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Stefan Koopmanschap's Blog:
public static vs static public
January 27, 2009 @ 12:07:10

Stefan Koopmanschap has posted about static methods and comparing "static public" to "public static" (including a popularity graph).

Ever since starting with PHP 5 object oriented development, all documentation I read on the topic seemed to suggest that the only way to write the method keywords is "public static". I've been following along those lines, and for a while I really thought any other order would trigger errors. Only recently I found out the other way round is actually nicer.

In his opinion, the "static public" keyword combination (versus "public static") is "more beautiful" than its inverse counterpart. He even asked about it in a twitpoll and got these results - "public static" winning out as the popular choice. If you want to voice your opinion, you can still get in on the poll.

0 comments voice your opinion now!
public static method twitpoll compare feedback


blog comments powered by Disqus

Similar Posts

Squirrel Hacker Blog: PHP DateTime is missing methods in 5.2

Padraic Brady's Blog: Zend Framework Page Caching: Part 3: Tagging For Static File Caches

Alexander Netkachev's Blog: Controller/Action versus Folder/Page

LearnComputer.com: PHP Training: Online vs. Classroom

PHP-Coding-Practices.com: Composing Methods: Replace Temp With Query


Community Events

Don't see your event here?
Let us know!


laravel extension opinion api release security version introduction laravel5 language list example series library framework php7 interview podcast voicesoftheelephpant community

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework