Is there a way to access and protected property of an object without changing the class in PHP.
Is there maybe a workaround to access protected properties? currently i am able to get the
<?php
class MyClass
{
public $public = 'Public';
protected $protected = 'Protected';
private $private = 'Private';
}
$item = new MyClass();
echo $item->protected; //Obviously this doesn't work, but to demonstrate what i need
Currently I don't have the option to change or extend the class, is there a workaround to still get the data stored in this property?
If there isn’t a way i will delete my post and look for another solution