Update (July 2015) This was related to the dot-deb, that kept using an old PCRE library. This has been fixed directly in the package by Guillaume Plessis, and is working fine now. I’ll keep this post in case this helps anyone in similar situations, but this shouldn’t be useful anymore. WordPress not sending mail while […]
PHP skips some code When PHP skips some code, it features code optimizations : it skips automatically an instruction, as soon as it detects useless job. No need for code cache, this is plain vanilla PHP. Implied if The classic case is when using logical operators && or ||. When the first operand of an && […]
New in PHP 7 Let’s review the new constants, functions, classes, interfaces and trait that PHP 7 features. We have reviewed the core of PHP (as of June 1rst) and spotted quite some new structures that are already available to you if you’re testing the water with PHP7. New Constants in PHP 7 In the core, […]
Prepare for PHP 7 error messages (part 3) This is the third party of our presentation of PHP error messages. In the first article, we covered the evolution of error messages in the PHP binary, and in the second, we reviewed eight new messages. We’ll finish with sever other messages and three that were dropped […]
Prepare for PHP 7 error messages In the article “Prepare for PHP 7 error messages (part 1)” from last week, we covered the evolution of error messages in the PHP binary. In order to prepare for prepare for PHP 7 error messages, we are now going to review the new messages that are appearing in […]
Prepare for PHP 7 error messages The first step to prepare for PHP 7 is to lint it : using the command line instruction ‘php -l script.php’, one can easily check that every file in a current application compile with PHP 7. The second step is to run the application and the unit tests : in […]
How code dies Code is born, grows, matures, decays and then dies. It may be seen as a living matter, just like the tulips in my garden. It is scary to transpose that image to code: little typo appearing, pieces of code disappearing, constants that changes their value over time (code inflation?), part of code […]
How many improvement can you spot in this one liner ? echo (“this “.$will.” be displayed.”); No need for parenthesis with echo The first, and probably the most obvious, are the useless parenthesis. The echo is a ‘structure of language’, aka a special kind of function for PHP : among others, it doesn’t need any […]
Magic number is a literal value with unexplained meaning, that appears in the code multiple times. Such values will show no intent, and should be replace by a constant: the name of the constant will make the code more readable, and easier to update in the future. Hunting for Magic Numbers Let’s take a look […]
Why to use automated PHP Code Analysis Tools ? Traditional PHP Code Review demands an army of developers. Doing go PHP Code Review demands scarce experts. Sustainable PHP Code review demands tools that each uses to help manage the code. With the increasingly important of technical debt, in PHP as elsewhere, we’ve seen the last two […]