Ray can now display the values of private properties
Our handy Ray debugging app gained a cool new trick: it can now display the values of private properties and results of private methods.
Consider this simple class.
class PrivateClass
{
private string $privateProperty = 'this is the value of the private property';
private function privateMethod()
{
return 'this is the result of the private method';
}
}
Here's how you can send the value of the private property to Ray.
$privateClass = new PrivateClass();
ray()->invade($privateClass)->privateProperty;
The invade()
method can also display the results of private methods in Ray.
$privateClass = new PrivateClass();
ray()->invade($privateClass)->privateMethod();
If you want to colorize the result, simply tack on one of the color methods.
$privateClass = new PrivateClass();
ray()->invade($privateClass)->privateProperty->red();
ray()->invade($privateClass)->privateMethod()->green();
Ray can of course do a whole lot more: it can display all sort of debugging information, pause your code, measure the runtime, display all executed queries, and much more! You can discover it all on the Ray website.
Very usefull update