Doc #77848 [NEW]: Documentation on the /e removal is misleading
| From: | ksours at internetbrands dot com | Date: | Thu, 04 Apr 2019 23:33:22 +0000 |
| Subject: | Doc #77848 [NEW]: Documentation on the /e removal is misleading | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-16549@lists.php.net to get a copy of this message | ||
From: ksours at internetbrands dot com
Operating system:
PHP version: 7.1.28
Package: PCRE related
Bug Type: Documentation Problem
Bug description:Documentation on the /e removal is misleading
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 bug report at https://bugs.php.net/bug.php?id=77848&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77848&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77848&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77848&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77848&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77848&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77848&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77848&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77848&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77848&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77848&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77848&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77848&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77848&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77848&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77848&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77848&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77848&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77848&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77848&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77848&r=mysqlcfg