Re: [PHP-DEV] Re: static call bugs?

2001-03-10 Thread Andi Gutmans

At 08:49 PM 3/10/2001 +0100, Andr Langhorst wrote:
When you say that people shouldn't use references because of performance 
what do you mean? I think you are right in general but when you are 
passing around objects you should use references. for example:
function foo($obj)
{
}
foo($myobject);

I know, what about addming some words on reference counting to the docs (I 
know it was on the inital zend.com site around release of php 4), this is 
very important to understand how to tweak performance.

I have seen many people doing the contrary coming from c++ etc.

Good idea. I don't have time in the next few days to work on it but maybe 
I'll be able to steal some stuff from my Zend.com article.

Andi


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: static call bugs?

2001-03-09 Thread André Langhorst

 There are no static functions in PHP. This syntax is used to call a 
 method of the parent. It can be used to call other methods and thus have 

parent::foo();
If you remember, it has been implemented *after* 
[classname]::[functionname]() ...


 the wrong $this but I wouldn't document it.

can't this be fixed, otherwise if I start documenting :: (however you 
want to call it), I cannot leave it out and since PEAR uses it heavily 
it has to be documented


 In general, I think it's a bad idea to document undocumented features 
 because some of them aren't meant for people to use. The behavior might 
 change in the future.

it's just three features "references inside constructor" (already 
commited), :: (the magical operator ;) ) and php_ticks

andr




-- 
 Andr Langhorstt: +49 331 5811560 
 [EMAIL PROTECTED]  m: +49 173 9558736 
* PHP Quality Assurance  http://qa.php.net  *


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: static call bugs?

2001-03-09 Thread Andi Gutmans

At 01:30 AM 3/10/2001 +0100, Andr Langhorst wrote:
There are no static functions in PHP. This syntax is used to call a 
method of the parent. It can be used to call other methods and thus have

parent::foo();
If you remember, it has been implemented *after* 
[classname]::[functionname]() ...

I still don't understand what the problem is? What should be documented is 
the right way to use these calls.



the wrong $this but I wouldn't document it.

can't this be fixed, otherwise if I start documenting :: (however you want 
to call it), I cannot leave it out and since PEAR uses it heavily it has 
to be documented

PEAR relies on the $this being correct even when you call a method which is 
not in the current class or in one of its parent classes?


In general, I think it's a bad idea to document undocumented features 
because some of them aren't meant for people to use. The behavior might 
change in the future.

it's just three features "references inside constructor" (already 
commited), :: (the magical operator ;) ) and php_ticks

Where can I see the documentation? (Any chance you can send it here to save 
me the time? :).
We just need to be sure we don't document things which aren't necessarily 
supposed to work.

Andi


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: static call bugs?

2001-03-09 Thread André Langhorst

 I still don't understand what the problem is? What should be documented 
 is the right way to use these calls.

problem 1 : how do I call the "::" operator and how do I call what it 
does if it is no static call.

problem 2 : the "bug" with incorrect $this I mentioned, it is at least 
unexcpected and should be documented (that you can't rely on $this using 
"::" ) but since no one likes undefined behaviour it would be fine to 
see it fixed - my opinion is that using "::" $this should never be set 
to anything...


 PEAR relies on the $this being correct even when you call a method which 
 is not in the current class or in one of its parent classes?

no, it simply uses "::" that is an undocumented feature

 Where can I see the documentation? (Any chance you can send it here to 
 save me the time? :).
 We just need to be sure we don't document things which aren't 
 necessarily supposed to work.

http://toye.php.net/~andre/html/keyword.newref.html

andr

-- 
 Andr Langhorstt: +49 331 5811560 
 [EMAIL PROTECTED]  m: +49 173 9558736 
* PHP Quality Assurance  http://qa.php.net  *


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: static call bugs?

2001-03-09 Thread André Langhorst

 Right, and they weren't static functions either (this feature was 
 designed for calling parent/grandparent/etc methods).  The way it's 
 designed is completely intentional.

ok. this makes sense now :)

andr

-- 
 Andr Langhorstt: +49 331 5811560 
 [EMAIL PROTECTED]  m: +49 173 9558736 
* PHP Quality Assurance  http://qa.php.net  *


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]