|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63869 preg_split examples 1&2 are missing expected output
Submitted: 2012-12-28 19:21 UTC Modified: 2013-01-12 00:12 UTC
From: news at globtek dot com Assigned: frozenfire (profile)
Status: Closed Package: *Regular Expressions
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2012-12-28 19:21 UTC] news at globtek dot com
From manual page:

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");

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

Expected result:
Example 1 expected output:

    [0] => hypertext
    [1] => language
    [2] => programming

example 2 expected output:

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-31 21:41 UTC] mail+php at requinix dot net
Did you know you can submit changes to the online documentation? Look for the edit 
link in the top-right corner of manual pages.

Created a patch.
 [2013-01-12 00:11 UTC]
Automatic comment from SVN on behalf of frozenfire
Log: Added example output for examples 1 and 2.
Contribution by Ole Aass.
Closes bug #63869.
 [2013-01-12 00:12 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: frozenfire
 [2013-01-12 00:12 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 02:01:28 2024 UTC