|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-05-08 23:26 UTC] felipe@php.net
[2009-05-09 01:18 UTC] saulo_gil at argentina dot com
[2009-05-09 04:03 UTC] jani@php.net
[2009-05-09 18:27 UTC] nlopess@php.net
[2009-05-09 22:52 UTC] saulo_gil at argentina dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 11:00:02 2025 UTC |
Description: ------------ If I try to perform a simple concatenation involving a variable created from the matches output of preg_match_all() the resulting string is borked. Please see the code above. What I want to do: echo "[" . $var . "]"; Reproduce code: --------------- <? function foo($s) { preg_match_all("/PROCEDURE (.*)/i", $s, $matches); $name = (string) $matches[1][0]; echo $name . "\n"; return "[" . $name . "]"; } $s = "use providers go ALTER PROCEDURE SPD_EXECUTIVE_PROVIDER_DEALER ( @EXECUTIVE_PROVIDER_ID KEY_ID, @USER_SESSION_ID ID ) /* Procedimiento : SPD_EXECUTIVE_PROVIDER_DEALER"; echo foo($s); ?> Expected result: ---------------- [SPD_EXECUTIVE_PROVIDER_DEALER] Actual result: -------------- ]SPD_EXECUTIVE_PROVIDER_DEALER