|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61925 Crashes on using variable equal to conditional shortcut
Submitted: 2012-05-03 16:12 UTC Modified: 2013-02-18 00:35 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: alex dot erwin at dilithiumtoys dot com Assigned:
Status: No Feedback Package: *Programming Data Structures
PHP Version: 5.4.1 OS: Windows 7 32-bit
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: alex dot erwin at dilithiumtoys dot com
New email:
PHP Version: OS:


 [2012-05-03 16:12 UTC] alex dot erwin at dilithiumtoys dot com
I am using Apache 2.4 with PHP 5.4 on Windows 7 32bit. When executing the code shown, from within a private class method, the server crashes. PHP is compiled as a DSO. If the code is changed to utilize long form conditional processing the execution works.

If I use the command line to execute the script, the class loaded by require does not get called.

// my index.php
$x = new a();

// my a.php
class a { __constructor(){ $this->import_variables($_POST); }}

further code in test script.

Test script:
# retrieve caller name
$calledby = debug_backtrace(); print_r($calledby);
// does not work
$caller = (strlen($calledby[1]['class'])) ? $calledby[1]['class'] : $calledby[0]['class'];
// works and does does not segfault
if (strlen($calledby[1]['class']))  $caller = $calledby[1]['class'];
else                                $caller = $calledby[0]['class'];

# arguments are required
if (!func_num_args()) { return; }
# fill variables with argument contents if exists
$variables = (func_num_args() == 0) ? NULL : (is_array(func_get_arg(0)) ? func_get_arg(0) : NULL);

Expected result:
I expect that Apache will not SEGFAULT


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-12 02:34 UTC]
Please try using this snapshot:
For Windows:

Could you please try lastest version.

I can't reproduce it.
 [2012-09-12 02:34 UTC]
-Status: Open +Status: Feedback
 [2013-02-18 00:35 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 "Open". Thank you.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Jan 23 01:03:33 2022 UTC