- strrev: documentation ( source)
<?php
class Base
{
public static $prop = 'BASE';
}
class Child extends Base
{
}
$excepted = 'REFLECTED';
$property = new ReflectionProperty('Base', 'prop');
$property->setValue($excepted);
$actual = Base::$prop;
echo "Should be $excepted and is $actual\n";
$actual = Child::$prop;
echo "Should be $excepted and is $actual\n";
Base::$prop = strrev(strrev(Base::$prop)); // force new zval
Base::$prop = $excepted;
$actual = Base::$prop;
echo "Should be $excepted and is $actual\n";
$actual = Child::$prop;
echo "Should be $excepted and is $actual\n";