Doc #63869 [NEW]: preg_split examples 1&2 are missing expected output

From: Date: Fri, 28 Dec 2012 19:21:09 +0000
Subject: Doc #63869 [NEW]: preg_split examples 1&2 are missing expected output
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9328@lists.php.net to get a copy of this message
From:             news at globtek dot com
Operating system: 
PHP version:      Irrelevant
Package:          *Regular Expressions
Bug Type:         Documentation Problem
Bug description:preg_split examples 1&2 are missing expected output

Description:
------------
---
From manual page:
http://www.php.net/function.preg-split#refsect1-function.preg-
split-examples
---

Examples 1&2 for the preg_split documentation page are missing the "The
above 
example will output" section underneath. It's still useful to see the
output 
without trying to figure out what the comment is talking about.

The output is included in the expected result section

Test script:
---------------
code examples ran:

example 1:
        $keywords = preg_split("/[\s,]+/", "hypertext language,
programming");
        print_r($keywords);

example 2:
        $str      = 'string';
        $chars    = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY);
        print_r($chars);


Expected result:
----------------
Example 1 expected output:

Array
(
    [0] => hypertext
    [1] => language
    [2] => programming
)


example 2 expected output:

Array
(
    [0] => s
    [1] => t
    [2] => r
    [3] => i
    [4] => n
    [5] => g
)



-- 
Edit bug report at https://bugs.php.net/bug.php?id=63869&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=63869&r=trysnapshot54
Try a snapshot (PHP 5.3):   https://bugs.php.net/fix.php?id=63869&r=trysnapshot53
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=63869&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63869&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63869&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63869&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63869&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63869&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63869&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63869&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=63869&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=63869&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63869&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63869&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63869&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63869&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63869&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63869&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63869&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63869&r=mysqlcfg



Thread (3 messages)

« previous php.doc.bugs (#9328) next »