#42238 [NEW]: var_dump of preg_match array hangs script

From: Date: Tue, 07 Aug 2007 21:26:04 +0000
Subject: #42238 [NEW]: var_dump of preg_match array hangs script
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115856@lists.php.net to get a copy of this message
From: redsandro at gmail dot com Operating system: Linux / WinXP PHP version: 5.2.4RC1 PHP Bug Type: Scripting Engine problem Bug description: var_dump of preg_match array hangs script 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 bug report at http://bugs.php.net/?id=42238&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42238&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42238&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42238&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42238&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42238&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42238&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42238&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42238&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42238&r=support Expected behavior: http://bugs.php.net/fix.php?id=42238&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42238&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42238&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42238&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42238&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42238&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42238&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42238&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42238&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42238&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42238&r=mysqlcfg

« previous php.bugs (#115856) next »