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

PHP 8.1 preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated #19310

Closed
hsegura opened this issue Mar 17, 2022 · 4 comments
Milestone

Comments

@hsegura
Copy link

hsegura commented Mar 17, 2022

What steps will reproduce the problem?

when use yii2/helpers/BaseInflector.php, function camel2word
line:
$label = preg_replace('/(?<=\p{Ll})\p{Lu}|(?<=[\p{L}\d])\p{Lu}(?=\p{Ll})|(\d+)/u', ' \0', $name);

What is the expected result?

not error

What do you get instead?

PHP Deprecated Warning – yii\base\ErrorException
preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Additional info

Q A
Yii version 2.0.45
PHP version 8.1
Operating system ubuntu
@virtual-designer
Copy link
Contributor

What was your code? How you're trying to invoke that method? Please describe.

@hsegura
Copy link
Author

hsegura commented Mar 17, 2022

imagen

@virtual-designer
Copy link
Contributor

Please include the full stack trace. Right now I can only see the 3rd one, which is not enough for investigating the issue.

@hsegura
Copy link
Author

hsegura commented Mar 17, 2022

sorry, my fault
it was missing to set the label attribute in the grid column

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

No branches or pull requests

3 participants