# Fwd:  RC1

- Thread: https://externals.io/message/8123
- Original archive: https://news-web.php.net/php.internals/8123
- Started by Andi Gutmans on 2004-02-25T14:41:09+00:00
- Messages: 7
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #8123 — Andi Gutmans — 2004-02-25T14:41:09+00:00

URL: https://externals.io/message/8123#8123

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] RC1
>
>Hey,
>
>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

---

## #8134 — Timm Friebe — 2004-02-26T00:33:10+00:00

URL: https://externals.io/message/8123#8134 · In reply to: #8123

> 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

---

## #8141 — Timm Friebe — 2004-02-26T03:10:27+00:00

URL: https://externals.io/message/8123#8141 · In reply to: #8123

> 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

---

## #8145 — Timm Friebe — 2004-02-26T04:50:17+00:00

URL: https://externals.io/message/8123#8145 · In reply to: #8134

> 
> > […]

...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

---

## #8146 — Timm Friebe — 2004-02-26T05:27:11+00:00

URL: https://externals.io/message/8123#8146 · In reply to: #8145

> 
> > […]
> 
> ...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

---

## #8157 — Marcus Boerger — 2004-02-26T07:57:52+00:00

URL: https://externals.io/message/8123#8157 · In reply to: #8146

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:

> 
> > […]

> 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

---

## #8250 — Timm Friebe — 2004-02-28T16:04:44+00:00

URL: https://externals.io/message/8123#8250 · In reply to: #8157

> 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
