Browse Source
Fixed segfault in wordwrap() when wrapping to zero width and using
Fixed segfault in wordwrap() when wrapping to zero width and using
multi-character break or trying to force cut (bug #12768, now fails and issues a warning because forcing a zero-width cut doesn't make sense). Also converted to new paramater-passing API and avoid making an extra copy of the return values. # also added tests. @- Fixed segfault in wordwrap() when wrapping to zero width and using @ multi-character break or trying to force cut (bug #12768). (Jim)experimental/ZendEngine2
2 changed files with 45 additions and 46 deletions
@ -0,0 +1,19 @@ |
|||
--TEST-- |
|||
wordwrap() function |
|||
--POST-- |
|||
--GET-- |
|||
--FILE-- |
|||
<?php |
|||
|
|||
$tests = <<<TESTS |
|||
"12345 12345 12345 12345" === wordwrap("12345 12345 12345 12345") |
|||
"12345 12345\\n1234567890\\n1234567890" === wordwrap("12345 12345 1234567890 1234567890",12) |
|||
"12345\\n12345\\n12345\\n12345" === wordwrap("12345 12345 12345 12345",0) |
|||
"12345ab12345ab12345ab12345" === wordwrap("12345 12345 12345 12345",0,"ab") |
|||
"12345 12345ab1234567890ab1234567890" === wordwrap("12345 12345 1234567890 1234567890",12,"ab") |
|||
TESTS; |
|||
|
|||
include('../../../../tests/quicktester.inc'); |
|||
|
|||
--EXPECT-- |
|||
OK |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue