Re: [PHP-DEV] [patch] Callbacks bug/change request

2007-06-02 Thread Jochem Maas
Stanislav Malyshev wrote: >> You'd probably do something along those lines if it were possible: >> >> ((ParentClass) $child)->virtualMethod(); > > Looks like bad style to me - why not call child's method and it would, > if needed, pass control to parent? yeah, although I could imagine a situation

Re: [PHP-DEV] [patch] Callbacks bug/change request

2007-06-01 Thread Richard Lynch
On Fri, June 1, 2007 12:06 pm, Stanislav Malyshev wrote: >> You'd probably do something along those lines if it were possible: >> >> ((ParentClass) $child)->virtualMethod(); > > Looks like bad style to me - why not call child's method and it would, > if needed, pass control to parent? Or, if, fo

Re: [PHP-DEV] [patch] Callbacks bug/change request

2007-06-01 Thread Stanislav Malyshev
You'd probably do something along those lines if it were possible: ((ParentClass) $child)->virtualMethod(); Looks like bad style to me - why not call child's method and it would, if needed, pass control to parent? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.ze

Re: [PHP-DEV] [patch] Callbacks bug/change request

2007-05-31 Thread Michael Wallner
Stanislav Malyshev wrote: >>the feature actually exists because we need array($obj, >> 'parent::func') > > Why/when do you need that? You'd probably do something along those lines if it were possible: ((ParentClass) $child)->virtualMethod(); If you prefer, s/You/One/ Regards, -- Michael

Re: [PHP-DEV] [patch] Callbacks bug/change request

2007-05-31 Thread Stanislav Malyshev
the feature actually exists because we need array($obj, 'parent::func') Why/when do you need that? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [patch] Callbacks bug/change request

2007-05-31 Thread Marcus Boerger
Hello Richard, the feature actually exists because we need array($obj, 'parent::func') best regards marcus Thursday, May 31, 2007, 10:33:54 PM, you wrote: > On Thu, May 31, 2007 1:06 pm, Stanislav Malyshev wrote: >>> It's already supported, but buggy right now. I don't believe fixing >>> it

Re: [PHP-DEV] [patch] Callbacks bug/change request

2007-05-31 Thread Richard Lynch
On Thu, May 31, 2007 3:44 pm, Stanislav Malyshev wrote: >> What about array('B', 'self::foo') -- I can see how that's needed to >> call the static method, I guess... > > But that won't be different from just array('B', 'foo') so you don't > need self::... Duh. Sorry. I somehow had some imaginary

Re: [PHP-DEV] [patch] Callbacks bug/change request

2007-05-31 Thread Stanislav Malyshev
What about array('B', 'self::foo') -- I can see how that's needed to call the static method, I guess... But that won't be different from just array('B', 'foo') so you don't need self::... -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ -- PHP Internals -

Re: [PHP-DEV] [patch] Callbacks bug/change request

2007-05-31 Thread Richard Lynch
On Thu, May 31, 2007 1:06 pm, Stanislav Malyshev wrote: >> It's already supported, but buggy right now. I don't believe fixing >> it >> for odd cases will bother anyone. > > Well, I'm for one not sure that callback in form array('B', > 'parent::foo') shouldn't error out instead (I know it works now

Re: [PHP-DEV] [patch] Callbacks bug/change request

2007-05-31 Thread Stanislav Malyshev
It's already supported, but buggy right now. I don't believe fixing it for odd cases will bother anyone. Well, I'm for one not sure that callback in form array('B', 'parent::foo') shouldn't error out instead (I know it works now, but it never states in the docs it's legal and I don't think it

Re: [PHP-DEV] [patch] Callbacks bug/change request

2007-05-30 Thread Etienne Kneuss
Stanislav Malyshev wrote: EG(scope) is used by zend_u_fetch_class to get the parent/current class, I'm only altering it temporarily before zend_u_fetch_class and restore it after that, no harm done. I was speaking about 5.2 patch, didn't check the HEAD one. Oh, I see now what you mean. I porte

Re: [PHP-DEV] [patch] Callbacks bug/change request

2007-05-30 Thread Stanislav Malyshev
EG(scope) is used by zend_u_fetch_class to get the parent/current class, I'm only altering it temporarily before zend_u_fetch_class and restore it after that, no harm done. I was speaking about 5.2 patch, didn't check the HEAD one. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED]

Re: [PHP-DEV] [patch] Callbacks bug/change request

2007-05-30 Thread Stanislav Malyshev
It seems that there is a bug in the way some callbacks are handled. For instance: array('B', 'parent::who'); I'm not sure such thing should be even supported. I.e. I'd expect it to try and call method named 'parent::who' in class B, which would fail since you can't define such method name. I

Re: [PHP-DEV] [patch] Callbacks bug/change request

2007-05-30 Thread Etienne Kneuss
Stanislav Malyshev wrote: It seems that there is a bug in the way some callbacks are handled. For instance: array('B', 'parent::who'); I'm not sure such thing should be even supported. I.e. I'd expect it to try and call method named 'parent::who' in class B, which would fail since you can't

[PHP-DEV] [patch] Callbacks bug/change request

2007-05-30 Thread Etienne Kneuss
Hi internals, It seems that there is a bug in the way some callbacks are handled. For instance: array('B', 'parent::who'); Here, the classname 'B' will only be used for inheritance checks with the current scope, but the actual resolution will be made using the current scope, and 'parent::wh