php.net |  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
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
)



Patches

Pull Requests

History

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.
http://edit.php.net/?patchID=795&project=PHP
 [2013-01-12 00:11 UTC] frozenfire@php.net
Automatic comment from SVN on behalf of frozenfire
Revision: http://svn.php.net/viewvc/?view=revision&revision=329086
Log: Added example output for examples 1 and 2.
Contribution by Ole Aass.
Closes bug #63869.
 [2013-01-12 00:12 UTC] frozenfire@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: frozenfire
 [2013-01-12 00:12 UTC] frozenfire@php.net
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
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC