View Issue Details

IDProjectCategoryView StatusLast Update
0000701XdebugUncategorizedpublic2017-04-10 19:50
Reporterrusk Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformUNIXOSUbuntu LinuxOS Version10.10
Product Version2.1.0 
Fixed in Version2.5.2 
Summary0000701: Functions as array indexes.
Description

php 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 Information

Usage 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

Activities

derick

2011-07-16 14:44

administrator   ~0001762

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.

rusk

2011-07-26 15:02

reporter   ~0001764

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

derick

2011-07-28 08:15

administrator   ~0001766

I do not get a crash here, but I do see memory reading errors with valgrind.

derick

2012-04-03 15:42

administrator   ~0002027

I've fixed the crash for Xdebug 2.2.0, but the real fix will have to wait.

derick

2016-11-28 15:45

administrator   ~0003803

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 09:43 rusk New Issue
2011-07-16 14:44 derick Note Added: 0001762
2011-07-16 14:44 derick Assigned To => derick
2011-07-16 14:44 derick Status new => feedback
2011-07-26 15:02 rusk Note Added: 0001764
2011-07-26 15:02 rusk Status feedback => assigned
2011-07-28 08:15 derick Note Added: 0001766
2012-03-12 16:25 derick Target Version => 2.2.0
2012-04-03 15:42 derick Target Version 2.2.0 => 2.2.1
2012-04-03 15:42 derick Note Added: 0002027
2012-04-07 16:27 derick Severity crash => minor
2012-07-14 22: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 03:51 derick Target Version 2.2.3 => 2.2.x
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12: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 19:50 derick Status confirmed => closed
2017-04-10 19:50 derick Resolution open => fixed
2017-04-10 19:50 derick Fixed in Version => 2.5.2
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized