FAQ
Hi,

I am wondering whether a child class is always stored after its parent
class in EG(class_table) because I would like to rely on this behaviour
for the result of get_declared_classes().

Thanks,
Sebastian

--
Sebastian Bergmann http://sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69

Search Discussions

  • Stanislav Malyshev at Mar 26, 2007 at 5:29 pm

    I am wondering whether a child class is always stored after its parent
    class in EG(class_table) because I would like to rely on this behaviour
    for the result of get_declared_classes().
    I think it's not written anywhere it should be so, but in fact it always
    would be so since when you are defining child class you have to have
    parent already in the class table. So unless some very nasty extension
    would define classes in different order, it is always so.
    --
    Stanislav Malyshev, Zend Products Engineer
    stas@zend.com http://www.zend.com/
  • Tijnema ! at Mar 26, 2007 at 5:35 pm

    On 3/26/07, Stanislav Malyshev wrote:
    I am wondering whether a child class is always stored after its parent
    class in EG(class_table) because I would like to rely on this behaviour
    for the result of get_declared_classes().
    I think it's not written anywhere it should be so, but in fact it always
    would be so since when you are defining child class you have to have
    parent already in the class table. So unless some very nasty extension
    would define classes in different order, it is always so.
    Logically it should be, but you cannot be sure it will be ALWAYS like
    that. 99% of the time it probably is, but sometimes things aren't
    going the way you expected :P

    Tijnema
    --
    Stanislav Malyshev, Zend Products Engineer
    stas@zend.com http://www.zend.com/

    --
    PHP Internals - PHP Runtime Development Mailing List
    To unsubscribe, visit: http://www.php.net/unsub.php
  • Andrei Zmievski at Mar 26, 2007 at 10:03 pm
    What about the case where dl() is used? AFAIK the classes defined in
    dl()'ed files always go at the end of the class table.

    -Andrei
    On Mar 26, 2007, at 10:29 AM, Stanislav Malyshev wrote:

    I am wondering whether a child class is always stored after its
    parent
    class in EG(class_table) because I would like to rely on this
    behaviour
    for the result of get_declared_classes().
    I think it's not written anywhere it should be so, but in fact it
    always would be so since when you are defining child class you have
    to have parent already in the class table. So unless some very
    nasty extension would define classes in different order, it is
    always so.
    --
    Stanislav Malyshev, Zend Products Engineer
    stas@zend.com http://www.zend.com/

    --
    PHP Internals - PHP Runtime Development Mailing List
    To unsubscribe, visit: http://www.php.net/unsub.php
  • Stanislav Malyshev at Mar 26, 2007 at 10:17 pm

    What about the case where dl() is used? AFAIK the classes defined in
    dl()'ed files always go at the end of the class table.
    Any class that is defined goes at the end of the class table existing at
    the time, no matter if it's dl() or not. If loaded extension defines
    classes derived from existing ones, they would be after existing
    classes. If it defines both parent and child class, then in theory it
    could do it so that child class would enter the class table before the
    parent class, but it'd be quite broken extension.
    --
    Stanislav Malyshev, Zend Products Engineer
    stas@zend.com http://www.zend.com/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedMar 26, '07 at 5:17p
activeMar 26, '07 at 10:17p
posts5
users4
websitephp.net

People

Translate

site design / logo © 2022 Grokbase