Re: Conditional class definition in PHP 4.3.x

From: Date: Tue, 06 Jan 2004 21:23:05 +0000
Subject: Re: Conditional class definition in PHP 4.3.x
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-6820@lists.php.net to get a copy of this message
At 18:58 06/01/2004, Alan Knowles wrote:
This only affects single line conditional class and function declarations. php -r ' if (1) { function test () { echo "1"; }} else { function test() { echo "0"; }} test();' It affects php4.3.2 and up. (and probably alot earlier....)
Wow, that's a neat one. Took me a while to realize what the heck is going on, but basically it has to do with the way the engine mangles function/class names. It's based on the file name and the line number. This *usually* works, practically, it always works except for when using -r (which probably didn't exist at the time we introduced this mangling... Anyway, I'll look into fixing it. Thanks for pinpointing the problem! Zeev

« previous php.internals (#6820) next »