Doc #77848 [Opn->Csd]: Documentation on the /e removal is misleading

From: Date: Wed, 17 Apr 2019 14:22:06 +0000
Subject: Doc #77848 [Opn->Csd]: Documentation on the /e removal is misleading
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16597@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77848&edit=1 ID: 77848 Updated by: cmb@php.net Reported by: ksours at internetbrands dot com Summary: Documentation on the /e removal is misleading -Status: Open +Status: Closed Type: Documentation Problem Package: PCRE related PHP Version: 7.1.28 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2019-04-17 14:21:50] 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-04 23:33:22] 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77848&edit=1

« previous php.doc.bugs (#16597) next »