After 12 years, I moved the blog off SAE to a fresh Tencent Cloud server — rebuilding mysql, nginx, php, memcached and WordPress from scratch, and finally setting up SSL and HTTP/2.
print is a language construct, not a function — its parentheses are ignored during parsing and it always evaluates to 1. That's why a chain of print(...) && print(...) produces a surprising output, and why explicit parentheses change the meaning.
Why strtotime("-1 month") on July 31 returns July 1: date subtracts the month first (June 31), then normalizes the impossible date. Since PHP 5.3 you can avoid this with "first day of" / "last day of".
Why PHP 7 turned references from a flag bit into a real IS_REFERENCE type backed by zend_reference, and how that makes Change On Write simpler and avoids the classic PHP 5 copy-on-reference-assignment problem.
How the zval changed from PHP5 to PHP7: it shrank from 24/32 bytes to 16, became a value-pointer, gained type-flag bitfields, and stopped using heap allocation (MAKE_STD_ZVAL/ALLOC_ZVAL removed) — the foundation of PHP7's performance.
A walkthrough of the HTTPOXY proxy vulnerability from the PHP angle: how the HTTP_PROXY env var becomes attacker-controllable under CGI, who is actually affected, and the one-line Nginx fix. Includes a postscript on why every HTTP_* variable is untrusted.
PHP 7 is the biggest performance leap in the language's history, but a stock install isn't the whole story. Five things to check — Opcache, a modern GCC, HugePages, opcache file cache, and PGO — to squeeze out the maximum speed.
A personal look back on the road to PHP 7: the shelved JIT effort, the secret rewrite, the community fight and the vote — and why, after all these years of open source, the release day still deserves a little sentiment.
PHP 7 RC4 ships a new performance win: HugePageFy the TEXT segment. A practical walkthrough of how TLB misses work, how to reserve HugePages and enable opcache.huge_code_pages, and the one profiling gotcha to watch for.
GCC's PGO can squeeze a ~7–10% boost out of PHP 7 for a specific workload. A hands-on walkthrough of profiling WordPress and rebuilding PHP with prof-gen/prof-use — and why we can't ship it as the default.