[SOLVED] Associative arrays crash PHP 5.1.2 APD+Xdebug

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

[SOLVED] Associative arrays crash PHP 5.1.2 APD+Xdebug

Post by Ambush Commander »

I have this code on my page:

Code: Select all

echo "<li><a href=\"$WEBPATH/$LANG/$value\"{$active}>{$STRINGS['Menu'][$value]}</a></li>";
For some reason, PHP 5.1.2 with APD pukes on it (like, process level termination). Remove APD, and we're fine. Switch to PHP4 and we're fine too. Why???
Last edited by Ambush Commander on Thu Apr 13, 2006 10:55 am, edited 3 times in total.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Hmm... XDebug and APD are clobbering each other. var_dump($STRINGS['Menu']) also sets off the error.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

XDebug seems to have ceased working in PHP5 too. Well, scratch that, SOLVED.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I've got XDebug working in 5.1.2 just fine. :?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

(back from vacation, sorry if this is an old thread) Well, I'm running Windows, so I have to use the precompiled version. Running from CVS?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

After some screwing around, APD did start crashing Apache (consistently) although var_dump() always worked for me.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Well, it was really more the var_dumping of arrays. var_dump('a string'); worked.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I was able to var_dump anything and everything.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Here are some test results:

Code: Select all

; PHP 5.1.2, no XDebug
extension = php_apd.dll ; pecl4win 5.1.2 compile, shows up as 1.0.2-dev
apd_set_pprof_trace() works like a charm.

Code: Select all

; PHP 5.1.2
extension = php_apd.dll
zend_extension_ts = C:\php\5.1.2\ext\php_xdebug.dll ; pecl4win 5.1.2 compile, shows up as 2.0.0rc1-dev
XDebug registers in phpinfo(); FastCGI crashes on code involving ASSOCIATIVE ARRAYS (i.e. Hashes):

Code: Select all

$array = array('asdf');
echo $array[0];
... doesn't crash, but:

Code: Select all

$array = array('asdf' => 'asdf');
echo $array['asdf'];
does crash. var_dump, however, works in all its colorized glory, as does error stack traces.

Code: Select all

; PHP 5.1.2, no APD
zend_extension_ts = C:\php\5.1.2\ext\php_xdebug.dll ; pecl4win 5.1.2 compile, shows up as 2.0.0rc1-dev
XDebug works, associative arrays work. No profiling.

It IS clobbering, after all! :?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

http://xdebug.org/install.php wrote: COMPATIBILITY

Xdebug does not work together with the Zend Optimizer or any other Zend extension (DBG, APC, APD etc). This is due to compatibility problems with those modules. We will be working on figuring out what the problems are, and of course try to fix those.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Whee. Well, that was stupid of me. I guess having it work for PHP4 made me forget about that disclaimer.
Post Reply