Posts filed under Programmers

Better Getters and Setters in PHP

By , Thursday, June 18th, 2015

Common practice in PHP development seems to follow a common flow: create class properties with names like $class->title and getters and setters named $class->getTitle() and $class->setTitle(). Using additional methods like this, even when they’re standardized in a framework, are not ideal because it requires developers to know both the property name as well as the standards in your project.

Read the rest