Re: Weird engine problem

From: Date: Wed, 22 Sep 2004 20:53:49 +0000
Subject: Re: Weird engine problem
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-12940@lists.php.net to get a copy of this message
Hello Sebastian, Wednesday, September 22, 2004, 9:52:18 PM, you wrote: > For quite a while I have been fighting with what I believe to be a bug in > the Zend Engine 2. > In PHPUnit2 I have the following code: > public function run(PHPUnit2_Framework_Test $test) { > // $test->name: string(14) "testGetBalance" > $this->startTest($test); > try { > // $test->name: string(14) "testGetBalance" > $test->runBare(); > } > catch (PHPUnit2_Framework_AssertionFailedError $e) { > // $test->name: string(14) "testgetbalance" > $this->addFailure($test, $e); > } > catch (Exception $e) { > // $test->name: string(14) "testgetbalance" > $this->addError($test, $e); > } > // $test->name: string(14) "testgetbalance" > $this->endTest($test); > } > The object referenced by the variable $test has a private attribute > called "name". The value of this attribute somehow get lowercased > when the object is used inside the catch-block. > My effort to come up with a small, reproducing script for this issue > has yet to bear fruit as the obvious approach > <?php > class Foo { > private $bar = 'BAR'; > } > class Bar { > public function doSomething(Foo $foo) { > var_dump($foo); > try { > var_dump($foo); > throw new Exception('...'); > } > catch (Exception $e) { > var_dump($foo); > } > var_dump($foo); > } > } > $f = new Foo; > $b = new Bar; > $b->doSomething($f); > ?> > does not show the problem. > Any idea what I might be missing here? Is there some way to debug the > engine to see where the lowercasing happens? > Thanks! > -- > Sebastian Bergmann > http://www.sebastian-bergmann.de/ > GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69 Disallow inlining and set a breakpoint on zend_str_tolower_copy() is most likely responsible for downcasing if the engine is the problem.... Best regards, Marcus mailto:helly@php.net

« previous php.internals (#12940) next »