php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #77848 Documentation on the /e removal is misleading
Submitted: 2019-04-04 23:33 UTC Modified: 2019-04-17 14:22 UTC
From: ksours at internetbrands dot com Assigned: cmb (profile)
Status: Closed Package: PCRE related
PHP Version: 7.1.28 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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ksours at internetbrands dot com
New email:
PHP Version: OS:

 

 [2019-04-04 23:33 UTC] ksours at internetbrands dot com
Description:
------------
At https://www.php.net/manual/en/function.preg-replace.php it says
"As of PHP 7.0.0 E_WARNING is emitted in this case and "\e" modifier has no effect."

This implies that the results of the function should be the same whether or not the /e modifier is present.  But the actual result is that preg_replace returns null if the modifier is there regardless of the RE or the target string.

I have no particular problem with the behavior, but the documentation should reflect it.

Test script:
---------------
$x = "1 2 3 a b c 4";

$y = preg_replace("#\d#e", 'X', $x));
$z = preg_replace("#\d#", 'X', $x));

//documentation implies that $y == $z


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-04-17 14:21 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=347268
Log: Fix #77848: Documentation on the /e removal is misleading
 [2019-04-17 14:22 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2019-04-17 14:22 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2019-04-17 14:25 UTC] salathe@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=5880b2ecbb93ae87c4bcf448a39c2b8c1d23cf0c
Log: Fix #77848: Documentation on the /e removal is misleading
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Nov 17 12:01:34 2019 UTC