As i see the zephir for the current time not supports the Late Static Bindings for static properties. So i try to use inject C-macros to zephir... and got exception.
namespace Igor;
class Abc
{
public static myproperty = "Hello ABC";
public static function printer()
{
var className, value = null;
let className = get_called_class();
%{
zephir_read_static_property(&value, Z_STRVAL_P(className), Z_STRLEN_P(className), SS("myproperty") TSRMLS_CC);
}%
echo value;
}
}
then i try to direct read static property from php. It's OK.
echo Igor\Abc::$myproperty; // OK
when i call printer... i get error.
Igor\Abc::printer(); // FAIL
error:
*PHP Fatal error: Access to undeclared static property: Igor\Abc::$myproperty in ....*
So i can't Late Static Bindings for properties with C-injections TOO. :(
my extended class:
class SomeTest extends \Igor\Abc
{
public static $myproperty = "Hello TEST";
}
\Igor\Abc::printer(); // Hello ABC
SomeTest::printer(); // Hello TEST
Have ideas?