|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: news at globtek dot com
New email:
PHP Version: OS:


 [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-2023 The PHP Group
All rights reserved.
Last updated: Tue Dec 05 02:01:26 2023 UTC