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 deprecation of null arguments #15984

Closed
Deathamns opened this issue Jun 9, 2022 · 7 comments · Fixed by #15985, #15995 or #16004
Closed

PHP 8.1 deprecation of null arguments #15984

Deathamns opened this issue Jun 9, 2022 · 7 comments · Fixed by #15985, #15995 or #16004
Assignees
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: low Low

Comments

@Deathamns
Copy link
Contributor

With the recent v5.0.0RC1 and PHP 8.1 I'm seeing entries in my log files about passing null parameters to built-in functions.

For example calling Phalcon\Http\Request\getLanguages() when the HTTP_ACCEPT_LANGUAGE header is not present, I get messages such as:
preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated

this->getServer(serverIndex),

These deprecation messages might surface in other places as well, I've only noticed this specific case.

Passing null to non-nullable parameters of built-in functions
PHP 8.1 : Passing null to non-nullable arguments of internal functions is deprecated

@Deathamns Deathamns added bug A bug report status: unverified Unverified labels Jun 9, 2022
@niden
Copy link
Member

niden commented Jun 9, 2022

We definitely need to address these. I will try and get as much reporting as possible from our testing suite but that might not cover a lot of areas that could be problematic.

Anything else you see @Deathamns please report it. I am going to address this one shortly.

@niden niden self-assigned this Jun 9, 2022
@niden niden added status: low Low 5.0 The issues we want to solve in the 5.0 release and removed status: unverified Unverified labels Jun 9, 2022
@niden niden linked a pull request Jun 9, 2022 that will close this issue
5 tasks
@niden
Copy link
Member

niden commented Jun 9, 2022

Resolved in #15985

Thank you @Deathamns

@niden niden closed this as completed Jun 9, 2022
@Jeckerson
Copy link
Member

Released in v5.0.0RC2

@dz3n
Copy link

dz3n commented Jun 13, 2022

@niden
Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in

Same issue if you using StringLength validator with nullable column

@niden niden reopened this Jun 13, 2022
@niden niden linked a pull request Jun 15, 2022 that will close this issue
5 tasks
@niden
Copy link
Member

niden commented Jun 15, 2022

Resolved in #15995

@dz3n Thank you for reporting this!

@niden niden closed this as completed Jun 15, 2022
@Deathamns
Copy link
Contributor Author

public function length(var item) -> int
{
if typeof item == "object" || typeof item == "array" {
return count(item);
}
if function_exists("mb_strlen") {
return mb_strlen(item);
}
return strlen(item);
}

@niden niden reopened this Jun 17, 2022
@niden niden mentioned this issue Jul 1, 2022
5 tasks
@niden niden linked a pull request Jul 1, 2022 that will close this issue
5 tasks
@niden
Copy link
Member

niden commented Jul 2, 2022

Resolved in #16004

@niden niden closed this as completed Jul 2, 2022
@niden niden moved this to Implemented in Phalcon v5 Aug 25, 2022
@niden niden added this to Phalcon v5 Aug 25, 2022
@niden niden moved this from Implemented to Released in Phalcon v5 Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: low Low
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants