zephir icon indicating copy to clipboard operation
zephir copied to clipboard

PHP Class with a protected ctor can be initialized in Zephir

Open hylent opened this issue 9 years ago • 0 comments

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.

hylent avatar Apr 08 '15 02:04 hylent