|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-09-09 08:57 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 16:00:01 2025 UTC |
Description: ------------ preg_replace changes replaced string encoding when replacement parameter is double quoted. Reproduce code: --------------- $source = 'asdfasd asdf asdf [company=456[replacement]] asdf'; echo preg_replace('~\[\s*company=([0-9]+)\[\s*([^\]]+\s*)\]\]~', '\2', $source); echo preg_replace('~\[\s*company=([0-9]+)\[\s*([^\]]+\s*)\]\]~', "\2", $source); Expected result: ---------------- asdfasd asdf asdf replacement asdf asdfasd asdf asdf replacement asdf Actual result: -------------- asdfasd asdf asdf replacement asdf asdfasd asdf asdf asdf