#49597 [Opn->Fbk]: sprintf('%s',join('',array(false))); crashes
| From: | jani@php.net | Date: | Sat, 19 Sep 2009 14:38:55 +0000 |
| Subject: | #49597 [Opn->Fbk]: sprintf('%s',join('',array(false))); crashes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-142568@lists.php.net to get a copy of this message | ||
ID: 49597
Updated by: jani@php.net
Reported By: markgdesign at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: Reproducible crash
Operating System: Windows Vista Home
PHP Version: 5.2.11
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
I can not reproduce this.
Previous Comments:
------------------------------------------------------------------------
[2009-09-19 02:36:35] markgdesign at gmail dot com
Description:
------------
An array with a false or null element, joined, then used in sprintf
apparently causes PHP to crash. Actually, Apache cycles endlessly
making
the OS think it has crashed.
This is the simplest expression I can create which causes the problem:
sprintf('%s',join('',array(false)));
Forcing the result of join into type string avoids the problem:
sprintf('%s',(string) join('',array(false)));
Reproduce code:
---------------
sprintf('%s',join('',array(false)));
Expected result:
----------------
I expected it to join all array elements (interpreting false and null
values as empty strings) and pass it to sprintf.
Actual result:
--------------
Apache cycled without responding to the page request. The Windows OS
interpreted this as a crash, although Apache did not actually stop
working or need to be restarted.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49597&edit=1