1
0
mirror of https://github.com/php/php-src.git synced 2026-04-18 21:41:22 +02:00
Files
archived-php-src/ext/iconv/tests/bug72320.phpt
Christoph M. Becker a837b2f6a3 Fix #72320: iconv_substr returns false for empty strings
For consistency with substr() and mb_substr(), iconv_substr() should return
an empty string instead of FALSE, when $offset == iconv_strlen($str).
2016-07-29 11:33:50 +02:00

15 lines
297 B
PHP

--TEST--
Bug #72320 (iconv_substr returns false for empty strings)
--SKIPIF--
<?php
if (!extension_loaded('iconv')) die('skip ext/iconv required');
?>
--FILE--
<?php
var_dump(iconv_substr('', 0, 10, 'UTF-8'));
var_dump(iconv_substr('foo', 3, 10, 'UTF-8'));
?>
--EXPECT--
string(0) ""
string(0) ""