breakiter_clone_basic.phpt 677 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. IntlBreakIterator: clone handler
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('intl'))
  6. die('skip intl extension not enabled');
  7. --FILE--
  8. <?php
  9. ini_set("intl.error_level", E_WARNING);
  10. $bi = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;');
  11. $bi_clone = clone $bi;
  12. var_dump(get_class($bi), get_class($bi_clone));
  13. var_dump($bi == $bi_clone);
  14. $bi->setText('foobar');
  15. $bi_clone = clone $bi;
  16. var_dump(get_class($bi), get_class($bi_clone));
  17. var_dump($bi == $bi_clone);
  18. --EXPECT--
  19. string(26) "IntlRuleBasedBreakIterator"
  20. string(26) "IntlRuleBasedBreakIterator"
  21. bool(true)
  22. string(26) "IntlRuleBasedBreakIterator"
  23. string(26) "IntlRuleBasedBreakIterator"
  24. bool(true)