News Archive
PhpRiot Newsletter
Your Email Address:

More information

Web Builder Zone: 5 features of PHP that seem hacks, but save your life

Note: This article was originally published at PHPDeveloper on 3 November 2010.

On the Web Builder Zone today there's a new article that talks about five things that, while they may seem like hacks in your development, they might come in very handy in the right situations.

Ilia is one of the people that get his hands dirty in the PHP core, and PHP has indeed many overlooked features. [...] However, thinking about this load of features inspired me to write this article: I'll include here 5 features that at first seem an hack, but can save your life while coding in PHP. In fact, you probably use or will use them every day without noticing.

His list of five is made up of the access our scripts have to private properties via Reflection, using eval, the __DIR__ constant, the fact that a closing "?" isn't needed and the fact that PHP has "__sleep()".