logo       

cvs: ZendEngine2 /tests bug29689.phpt bug30451.phpt: msg#00033

Subject: cvs: ZendEngine2 /tests bug29689.phpt bug30451.phpt
stas            Wed May 18 10:56:36 2005 EDT

  Modified files:              
    /ZendEngine2/tests  bug29689.phpt bug30451.phpt 
  Log:
  tests
  
  
http://cvs.php.net/diff.php/ZendEngine2/tests/bug29689.phpt?r1=1.1&r2=1.2&ty=u
Index: ZendEngine2/tests/bug29689.phpt
diff -u /dev/null ZendEngine2/tests/bug29689.phpt:1.2
--- /dev/null   Wed May 18 10:56:36 2005
+++ ZendEngine2/tests/bug29689.phpt     Wed May 18 10:56:34 2005
@@ -0,0 +1,57 @@
+--TEST--
+Bug #29689 (default value of protected member overrides default value of 
private)
+--FILE--
+<?php
+class foo {
+    private $foo = 'foo';
+
+    function printFoo()
+    {
+        echo __CLASS__, ': ', $this->foo, "\n";
+    }
+}
+
+class bar extends foo {
+    protected $foo = 'bar';
+
+    function printFoo()
+    {
+        parent::printFoo();
+        echo __CLASS__, ': ', $this->foo, "\n";
+    }
+}
+
+class baz extends bar {
+    protected $foo = 'baz';
+}
+
+class bar2 extends foo {
+    function printFoo()
+    {
+        parent::printFoo();
+        echo __CLASS__, ': ', $this->foo, "\n";
+    }
+}
+
+class baz2 extends bar2 {
+    protected $foo = 'baz2';
+}
+
+$bar = new bar;
+$bar->printFoo();
+echo "---\n";
+$baz = new baz();
+$baz->printFoo();
+echo "---\n";
+$baz = new baz2();
+$baz->printFoo();
+?>
+--EXPECT--
+foo: foo
+bar: bar
+---
+foo: foo
+bar: baz
+---
+foo: foo
+bar2: baz2
http://cvs.php.net/diff.php/ZendEngine2/tests/bug30451.phpt?r1=1.1&r2=1.2&ty=u
Index: ZendEngine2/tests/bug30451.phpt
diff -u /dev/null ZendEngine2/tests/bug30451.phpt:1.2
--- /dev/null   Wed May 18 10:56:36 2005
+++ ZendEngine2/tests/bug30451.phpt     Wed May 18 10:56:34 2005
@@ -0,0 +1,36 @@
+--TEST--
+Bug #30451 (static properties permissions broken)
+--FILE--
+<?php
+
+class A {
+
+       protected static $property = TRUE;
+       
+       protected static function method() {
+               return TRUE;
+       }
+
+}
+
+class B extends A {
+
+       public function __construct() {
+               
+               var_dump(self::method());
+               var_dump(parent::method());
+               
+               var_dump(self::$property);
+               var_dump(parent::$property);
+       
+       }
+       
+}
+
+new B;
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+bool(true)

-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe