KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm wondering what you think the best practice is here-- does it buy you very much to type-check parameters in PHP? I.e have you actually seen noticeably fewer bugs on projects where you've implemented parameter type-checking vs. those that don't? I'm thinking about stuff like this: public function __construct($screenName, $createdAt) { if (!is_string($screenName) || !is_string($createdAt) { return FALSE; } }
Tags (comma-separated)
Save Edits
Cancel