cvs: ZendEngine2 /tests bug26802.phpt
| From: | Marcus Boerger | Date: | Tue, 06 Jan 2004 00:51:43 +0000 |
| Subject: | cvs: ZendEngine2 /tests bug26802.phpt | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2180@lists.php.net to get a copy of this message | ||
helly Mon Jan 5 19:51:43 2004 EDT
Modified files:
/ZendEngine2/tests bug26802.phpt
Log:
Update
Index: ZendEngine2/tests/bug26802.phpt
diff -u ZendEngine2/tests/bug26802.phpt:1.3 ZendEngine2/tests/bug26802.phpt:1.4
--- ZendEngine2/tests/bug26802.phpt:1.3 Mon Jan 5 17:45:11 2004
+++ ZendEngine2/tests/bug26802.phpt Mon Jan 5 19:51:43 2004
@@ -2,11 +2,28 @@
Bug #26802 (Can't call static method using a variable)
--FILE--
<?php
-
+
+function func() {
+ echo __METHOD__ . "\n";
+}
+
+function work() {
+ echo __METHOD__ . "\n";
+}
+
+$function = 'func';
+$function();
+
class foo
{
+ static $method = 'func';
+
static public function bar() {
- print "baz\n";
+ echo __METHOD__ . "\n";
+ }
+
+ static public function func() {
+ echo __METHOD__ . "\n";
}
}
@@ -16,9 +33,17 @@
$static_method();
+/* The following is a BC break with PHP4 where it would
+ * call foo::fail. In PHP5 we first evaluate static class
+ * properties and then do the function call.
+ */
+$method = 'fail';
+foo::$method();
?>
===DONE===
--EXPECT--
-baz
-baz
+func
+foo::bar
+foo::bar
+func
===DONE===