This is handy: PHP type comparison tables.
And this is interesting: List of Parser Tokens.
Tag Archives: php
How to compile PHP from Source
Complete guide to FFI in PHP
Bumped into: Complete guide to FFI in PHP.
The relevance of PHP
Seen today: Yes, PHP is Worth Learning/Using in $CURRENT_YEAR. There’s some good discussion on some of the more recent PHP language features and other notes about what’s available in the broader ecosystem.
Factory specialization
I just knocked this up to confirm my thinking was right:
<?php
class StdFeature {
}
class AppFeature extends StdFeature {
}
class FactoryBase {
public function new_feature() : StdFeature { return new StdFeature; }
}
class Factory extends FactoryBase {
public function new_feature() : AppFeature { return new AppFeature; }
}
$factory = new Factory();
$feature = $factory->new_feature();
assert( is_a( $feature, 'AppFeature' ) );
PHP DoH endpoint
This in the news today: A simple PHP script that can be used to add a DoH endpoint to a HTTPS server.
Streams in PHP
Today I came across A Guide to Streams in PHP: In-Depth Tutorial With Examples.
Learn X in Y minutes
Today on r/programming: Learn X in Y minutes — looks like a great resource! I read the PHP notes, they were good. Comprehensive and to the point.
No meta characters in regex character classes
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!?
String validation in PHP
Learn about character type checking and filter_var. I bumped into these while reading Writing better Regular Expressions in PHP.