[PHP-NOTES] note 130630 added to language.operators.functional

[email protected] ("[email protected]") Fri, 30 Jan 2026 15:08:03 +0000
Newsgroups php.notes
Message-ID <[email protected]>
Keep in mind encoding and types used. The output of the following code is:
3
2

Presumably because one char is 3 bytes and 11, while an integer and not a string, is 2 chars:

<?php
$result = "✅" |> strlen(...);
echo $result, PHP_EOL;

$result = strlen("Hello World");
echo $result |> strlen(...);
?>
----
Server IP: 206.189.2.9
Probable Submitter: 37.96.121.162
----
Manual Page -- https://php.net/manual/en/language.operators.functional.php
Edit        -- https://main.php.net/note/edit/130630
Del: integrated  -- https://main.php.net/note/delete/130630/integrated
Del: useless     -- https://main.php.net/note/delete/130630/useless
Del: bad code    -- https://main.php.net/note/delete/130630/bad+code
Del: spam        -- https://main.php.net/note/delete/130630/spam
Del: non-english -- https://main.php.net/note/delete/130630/non-english
Del: in docs     -- https://main.php.net/note/delete/130630/in+docs
Del: other reasons-- https://main.php.net/note/delete/130630
Reject      -- https://main.php.net/note/reject/130630
Search      -- https://main.php.net/manage/user-notes.php