Skip to content

strict_types not working with no temp directory #191

@MartkCz

Description

@MartkCz

Version: 2.5.1

$engine = new Engine();
$engine->setStrictTypes();

$engine->renderToString($file);

Result: nothing, because @eval('?>' . $code) mutes Fatal error and php dies without any message.

When @ is manually deleted, php throws error:
PHP Fatal error: strict_types declaration must be the very first statement in the script in /home/martin/Plocha/tools/vendor/latte/latte/src/Latte/Engine.php(161) : eval()'d code on line 2

When setStrictTypes(false); everything is ok

When setTempDirectory(...) with setStrictTypes(true) everything is ok

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions