At 12:56 AM 3/10/2001 +0100, André Langhorst wrote:
>Hi,
>
>1) I am currently completing the php documentation to cover all
>undocumented features and I have noticed that using a static method call
>to the same class from on instanciated object exhibits the presence of the
>instance within the static call
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 the wrong
$this but I wouldn't document it.
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.
Best if you make a list of the things you want to document and we'll tell
you if they are a side-effect, a feature for backwards compatibility but
people shouldn't use it anymore or valid behavior.
>2) If you uncomment the marked line, you will get an error without any
>reason...
I'll look at this tomorrow. Don't have time right now.
Andi
>I guess these are bugs, aren't they?
><?php
>class foo {
>
> function moo() {
> // $this->boo=2; // try to remove the comments
> print '$this is ';
> if (!isset($this)) {
> print 'not set';
> foo::zoo();
> } else {
> print 'set';
> $this->zoo();
> foo::zoo();
> }
>
> }
> function zoo() {
> print '<br>'.'I have been called '.(!isset($this) ?
> 'statically':'via $this->zoo()');
> var_dump($this);
> }
>
>}
>$s=new foo();
>$s->moo();
>?><BR><?php
>foo::moo();
>?>
>
>andré
>
>
>--
>· André Langhorst t: +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]