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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
50 + 39 = ?
Subscribe to this entry?

 
 [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
 [2020-02-07 06:05 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=d31d783a65e77b7d96113bb4a8d679a7652fe0b6
Log: Fix #77848: Documentation on the /e removal is misleading
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC