Annotation of embedaddon/php/ext/pcre/tests/split.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: preg_split()
! 3: --FILE--
! 4: <?php
! 5:
! 6: var_dump(preg_split());
! 7: var_dump(preg_split('/*/', 'x'));
! 8:
! 9: var_dump(preg_split('/[\s, ]+/', 'x yy,zzz'));
! 10: var_dump(preg_split('/[\s, ]+/', 'x yy,zzz', -1));
! 11: var_dump(preg_split('/[\s, ]+/', 'x yy,zzz', 0));
! 12: var_dump(preg_split('/[\s, ]+/', 'x yy,zzz', 1));
! 13: var_dump(preg_split('/[\s, ]+/', 'x yy,zzz', 2));
! 14:
! 15: var_dump(preg_split('/\d*/', 'ab2c3u'));
! 16: var_dump(preg_split('/\d*/', 'ab2c3u', -1, PREG_SPLIT_NO_EMPTY));
! 17:
! 18: ?>
! 19: --EXPECTF--
! 20: Warning: preg_split() expects at least 2 parameters, 0 given in %ssplit.php on line 3
! 21: bool(false)
! 22:
! 23: Warning: preg_split(): Compilation failed: nothing to repeat at offset 0 in %ssplit.php on line 4
! 24: bool(false)
! 25: array(3) {
! 26: [0]=>
! 27: string(1) "x"
! 28: [1]=>
! 29: string(2) "yy"
! 30: [2]=>
! 31: string(3) "zzz"
! 32: }
! 33: array(3) {
! 34: [0]=>
! 35: string(1) "x"
! 36: [1]=>
! 37: string(2) "yy"
! 38: [2]=>
! 39: string(3) "zzz"
! 40: }
! 41: array(3) {
! 42: [0]=>
! 43: string(1) "x"
! 44: [1]=>
! 45: string(2) "yy"
! 46: [2]=>
! 47: string(3) "zzz"
! 48: }
! 49: array(1) {
! 50: [0]=>
! 51: string(8) "x yy,zzz"
! 52: }
! 53: array(2) {
! 54: [0]=>
! 55: string(1) "x"
! 56: [1]=>
! 57: string(6) "yy,zzz"
! 58: }
! 59: array(8) {
! 60: [0]=>
! 61: string(0) ""
! 62: [1]=>
! 63: string(1) "a"
! 64: [2]=>
! 65: string(1) "b"
! 66: [3]=>
! 67: string(0) ""
! 68: [4]=>
! 69: string(1) "c"
! 70: [5]=>
! 71: string(0) ""
! 72: [6]=>
! 73: string(1) "u"
! 74: [7]=>
! 75: string(0) ""
! 76: }
! 77: array(4) {
! 78: [0]=>
! 79: string(1) "a"
! 80: [1]=>
! 81: string(1) "b"
! 82: [2]=>
! 83: string(1) "c"
! 84: [3]=>
! 85: string(1) "u"
! 86: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>