Re: Squirrelmail and PHP6

Paul Lesniewski <[email protected]>
Newsgroups gmane.mail.squirrelmail.devel
Message-ID <[email protected]>
On 7/24/09, Steve Brown <[email protected]> wrote:
>> So I am currently lead to believe that the PHP4 object syntax WILL NOT
>> break in PHP6.  Too bad there's not somewhere with some *accurate*,
>> definitive information about this.
>
> FWIW, I downloaded and built a snapshot of PHP6 to do some simple
> tests (cli only, not through a server).  The following class worked
> fine in PHP5 and PHP6:

Thanks, Steve.  So it works as you'd expect (STRICT warnings are a
given - poor coding).... all these articles are completely overblowing
the issue.  PHP4 object syntax does in fact live on in PHP6.

> <?php
> class foo {
>   var $bar = 'hello world';
>
>   function foo() {
>     echo $this->bar;
>   }
> }
> $a = new foo();
> ?>
>
> Output was as expected: 'hello world'.  However, the following class
> taken from the PHP docs raised some strict PHP warnings:
>
> <?php
> class A
> {
>     function foo()
>     {
>         if (isset($this)) {
>             echo '$this is defined (';
>             echo get_class($this);
>             echo ")\n";
>         } else {
>             echo "\$this is not defined.\n";
>         }
>     }
> }
>
> class B
> {
>     function bar()
>     {
>         A::foo();
>     }
> }
>
> $a = new A();
> $a->foo();
> A::foo();
> $b = new B();
> $b->bar();
> B::bar();
> ?>
>
> Output was as follows:
>
> $this is defined (A)
> PHP Strict Standards:  Non-static method A::foo() should not be called
> statically in - on line 26
> $this is not defined.
> PHP Strict Standards:  Non-static method A::foo() should not be called
> statically, assuming $this from incompatible context in - on line 20
> $this is defined (B)
> PHP Strict Standards:  Non-static method B::bar() should not be called
> statically in - on line 29
> PHP Strict Standards:  Non-static method A::foo() should not be called
> statically in - on line 20
> $this is not defined.

-- 
Paul Lesniewski
SquirrelMail Team
Please support Open Source Software by donating to SquirrelMail!
http://squirrelmail.org/donations.php

------------------------------------------------------------------------------
-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [email protected]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.