This article describes some gotchas you may face if you need to use C++ in your extension.
PHP: call_user_func_array vs Dynamic Call
PHP 5.6 introduced the splat operator, which unpacks arrays or objects implementing Traversable interfaces into argument lists. Its most evident application is to call functions without having to resort to call_user_func_array(). So, which method is faster?
PHP: A Good Algorithm Is Not Always Better
I was looking how to improve performance of Slim’s Http\Cookies::parseHeader() function: as a C developer I find it rather non-optimal because it uses regular expressions and excessive memory allocations. I wondered it it is possible to use the same optimizations that I would use in C and if it gives any benefit.
One More Bug in PHP
For the second time in a row, I find a bug in PHP. This time PHP segfaults due to memory corruption during the request shutdown phase.
Found yet Another Memory Leak in PHP
When testing your own PHP extensions, it is very important not to miss any memory leaks. Wherever Valgrind shows a memory leak, you need to check your code for bugs. However, sometimes you can find a memory leak in the PHP Core.
PHP 7.2 and Valgrind
When valgrind php
shows lots of errors like “Conditional jump or move depends on uninitialised value(s)”, chances are that the PHP and PCRE extension were built without Valgrind support.
Performance in PHP: Pimple Container
From time to time you have to deal with someone else’s code. And the code you have to deal with sometimes surprises you. For example, Pimple, a small Dependency Injection Container for PHP; recent versions of which, according to README, are more focused on performance
. Learning something new is always interesting and sometimes funny, and therefore I started to read the code.