zephir
zephir copied to clipboard
PHP Class with a protected ctor can be initialized in Zephir
Some class in php:
<?php
class SomeClass
{
protected function __construct()
{}
}
?>
A helper class in Zephir:
namespace Foo;
class HelperClass
{
public static function initClass(string className)
{
return new {className}();
}
}
This protected ctor class SomeClass
should not be initialized in Zephir.
<?php
var_dump(
Foo\HelperClass::initClass('SomeClass')
);
?>
Outputs:
object(SomeClass)#1 (0) {
}
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.