php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10574 Gets stuck on explode() when delimiter is not in the string
Submitted: 2001-05-01 06:23 UTC Modified: 2001-05-13 15:46 UTC
From: xyztheweb at hotmail dot com Assigned:
Status: Closed Package: Arrays related
PHP Version: 4.0.5 OS: WIN NT4
Private report: No CVE-ID: None
 [2001-05-01 06:23 UTC] xyztheweb at hotmail dot com
If I perform an 
explode(",",$str);
on
$str = "hi there this is a test";

Php gets "stuck" and can eventually bing the memroy of the server down.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-02 23:19 UTC] sniper@php.net
I can't reproduce this with latest CVS on Linux using
the following test script:

<?php

$str = "this test string doesnt include the separator char";
$arr = explode(";", $str);

?>

--Jani

 [2001-05-03 14:21 UTC] xyztheweb at hotmail dot com
Maybe is a bug related to WIN NT ?
Do you need more info about the settings of my phpinfo() ?
 [2001-05-03 15:08 UTC] andi@php.net
I can't reproduce this on Windows either. Can you please try and run this from command line and see if it still creates problems? Without any prepends or anything
 [2001-05-07 12:42 UTC] sbergmann@php.net
Can't reproduce this with PHP 4.0.6-dev either, on Win2K. Tested it both from the command-line with 'php -q test.php', as via Apache.

 [2001-05-13 15:22 UTC] xyztheweb at hotmail dot com
You are right this is no bug on explode().

The problem is if you explode into a database (which PHP tends to get stuck on imploding bad queries).
Thanks for your time on this report, anyway.
 [2001-05-13 15:46 UTC] derick@php.net
User says it's not a bug in PHP
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 20:01:45 2024 UTC