Today while reading Writing better Regular Expressions in PHP I learned that meta characters are treated as literals in character classes. So
'/^(\d[.]\d)$/' will match
'1.2' but not
'1x2'. Who knew!?
Note to self: my PHP extension is here:
The .so file (shared object) is in
I linked it in like this:
------------------- Sun May 23 13:44:22 root@tact:/usr/lib/php/20170718 # ln -s /home/jj5/repo/git/git.php.net/php-src/ext/pext/modules/pext.so . -------------------
Configured it like this:
------------------- Sun May 23 13:44:47 root@tact:/usr/lib/php/20170718 # cat /etc/php/7.2/cli/conf.d/pext.ini extension=pext.so -------------------
And I can build it like this:
------------------- Sun May 23 13:51:37 jj5@tact:/home/jj5/repo/git/git.php.net/php-src/ext/pext $ make clean && make
Today I found Getting Started with PHP Extension Development via PHP-CPP which talks about what it says on the label. But then some more searching revealed a more direct alternative: How to Create a PHP C Extension to Manipulate Arrays – Part 1: Basic Array Class Extension
A nice write up on PHP’s recent successes: PHP in 2021.
Here’s some good documentation on PHP prepared statements and stored procedures including how to call stored procedures with output parameters.
The answer is no, so long as you’re not preparing to execute the statement again. I figured this out by looking at the code for PDOStatement::closeCursor and the MySQL implementation. Seems to me that all the freeing necessary is done in the destructor so if you’re not planning to use the statement again it seems to me that you can safely omit the call to PDOStatement::closeCursor(). On the other hand if you are going to reuse the statement calling closeCursor seems like it’s a pretty important thing to do. It would be nice if PDOStatement::fetchAll() called closeCursor() for us, but I don’t think it does.
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.