php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68323 Array makes server crash
Submitted: 2014-10-29 15:22 UTC Modified: 2021-02-14 04:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: vicentedeteresa at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: *General Issues
PHP Version: 5.4.34 OS: MacOs
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
30 + 1 = ?
Subscribe to this entry?

 
 [2014-10-29 15:22 UTC] vicentedeteresa at gmail dot com
Description:
------------
doing a foreach with an open array inside, this make a server crash, reporting a Segmentation fault on server log and throwing a fatal error on php-log first.


Server log:

[Wed Oct 29 15:57:46.962708 2014] [core:notice] [pid 1986] AH00052: child pid 5856 exit signal Segmentation fault (11)



PhP log:

[29-Oct-2014 15:57:46 Europe/Berlin] PHP Fatal error:  Cannot use [] for reading in /Applications/XAMPP/xamppfiles/htdocs/index/dev_core_cea/core/app/Plugin/Comparador/Controller/ApuestasController.php on line 863

Test script:
---------------
	foreach($apostadores[$x]['Apuestas'] as $apuesta){
				$apuesta[];
	}
			
			

Expected result:
----------------
I Spect to see an syntax error


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-10-29 17:27 UTC] edgar dot r dot sandi at gmail dot com
but you have a syntax error

if you want doing a empty array inside foreach you need to do:

foreach($apostadores[$x]['Apuestas'] as $apuesta){
    $apuesta = array();
}
 [2021-02-03 12:13 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-02-03 12:13 UTC] cmb@php.net
Is this still an issue with any of the actively supported PHP
versions[1]?  If so, please provide a stack backtrace[2].

[1] <https://www.php.net/supported-versions.php>
[2] <https://bugs.php.net/bugs-generating-backtrace.php>
 [2021-02-14 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Aug 10 05:05:46 2022 UTC