|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-11 11:45 UTC] sniper@php.net
[2003-08-12 04:12 UTC] michiel at tincan dot co dot uk
[2003-08-12 09:06 UTC] sniper@php.net
[2003-08-12 09:12 UTC] michiel at tincan dot co dot uk
[2003-08-12 09:18 UTC] sniper@php.net
[2003-08-13 03:57 UTC] michiel at tincan dot co dot uk
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 17:00:01 2025 UTC |
Description: ------------ When upgrading to 4.3.2 this started to happen: whenever I use $string = preg_replace("/\[$pattern\]/",$replacement,$string) and the $pattern is empty or does not exist, but the replacement is an array, my string is made empty. '. /configure' '--prefix= /usr /local' '--with-apxs= /usr /local /apache-1.3.27 /bin /apxs' '--with-config-file-path= /etc' '--with-mysql= /usr' '--with-ldap' '--enable-sysvshm=yes' '--enable-sysvsem=yes' '--with-gd= /usr' '--with-gettext' '--with-xml' '--with-imap' '--enable-sockets' '--enable-ftp' '--with-regex=system' '--enable-track-vars=yes' '--enable-force-cgi-redirect=yes' '--enable-memory-limit=yes' '--enable-debug=no' Register Globals is "on" Reproduce code: --------------- $data = array( "field1" => "somevalue", "field2" => array("hmm","whassup"), ); $html = '<b>[field1]</b> ,<h1>[field3]</h1>'; while (list($field,$fielddata) = each ($data)) { $html = preg_replace("/\[$field\]/",$fielddata,$html); } print $html; # will print nothing. however if you comment out the line "field2" etc above, it will print something Expected result: ---------------- output should be : <b>somevalue</b> , <h1>[field3]</h1> Actual result: -------------- no output, the string $html is empty