note 127814 added to function.strlen

From: Date: Sat, 22 Oct 2022 12:13:31 +0000
Subject: note 127814 added to function.strlen
Groups: php.notes 
Request: Send a blank email to php-notes+get-219764@lists.php.net to get a copy of this message
Since PHP 8.0, passing null to strlen() is deprecated. To check for a blank string (not including '0'): <?php // PHP < 8.0 if (!strlen($text)) { echo 'Blank'; } // PHP >= 8.0 if ($text === null || $text === '')) { echo 'empty'; } ---- Server IP: 45.112.84.4 Probable Submitter: 45.91.159.161 (proxied: 49.198.14.113) ---- Manual Page -- https://php.net/manual/en/function.strlen.php Edit -- https://main.php.net/note/edit/127814 Del: integrated -- https://main.php.net/note/delete/127814/integrated Del: useless -- https://main.php.net/note/delete/127814/useless Del: bad code -- https://main.php.net/note/delete/127814/bad+code Del: spam -- https://main.php.net/note/delete/127814/spam Del: non-english -- https://main.php.net/note/delete/127814/non-english Del: in docs -- https://main.php.net/note/delete/127814/in+docs Del: other reasons-- https://main.php.net/note/delete/127814 Reject -- https://main.php.net/note/reject/127814 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#219764) next »