MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000701XdebugUsage problems (Wrong Results)public2011-07-05 10:432017-04-10 20:50
Reporterrusk 
Assigned Toderick 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformUNIXOSUbuntu LinuxOS Version10.10
Product Version2.1.0 
Target VersionFixed in Version2.5.2 
Summary0000701: Functions as array indexes.
Descriptionphp with xdebug stops script without any error messages even in server logs when you use function return value as array index. It affects some big commercial frameworks that make xdebug unusable...
Steps To Reproduce$array = array();
$array[strpos('apple','apple')] = apple;
Additional InformationUsage functions as array indexes is allowed in official PHP documentation.
TagsNo tags attached.
Operating System2.6.32-30-generic 0000059-Ubuntu i686 GNU/Linux
PHP Version5.3.6
Attached Files

- Relationships

-  Notes
(0001762)
derick (administrator)
2011-07-16 15:44

This script works just fine for me. Can you:

- upgrade to Xdebug 2.1.1

And then explain exactly when you get this problem.
- What are you doing?
- What is the command line?
- What are the PHP.ini settings for Xdebug (only)... etc.
(0001764)
rusk (reporter)
2011-07-26 16:02

The exact code from Expression Engine:

<?php
class EE_Functions {
    var $action_ids = array();
        function fetch_action_id($class, $method)
    {
        if ($class == '' OR $method == '')
        {
            return FALSE;
        }

        $this->action_ids[ucfirst($class)][$method] = $method;
        
        return 'AID:'.ucfirst($class).':'.$method.RD;
    }
}
$obj = new EE_Functions;
echo $obj->fetch_action_id("class", "method");

?>

This code works on production server without xdebug. On my local enviroinment it dies without any messages even in log on the line $this->action_ids[ucfirst($class)][$method] = $method;

If I assign ucfirst($class) to a variable and use that variable as array index it works fine.

xdebug settings are:


xdebug.remote_enable=On
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_autostart=off
xdebug.remote_mode=req
xdebug.show_mem_delta=On
xdebug.auto_trace=On
xdebug.collect_assignments=On
xdebug.profiler_enable=On
xdebug.show_exception_trace=On
xdebug.show_local_vars=On
xdebug.overload_var_dump=On
xdebug.show_local_vars=1
html_errors=On
xdebug.max_nesting_level = 5000
(0001766)
derick (administrator)
2011-07-28 09:15

I do not get a crash here, but I do see memory reading errors with valgrind.
(0002027)
derick (administrator)
2012-04-03 16:42

I've fixed the crash for Xdebug 2.2.0, but the real fix will have to wait.
(0003803)
derick (administrator)
2016-11-28 15:45

Right now, we print ???, but we need to see whether we can figure out the actual value.

- Issue History
Date Modified Username Field Change
2011-07-05 10:43 rusk New Issue
2011-07-16 15:44 derick Note Added: 0001762
2011-07-16 15:44 derick Assigned To => derick
2011-07-16 15:44 derick Status new => feedback
2011-07-26 16:02 rusk Note Added: 0001764
2011-07-26 16:02 rusk Status feedback => assigned
2011-07-28 09:15 derick Note Added: 0001766
2012-03-12 16:25 derick Target Version => 2.2.0
2012-04-03 16:42 derick Target Version 2.2.0 => 2.2.1
2012-04-03 16:42 derick Note Added: 0002027
2012-04-07 17:27 derick Severity crash => minor
2012-07-14 23:14 derick Target Version 2.2.1 => 2.2.2
2013-03-23 14:50 derick Target Version 2.2.2 => 2.2.3
2013-05-22 04:51 derick Target Version 2.2.3 => 2.2.x
2016-07-31 13:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 13:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2016-11-28 15:45 derick Note Added: 0003803
2016-11-28 15:45 derick Status assigned => confirmed
2017-04-10 20:50 derick Status confirmed => closed
2017-04-10 20:50 derick Resolution open => fixed
2017-04-10 20:50 derick Fixed in Version => 2.5.2


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker