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
Curlew on the Grass
This was one of several Curlews we saw, but this one was vaguely camouflaged in the colourful heather.
#photography #Birds #BirdPhotography #BirdsOfFediverse #NaturePhotography #wildlife #Norfolk
For one of Xdebug's features (native path mapping), I currently support line mapping as in:
```
user-info-823edfe12e38a.php:2-31 = user-info.ezt:1
user-info-823edfe12e38a:32-33 = user-info.ezt:2
…
user-info-823edfe12e38a:303 = user-info.ezt:74-75
```But this is not an efficient format.
I wonder if somebody else has a better idea than I have in https://bugs.xdebug.org/view.php?id=2400:
```
user-info-823edfe12e38a.php = user-info.ezt (@2-31=1;32-33=2;…;303=74-75)
```Specify bridge structures
Specify width of opening
Survey if places still exist
Survey if vacant places are still vacant
Survey opening hours
Specify whether traffic signals have tactile indications that it's safe to cross
Specify whether roads have lane markings
Specify whether there are cycleways
Survey postbox collection times
Survey if places still exist
Specify parking access
Specify parking types
Specify maximum heights
Survey housenumbers
Specify whether roads have sidewalks
Specify road surfaces
Specify path surfaces
Dartford Warbler Posing
In nearly the same spot as the Stonechat from the previous post, this tiny Dartford Warbler sat still here for a few moments.
#photography #Birds #BirdPhotography #BirdsOfFediverse #NaturePhotography #wildlife #Norfolk
Specify whether pedestrian crossings have traffic signals
Specify whether traffic signals have a button for pedestrians
Specify whether traffic signals have sound signals
Specify whether traffic signals have tactile indications that it's safe to cross
Specify maximum heights



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