note 126615 added to function.mb-strcut

From: Date: Mon, 15 Nov 2021 23:49:30 +0000
Subject: note 126615 added to function.mb-strcut
Groups: php.notes 
Request: Send a blank email to php-notes+get-217252@lists.php.net to get a copy of this message
This was driving me crazy, because mb_strcut() kept returning an empty string. The $length parameter seems to have a max value of 2^32-1 (2147483647). Works: <?php # output: Полуустав echo mb_strcut('Полуустав', 0, pow(2,31)-1); ?> Doesn't work: <?php # nothing is output echo mb_strcut('Полуустав', 0, pow(2,31)); ?> My PHP_INT_MAX value is much larger than 2^32-1, so I'm not sure why larger values for $length don't work. :( <?php # output: 9223372036854775807 echo PHP_INT_MAX; ?> ---- Server IP: 45.112.84.4 Probable Submitter: 45.112.85.242 (proxied: 154.5.56.204) ---- Manual Page -- https://php.net/manual/en/function.mb-strcut.php Edit -- https://main.php.net/note/edit/126615 Del: integrated -- https://main.php.net/note/delete/126615/integrated Del: useless -- https://main.php.net/note/delete/126615/useless Del: bad code -- https://main.php.net/note/delete/126615/bad+code Del: spam -- https://main.php.net/note/delete/126615/spam Del: non-english -- https://main.php.net/note/delete/126615/non-english Del: in docs -- https://main.php.net/note/delete/126615/in+docs Del: other reasons-- https://main.php.net/note/delete/126615 Reject -- https://main.php.net/note/reject/126615 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#217252) next »