1--TEST-- 2IntlBreakIterator::setText(): basic test 3--SKIPIF-- 4<?php 5if (!extension_loaded('intl')) 6 die('skip intl extension not enabled'); 7--FILE-- 8<?php 9ini_set("intl.error_level", E_WARNING); 10 11class A { 12function __tostring() { return 'aaa'; } 13} 14 15$bi = IntlBreakIterator::createWordInstance('pt'); 16var_dump($bi->setText('foo bar')); 17var_dump($bi->getText()); 18var_dump($bi->setText(1)); 19var_dump($bi->getText()); 20var_dump($bi->setText(new A)); 21var_dump($bi->getText()); 22 23/* setText resets the pointer */ 24var_dump($bi->next()); 25var_dump($bi->setText('foo bar')); 26var_dump($bi->current()); 27--EXPECT-- 28bool(true) 29string(7) "foo bar" 30bool(true) 31string(1) "1" 32bool(true) 33string(3) "aaa" 34int(3) 35bool(true) 36int(0) 37