Re: Squirrelmail and PHP6
Steve Brown <[email protected]>
| Newsgroups | gmane.mail.squirrelmail.devel |
|---|---|
| Message-ID | <[email protected]> |
> 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:
<?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.
------------------------------------------------------------------------------
-----
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