Fwd: RC1

php.internals

Andi Gutmans

22 years ago
Quick reminder... If you have any bugs to fix, please fix them in the coming days. Andi

Timm Friebe

22 years ago
On Wed, 2004-02-25 at 15:41, Andi Gutmans wrote:
> Quick reminder... > If you have any bugs to fix, please fix them in the coming days.
The following: ------------------------------------------------------------------ <?php class Base { public $id= 0; } class Child extends Base { public $prop= ''; } $p= &new Reflection_Property('Child', 'id'); echo 'Child::$id => ', $p->getDeclaringClass()->getName(), "\n"; $p= &new Reflection_Property('Child', 'prop'); echo 'Child::$prop => ', $p->getDeclaringClass()->getName(), "\n"; ?> ------------------------------------------------------------------ currently prints out: Child::$id => Base Child::$prop => Base Expected output is: Child::$id => Base Child::$prop => Child Fix is attached. It also includes two more fixes. The first one replaces searching for a zval** in ce->properties_info by passing a char* (we will actually find something then:)). The second one fixes wrong reporting of getDeclaringClass() in a situation in which the above test script would have a private $prop in the Base class. - Timm

Timm Friebe

22 years ago
On Thu, 2004-02-26 at 01:33, Timm Friebe wrote:
> On Wed, 2004-02-25 at 15:41, Andi Gutmans wrote: > > Quick reminder... > > If you have any bugs to fix, please fix them in the coming days.
...and another one: $ cat protected.php <?php class A { protected function __construct() { echo "Constructor was called\n"; } } $r= new Reflection_Class('A'); var_dump($r->newInstance()); ?> $ php-dev protected.php Constructor was called object(A)#2 (0) { } This should not be allowed. The following patch includes a fix for this and the problems mentioned with Reflection_Property:: getDeclaringClass(). - Timm

Timm Friebe

22 years ago
On Thu, 2004-02-26 at 05:50, Timm Friebe wrote:
> On Thu, 2004-02-26 at 01:33, Timm Friebe wrote: > > On Wed, 2004-02-25 at 15:41, Andi Gutmans wrote: > > > Quick reminder... > > > If you have any bugs to fix, please fix them in the coming days. > > ...and another one:
And yet another one (includes, as before, all of the following) and fixes the following (by adding a convert_to_string_ex() at the appropriate place): $ cat reflection_segfault.php <?php $r= new Reflection_Class(NULL); ?> $ php-dev reflection_segfault.php Segmentation fault (core dumped) - Timm

Marcus Börger

22 years ago
Hello Timm, i think this is not completley correct. When reflection is used from a static member of the class itself it should still work. We have functions which enable such checks. Could you have a try with those? Also i have already incorporated the other patch so you need to update the engine sources. regards marcus Thursday, February 26, 2004, 6:27:11 AM, you wrote:
> On Thu, 2004-02-26 at 05:50, Timm Friebe wrote: >> On Thu, 2004-02-26 at 01:33, Timm Friebe wrote: >> > On Wed, 2004-02-25 at 15:41, Andi Gutmans wrote: >> > > Quick reminder... >> > > If you have any bugs to fix, please fix them in the coming days. >> >> ...and another one:
> And yet another one (includes, as before, all of the following) and > fixes the following (by adding a convert_to_string_ex() at the > appropriate place):
> $ cat reflection_segfault.php > <?php > $r= new Reflection_Class(NULL);
?>>
> $ php-dev reflection_segfault.php > Segmentation fault (core dumped)
> - Timm
-- Best regards, Marcus mailto:helly@php.net

Timm Friebe

22 years ago
On Thu, 2004-02-26 at 08:57, Marcus Boerger wrote:
> Hello Timm, > > i think this is not completley correct. When reflection is used from a > static member of the class itself it should still work.
Correct: class Foo { protected function __construct() { } public static function create() { $r= new Reflection_Class('Foo'); return $r->newInstance(); } } should work as newInstance() is called within the context "Foo".
> We have functions which enable such checks.
I've tried to find out which context I am in. Alas, EG(scope)->name contains "reflection_class" at the moment I'm trying to check it. Something like EG(prev_execute_data) might help, but I'm not sure I should be using it:)
> Could you have a try with those? Also i have > already incorporated the other patch so you need to update the engine > sources.
I saw that, but you missed this one (fixes the following segfault: $ cat reflection_segfault.php <?php $r= new Reflection_Class(NULL); ?> $ php-dev reflection_segfault.php Segmentation fault (core dumped) Attached is a one-line patch that fixes it. - Timm

Timm Friebe

22 years ago
On Wed, 2004-02-25 at 15:41, Andi Gutmans wrote:
> Quick reminder... > If you have any bugs to fix, please fix them in the coming days.
Not a bug, but a feature request - make set_exception_handler() accept the meta-type "callable" instead of only strings. - Timm