Private Properties Exposed
For our Components project we are ofcourse writing unit tests (with PHPUnit ). Sometimes you would want to test whether a private property contains the correct data, and of course with the normal visibility rules you can't access those from your unit test. There is an interesting trick for this, which I'll share here:
<?php
class foo {
private $bar = 42;
}
$obj = new foo;
$propname="\0foo\0bar";
$a = (array) $obj;
echo $a[$propname];
?>
Comments
$f->{"0Foo0id"} (for private members) and $f->{"0*0name"} (for protected ones) used to work. Too bad someone added a "Cannot access property started with '0'" fatal error to the Zend Engine in the meantime, making necessary the array-cast hack presented here...
I'd rather have ReflectionProperty->setAccessible(TRUE) like (insert other programming language here):)
Life Line
Created a main entrance and a home entrance
Created an entrance
Updated a house building
Created an entrance
I've just finished reading "A Cheese-Monger's Tour de France", by Ned Palmer.
Now I want to try many of those! 🧀
I'm thrilled to announce that I'll be speaking at the 23rd edition of #phpday, the international PHP conference in Italy, organised by @grusp.
I’ll be presenting a talk titled: "Better Debugging With Xdebug".
It's in Verona, Italy, on May 14-15th 2026.
You can use my speaker’s discount code "speaker_10OFF" for 10% off at https://www.phpday.it/tickets/?utm_medium=organic&utm_source=linkedin&utm_campaign=post-speaker
Merged pull request #1066
PHP 8.6: Changes to opcache optimisations wrt function arguments
Fixed building type
Fixed addresses and building type
Updated a bus_stop, a waste_basket, and a bench
Created 2 waste_baskets; Updated 2 bus_stops and a crossing; Confirmed a dry_cleaning shop
Merge branch 'v2022'
Update data to 2026a
Sigh, the AI Slop has now come for the PHP project.
I had this little Black-capped Chickadee eating out of my hand earlier on a lovely 8k walk with @dseguy and @DaveLiddament in the snow at the back end of @ConFooCa .
Thanks Canada!
Updated a restaurant
Created a ticket shop, a bench, and a toilet
Created a picnic_table; Updated a viewpoint
Updated a shelter
I hiked 9.3km in 3h12m03s
Updated 3 restaurants
I walked 3.1km in 29m25s
I walked 4.4km in 45m01s
I walked 5.4km in 55m28s



Shortlink
This article has a short URL available: https://drck.me/ppe-46g