1--TEST--
2Test wordwrap() function : basic functionality
3--FILE--
4<?php
5echo "*** Testing wordwrap() : basic functionality ***\n";
6
7// Initialize all required variables
8$str = "The quick brown foooooooooox jummmmmmmmmmmmped over the lazzzzzzzzzzzy doooooooooooooooooooooog.";
9$width = 80;
10$break = '<br />\n';
11
12// Calling wordwrap() with default arguments
13var_dump( wordwrap($str) );
14
15// Calling wordwrap() with all possible optional arguments
16// with $width arg
17var_dump( wordwrap($str, $width) );
18// with $break arg
19var_dump( wordwrap($str, $width, $break) );
20
21// Calling wordwrap() with all arguments
22// $cut as true
23$width = 10;
24$cut = true;
25var_dump( wordwrap($str, $width, $break, $cut) );
26
27// $cut as false
28$width = 10;
29$cut = false;
30var_dump( wordwrap($str, $width, $break, $cut) );
31echo "Done\n";
32?>
33--EXPECT--
34*** Testing wordwrap() : basic functionality ***
35string(96) "The quick brown foooooooooox jummmmmmmmmmmmped over the lazzzzzzzzzzzy
36doooooooooooooooooooooog."
37string(96) "The quick brown foooooooooox jummmmmmmmmmmmped over the lazzzzzzzzzzzy
38doooooooooooooooooooooog."
39string(103) "The quick brown foooooooooox jummmmmmmmmmmmped over the lazzzzzzzzzzzy<br />\ndoooooooooooooooooooooog."
40string(178) "The quick<br />\nbrown<br />\nfooooooooo<br />\nox<br />\njummmmmmmm<br />\nmmmmped<br />\nover the<br />\nlazzzzzzzz<br />\nzzzy<br />\ndooooooooo<br />\noooooooooo<br />\nooog."
41string(138) "The quick<br />\nbrown<br />\nfoooooooooox<br />\njummmmmmmmmmmmped<br />\nover the<br />\nlazzzzzzzzzzzy<br />\ndoooooooooooooooooooooog."
42Done
43