php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12929 crash in array_map with associative arrays
Submitted: 2001-08-23 12:38 UTC Modified: 2001-08-23 22:00 UTC
From: wico at cnh dot nl Assigned: andrei (profile)
Status: Closed Package: Reproducible crash
PHP Version: 4.0.6 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: wico at cnh dot nl
New email:
PHP Version: OS:

 

 [2001-08-23 12:38 UTC] wico at cnh dot nl
Have fun:
<?
	$data = Array('a','b','c'); // works
#	$data = Array(1 => 'a', 2 => 'b', 3 => 'c');  // crash
#	$data = Array('1' => 'a', '2' => '3'); // crash

	$plop = array_map('addslashes', $data);
	die("I didn't crash :)");
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-23 21:06 UTC] andrei@php.net
I can fix the crash, but what should be done with the keys? Should they be just ignored? I think it only makes sense to preserve them if you are mapping a single arrays, in case there are 2 or more, the keys are useless.. agree?
 [2001-08-23 22:00 UTC] andrei@php.net
Fixed in CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 25 20:01:25 2024 UTC