Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation warning in PHP 8.1 for null values #249

Closed
windware-ono opened this issue Feb 20, 2022 · 1 comment
Closed

Deprecation warning in PHP 8.1 for null values #249

windware-ono opened this issue Feb 20, 2022 · 1 comment

Comments

@windware-ono
Copy link

With PHP 8.1, built-in functions started to raise deprecation warnings when given null for non nullable parameters with the following error.

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated

https://www.php.net/manual/en/migration81.deprecated.php

This seems to happen in,

vendor/pug-php/pug/src/Pug/Engine/Options.php in Pug\Engine\Options::initializeJsPhpize at line 156 for strtolower

    protected function initializeJsPhpize()
    {
        if (strtolower($this->getDefaultOption('expressionLanguage')) !== 'php') {
            $compiler = $this->getCompiler();
            $compiler->addModule(new JsPhpizePhug($compiler));
        }
    }

I could suppress this warning if I explicitly specified 'expressionLanguage' in the initializer but for those who don't, it gets reported on every page access and it can cause excessive amount of warnings.

Thanks.

@kylekatarnls
Copy link
Member

Hello,

It's already fixed in master branch. I released a new tag so you can just update and it will be solved.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants