Deprecated function: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in Controller.php

Warning in PHP 8:

Deprecated function: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in Controller.php

 

Code:

   <?php
        if ( strlen($title) > 3) {
            send_my_email();
        }

 

Fix:

   <?php
        if ( strlen($title ?? '' ) > 3) {
            send_my_email();
        }
        
        

Neuen Kommentar schreiben

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Suche

Neueste Kommentare