#42238 [Opn->Bgs]: var_dump of preg_match array hangs script

From: Date: Tue, 07 Aug 2007 21:48:04 +0000
Subject: #42238 [Opn->Bgs]: var_dump of preg_match array hangs script
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115857@lists.php.net to get a copy of this message
ID: 42238 Updated by: scottmac@php.net Reported By: redsandro at gmail dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux / WinXP PHP Version: 5.2.4RC1 New Comment: When you know you have an older version at least try upgrading it before reporting a bug. Can't reproduce though. Previous Comments: ------------------------------------------------------------------------ [2007-08-07 21:26:04] redsandro at gmail dot com Description: ------------ When preg_matching a multiline string containing '<?', dumping the resulting $matches array hangs the script engine. I've noticed the same in php 4.4.1 and 5.2.1. Reproduce code: --------------- <?php echo '<pre>'; $var = "<? // <- Remove first two chars and this script won't hang."; $pattern = "/^(.+)$/s"; preg_match($pattern, $var, $matches); print_r($matches); exit; Expected result: ---------------- Array ( [0] => <? // <- Remove first two chars and this script won't hang. [1] => <? // <- Remove first two chars and this script won't hang. ) Actual result: -------------- Array ( ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42238&edit=1

« previous php.bugs (#115857) next »