Some good points here: Surprisingly Slow. I’m thinking about installing zstandard for my PHP… see Better Compression with Zstandard for some numbers.
Tag Archives: php
PDOStatement::fetchAll
There’s some really good PHP PDO documentation over here: PDOStatement::fetchAll. Of particular interest were PDO::FETCH_KEY_PAIR, PDO::FETCH_PROPS_LATE, PDO::FETCH_GROUP, and PDO::FETCH_FUNC.
PHP finally blocks not run on exit
I confirmed with the following code that if you call ‘exit’ withing a ‘try’ block the ‘finally’ block does *not* execute. That’s probably what you would expect. But now we know.
register_shutdown_function( 'handle_shutdown' ); try { exit; } catch ( Exception $ex ) { echo "caught...\n"; } finally { echo "finally...\n"; } function handle_shutdown() { echo "shutdown...\n"; }
Enabling XDebug for PHP under Apache2
Putting these settings in /etc/php/7.2/apache/php.ini did the job:
[XDebug] xdebug.profiler_enable = 1 xdebug.profiler_output_dir = /tmp/xdebug xdebug.profiler_output_name = cachegrind.out.%p.%u.%H.%R.xt
The cachegrind files are now written to /tmp/xdebug.
AWS SDK for PHP
Today I learned about AWS SDK for PHP. Haven’t actually used it.
Generating unique, random-looking voucher codes
Today I discovered Generating unique, random-looking voucher codes.
What’s New in PHP 8
This on r/programming today: What’s New in PHP 8.
How to generate an SSL private key for use with MySQL/MariaDB and PDO
To generate an SSL private key for use with MySQL/MariaDB and PDO:
openssl genrsa -out client-key.pem 4096
Everything you need (and don’t need) to know about PHP’s type system
I read Everything you need (and don’t need) to know about PHP’s type system, it was interesting. My favourite quote was at the end:
“I believe php’s type system is incredibly rich and carries many innovative and legacy features and they all make much sense when you look at the history of the language development.”
PHP Operator Precedence
Today I had cause to read about Operator Precedence in PHP. I think I will consider availing myself of the ‘and’ and ‘or’ keywords in future, I haven’t used them myself, although I have seen them before.