ofs | hex dump | ascii |
---|
0000 | 2d 2d 54 45 53 54 2d 2d 0a 54 65 73 74 20 63 68 75 6e 6b 5f 73 70 6c 69 74 28 29 20 66 75 6e 63 | --TEST--.Test.chunk_split().func |
0020 | 74 69 6f 6e 20 3a 20 75 73 61 67 65 20 76 61 72 69 61 74 69 6f 6e 73 20 2d 20 64 69 66 66 65 72 | tion.:.usage.variations.-.differ |
0040 | 65 6e 74 20 69 6e 74 65 67 65 72 20 76 61 6c 75 65 73 20 66 6f 72 20 27 63 68 75 6e 6b 6c 65 6e | ent.integer.values.for.'chunklen |
0060 | 27 20 61 72 67 75 6d 65 6e 74 28 42 75 67 23 34 32 37 39 36 29 0a 2d 2d 53 4b 49 50 49 46 2d 2d | '.argument(Bug#42796).--SKIPIF-- |
0080 | 0a 3c 3f 70 68 70 0a 69 66 20 28 50 48 50 5f 49 4e 54 5f 53 49 5a 45 20 21 3d 20 38 29 20 64 69 | .<?php.if.(PHP_INT_SIZE.!=.8).di |
00a0 | 65 28 22 73 6b 69 70 20 74 68 69 73 20 74 65 73 74 20 69 73 20 66 6f 72 20 36 34 62 69 74 20 70 | e("skip.this.test.is.for.64bit.p |
00c0 | 6c 61 74 66 6f 72 6d 20 6f 6e 6c 79 22 29 3b 0a 3f 3e 0a 2d 2d 46 49 4c 45 2d 2d 0a 3c 3f 70 68 | latform.only");.?>.--FILE--.<?ph |
00e0 | 70 0a 2f 2a 20 50 72 6f 74 6f 74 79 70 65 20 20 3a 20 73 74 72 69 6e 67 20 63 68 75 6e 6b 5f 73 | p./*.Prototype..:.string.chunk_s |
0100 | 70 6c 69 74 28 73 74 72 69 6e 67 20 24 73 74 72 20 5b 2c 20 69 6e 74 20 24 63 68 75 6e 6b 6c 65 | plit(string.$str.[,.int.$chunkle |
0120 | 6e 20 5b 2c 20 73 74 72 69 6e 67 20 24 65 6e 64 69 6e 67 5d 5d 29 0a 20 2a 20 44 65 73 63 72 69 | n.[,.string.$ending]])..*.Descri |
0140 | 70 74 69 6f 6e 3a 20 52 65 74 75 72 6e 73 20 73 70 6c 69 74 20 6c 69 6e 65 0a 20 2a 20 53 6f 75 | ption:.Returns.split.line..*.Sou |
0160 | 72 63 65 20 63 6f 64 65 3a 20 65 78 74 2f 73 74 61 6e 64 61 72 64 2f 73 74 72 69 6e 67 2e 63 0a | rce.code:.ext/standard/string.c. |
0180 | 20 2a 20 41 6c 69 61 73 20 74 6f 20 66 75 6e 63 74 69 6f 6e 73 3a 20 6e 6f 6e 65 0a 2a 2f 0a 0a | .*.Alias.to.functions:.none.*/.. |
01a0 | 2f 2a 0a 2a 20 70 61 73 73 73 69 6e 67 20 64 69 66 66 65 72 65 6e 74 20 69 6e 74 65 67 65 72 20 | /*.*.passsing.different.integer. |
01c0 | 76 61 6c 75 65 73 20 66 6f 72 20 27 63 68 75 6e 6b 6c 65 6e 27 20 61 72 67 75 6d 65 6e 74 20 74 | values.for.'chunklen'.argument.t |
01e0 | 6f 20 63 68 75 6e 6b 5f 73 70 6c 69 74 28 29 0a 2a 20 27 65 6e 64 69 6e 67 27 20 69 73 20 73 65 | o.chunk_split().*.'ending'.is.se |
0200 | 74 20 74 6f 20 27 7c 7c 27 0a 2a 2f 0a 0a 65 63 68 6f 20 22 2a 2a 2a 20 54 65 73 74 69 6e 67 20 | t.to.'||'.*/..echo."***.Testing. |
0220 | 63 68 75 6e 6b 5f 73 70 6c 69 74 28 29 20 3a 20 64 69 66 66 65 72 65 6e 74 20 69 6e 74 65 67 65 | chunk_split().:.different.intege |
0240 | 72 20 76 61 6c 75 65 73 20 66 6f 72 20 27 63 68 75 6e 6b 6c 65 6e 27 20 2a 2a 2a 5c 6e 22 3b 0a | r.values.for.'chunklen'.***\n";. |
0260 | 0a 20 2f 2f 49 6e 69 74 69 61 6c 69 7a 69 6e 67 20 76 61 72 69 61 62 6c 65 73 0a 24 65 6e 64 69 | ..//Initializing.variables.$endi |
0280 | 6e 67 20 3d 20 22 7c 7c 22 3b 0a 24 73 74 72 20 3d 20 22 54 68 69 73 20 63 6f 6e 74 61 69 6e 73 | ng.=."||";.$str.=."This.contains |
02a0 | 5c 74 61 6e 64 20 73 70 65 63 69 61 6c 20 63 68 61 72 20 26 20 6e 75 6d 62 65 72 73 20 31 32 33 | \tand.special.char.&.numbers.123 |
02c0 | 2e 5c 6e 49 74 20 61 6c 73 6f 20 63 68 65 63 6b 73 20 66 6f 72 20 5c 30 20 63 68 61 72 22 3b 0a | .\nIt.also.checks.for.\0.char";. |
02e0 | 0a 2f 2f 20 64 69 66 66 65 72 65 6e 74 20 76 61 6c 75 65 73 20 66 6f 72 20 63 68 75 6e 6b 6c 65 | .//.different.values.for.chunkle |
0300 | 6e 0a 24 76 61 6c 75 65 73 20 3d 20 61 72 72 61 79 20 28 0a 20 20 30 2c 0a 20 20 31 2c 0a 20 20 | n.$values.=.array.(...0,...1,... |
0320 | 2d 31 32 33 2c 20 20 2f 2f 6e 65 67 61 74 69 76 65 20 69 6e 74 65 67 65 72 0a 20 20 30 32 33 34 | -123,..//negative.integer...0234 |
0340 | 2c 20 20 2f 2f 6f 63 74 61 6c 20 6e 75 6d 62 65 72 0a 20 20 30 78 31 41 2c 20 20 2f 2f 68 65 78 | ,..//octal.number...0x1A,..//hex |
0360 | 61 64 65 63 69 6d 61 6c 20 6e 75 6d 62 65 72 0a 20 20 50 48 50 5f 49 4e 54 5f 4d 41 58 2c 20 20 | adecimal.number...PHP_INT_MAX,.. |
0380 | 2f 2f 6d 61 78 20 70 6f 73 69 74 69 76 65 20 69 6e 74 65 67 65 72 20 6e 75 6d 62 65 72 0a 20 20 | //max.positive.integer.number... |
03a0 | 50 48 50 5f 49 4e 54 5f 4d 41 58 20 2a 20 33 2c 20 20 2f 2f 69 6e 74 65 67 65 72 20 6f 76 65 72 | PHP_INT_MAX.*.3,..//integer.over |
03c0 | 66 6c 6f 77 0a 20 20 2d 50 48 50 5f 49 4e 54 5f 4d 41 58 20 2d 20 31 2c 20 20 2f 2f 6d 69 6e 20 | flow...-PHP_INT_MAX.-.1,..//min. |
03e0 | 6e 65 67 61 74 69 76 65 20 69 6e 74 65 67 65 72 0a 0a 29 3b 0a 0a 66 6f 72 28 24 63 6f 75 6e 74 | negative.integer..);..for($count |
0400 | 20 3d 20 30 3b 20 24 63 6f 75 6e 74 20 3c 20 63 6f 75 6e 74 28 24 76 61 6c 75 65 73 29 3b 20 24 | .=.0;.$count.<.count($values);.$ |
0420 | 63 6f 75 6e 74 2b 2b 29 20 7b 0a 20 20 65 63 68 6f 20 22 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 | count++).{...echo."--.Iteration. |
0440 | 24 63 6f 75 6e 74 20 2d 2d 5c 6e 22 3b 0a 20 20 76 61 72 5f 64 75 6d 70 28 20 63 68 75 6e 6b 5f | $count.--\n";...var_dump(.chunk_ |
0460 | 73 70 6c 69 74 28 24 73 74 72 2c 20 24 76 61 6c 75 65 73 5b 24 63 6f 75 6e 74 5d 2c 20 24 65 6e | split($str,.$values[$count],.$en |
0480 | 64 69 6e 67 29 20 29 3b 0a 7d 0a 0a 65 63 68 6f 20 22 44 6f 6e 65 22 0a 3f 3e 0a 2d 2d 45 58 50 | ding).);.}..echo."Done".?>.--EXP |
04a0 | 45 43 54 46 2d 2d 0a 2a 2a 2a 20 54 65 73 74 69 6e 67 20 63 68 75 6e 6b 5f 73 70 6c 69 74 28 29 | ECTF--.***.Testing.chunk_split() |
04c0 | 20 3a 20 64 69 66 66 65 72 65 6e 74 20 69 6e 74 65 67 65 72 20 76 61 6c 75 65 73 20 66 6f 72 20 | .:.different.integer.values.for. |
04e0 | 27 63 68 75 6e 6b 6c 65 6e 27 20 2a 2a 2a 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 30 20 2d 2d | 'chunklen'.***.--.Iteration.0.-- |
0500 | 0a 0a 57 61 72 6e 69 6e 67 3a 20 63 68 75 6e 6b 5f 73 70 6c 69 74 28 29 3a 20 43 68 75 6e 6b 20 | ..Warning:.chunk_split():.Chunk. |
0520 | 6c 65 6e 67 74 68 20 73 68 6f 75 6c 64 20 62 65 20 67 72 65 61 74 65 72 20 74 68 61 6e 20 7a 65 | length.should.be.greater.than.ze |
0540 | 72 6f 20 69 6e 20 25 73 20 6f 6e 20 6c 69 6e 65 20 25 64 0a 62 6f 6f 6c 28 66 61 6c 73 65 29 0a | ro.in.%s.on.line.%d.bool(false). |
0560 | 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 31 20 2d 2d 0a 73 74 72 69 6e 67 28 32 31 33 29 20 22 54 | --.Iteration.1.--.string(213)."T |
0580 | 7c 7c 68 7c 7c 69 7c 7c 73 7c 7c 20 7c 7c 63 7c 7c 6f 7c 7c 6e 7c 7c 74 7c 7c 61 7c 7c 69 7c 7c | ||h||i||s||.||c||o||n||t||a||i|| |
05a0 | 6e 7c 7c 73 7c 7c 09 7c 7c 61 7c 7c 6e 7c 7c 64 7c 7c 20 7c 7c 73 7c 7c 70 7c 7c 65 7c 7c 63 7c | n||s||.||a||n||d||.||s||p||e||c| |
05c0 | 7c 69 7c 7c 61 7c 7c 6c 7c 7c 20 7c 7c 63 7c 7c 68 7c 7c 61 7c 7c 72 7c 7c 20 7c 7c 26 7c 7c 20 | |i||a||l||.||c||h||a||r||.||&||. |
05e0 | 7c 7c 6e 7c 7c 75 7c 7c 6d 7c 7c 62 7c 7c 65 7c 7c 72 7c 7c 73 7c 7c 20 7c 7c 31 7c 7c 32 7c 7c | ||n||u||m||b||e||r||s||.||1||2|| |
0600 | 33 7c 7c 2e 7c 7c 0a 7c 7c 49 7c 7c 74 7c 7c 20 7c 7c 61 7c 7c 6c 7c 7c 73 7c 7c 6f 7c 7c 20 7c | 3||.||.||I||t||.||a||l||s||o||.| |
0620 | 7c 63 7c 7c 68 7c 7c 65 7c 7c 63 7c 7c 6b 7c 7c 73 7c 7c 20 7c 7c 66 7c 7c 6f 7c 7c 72 7c 7c 20 | |c||h||e||c||k||s||.||f||o||r||. |
0640 | 7c 7c 00 7c 7c 20 7c 7c 63 7c 7c 68 7c 7c 61 7c 7c 72 7c 7c 22 0a 2d 2d 20 49 74 65 72 61 74 69 | ||.||.||c||h||a||r||".--.Iterati |
0660 | 6f 6e 20 32 20 2d 2d 0a 0a 57 61 72 6e 69 6e 67 3a 20 63 68 75 6e 6b 5f 73 70 6c 69 74 28 29 3a | on.2.--..Warning:.chunk_split(): |
0680 | 20 43 68 75 6e 6b 20 6c 65 6e 67 74 68 20 73 68 6f 75 6c 64 20 62 65 20 67 72 65 61 74 65 72 20 | .Chunk.length.should.be.greater. |
06a0 | 74 68 61 6e 20 7a 65 72 6f 20 69 6e 20 25 73 20 6f 6e 20 6c 69 6e 65 20 25 64 0a 62 6f 6f 6c 28 | than.zero.in.%s.on.line.%d.bool( |
06c0 | 66 61 6c 73 65 29 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 33 20 2d 2d 0a 73 74 72 69 6e 67 28 | false).--.Iteration.3.--.string( |
06e0 | 37 33 29 20 22 54 68 69 73 20 63 6f 6e 74 61 69 6e 73 09 61 6e 64 20 73 70 65 63 69 61 6c 20 63 | 73)."This.contains.and.special.c |
0700 | 68 61 72 20 26 20 6e 75 6d 62 65 72 73 20 31 32 33 2e 0a 49 74 20 61 6c 73 6f 20 63 68 65 63 6b | har.&.numbers.123..It.also.check |
0720 | 73 20 66 6f 72 20 00 20 63 68 61 72 7c 7c 22 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 34 20 2d | s.for...char||".--.Iteration.4.- |
0740 | 2d 0a 73 74 72 69 6e 67 28 37 37 29 20 22 54 68 69 73 20 63 6f 6e 74 61 69 6e 73 09 61 6e 64 20 | -.string(77)."This.contains.and. |
0760 | 73 70 65 63 69 61 6c 20 7c 7c 63 68 61 72 20 26 20 6e 75 6d 62 65 72 73 20 31 32 33 2e 0a 49 74 | special.||char.&.numbers.123..It |
0780 | 20 61 6c 73 7c 7c 6f 20 63 68 65 63 6b 73 20 66 6f 72 20 00 20 63 68 61 72 7c 7c 22 0a 2d 2d 20 | .als||o.checks.for...char||".--. |
07a0 | 49 74 65 72 61 74 69 6f 6e 20 35 20 2d 2d 0a 73 74 72 69 6e 67 28 37 33 29 20 22 54 68 69 73 20 | Iteration.5.--.string(73)."This. |
07c0 | 63 6f 6e 74 61 69 6e 73 09 61 6e 64 20 73 70 65 63 69 61 6c 20 63 68 61 72 20 26 20 6e 75 6d 62 | contains.and.special.char.&.numb |
07e0 | 65 72 73 20 31 32 33 2e 0a 49 74 20 61 6c 73 6f 20 63 68 65 63 6b 73 20 66 6f 72 20 00 20 63 68 | ers.123..It.also.checks.for...ch |
0800 | 61 72 7c 7c 22 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 36 20 2d 2d 0a 0a 57 61 72 6e 69 6e 67 | ar||".--.Iteration.6.--..Warning |
0820 | 3a 20 63 68 75 6e 6b 5f 73 70 6c 69 74 28 29 20 65 78 70 65 63 74 73 20 70 61 72 61 6d 65 74 65 | :.chunk_split().expects.paramete |
0840 | 72 20 32 20 74 6f 20 62 65 20 69 6e 74 2c 20 66 6c 6f 61 74 20 67 69 76 65 6e 20 69 6e 20 25 73 | r.2.to.be.int,.float.given.in.%s |
0860 | 20 6f 6e 20 6c 69 6e 65 20 25 64 0a 4e 55 4c 4c 0a 2d 2d 20 49 74 65 72 61 74 69 6f 6e 20 37 20 | .on.line.%d.NULL.--.Iteration.7. |
0880 | 2d 2d 0a 0a 57 61 72 6e 69 6e 67 3a 20 63 68 75 6e 6b 5f 73 70 6c 69 74 28 29 3a 20 43 68 75 6e | --..Warning:.chunk_split():.Chun |
08a0 | 6b 20 6c 65 6e 67 74 68 20 73 68 6f 75 6c 64 20 62 65 20 67 72 65 61 74 65 72 20 74 68 61 6e 20 | k.length.should.be.greater.than. |
08c0 | 7a 65 72 6f 20 69 6e 20 25 73 20 6f 6e 20 6c 69 6e 65 20 25 64 0a 62 6f 6f 6c 28 66 61 6c 73 65 | zero.in.%s.on.line.%d.bool(false |
08e0 | 29 0a 44 6f 6e 65 0a | ).Done. |