Quick reminder...
If you have any bugs to fix, please fix them in the coming days.
Andi
Date: Thu, 12 Feb 2004 21:59:24 +0200
To: internals@lists.php.net
From: Andi Gutmans andi@zend.com
Subject: [PHP-DEV] RC1Hey,
Now Beta 4 is out of the door I think March 1st is a realistic date to get
RC1 out of the door.
I think Zeev and I attacked most of the serious engine issues which were
keeping things from going smoothly (hence the Beta 4).
All we really need for RC1 to go out in this time frame is for extension
maintainers to step up and make sure that you solve any remaining bug
fixes which you think are critical for PHP 5.0. I don't think there are
that many issues but probably the more modern extensions which are
interfacing with the new engine's features might still have a few quirks.Good luck to everyone!
Andi
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
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
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
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:
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
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
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