cvs: php4 /tests/classes static_mix_1.phpt static_mix_2.phpt

From: Date: Sun, 24 Nov 2002 15:50:28 +0000
Subject: cvs: php4 /tests/classes static_mix_1.phpt static_mix_2.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-16617@lists.php.net to get a copy of this message
helly Sun Nov 24 10:50:28 2002 EDT Added files: /php4/tests/classes static_mix_1.phpt static_mix_2.phpt Log: Add test against mixing static/non static methods Index: php4/tests/classes/static_mix_1.phpt +++ php4/tests/classes/static_mix_1.phpt --TEST-- You cannot overload astatic methods with a non static methods --SKIPIF-- <?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> --FILE-- <?php class pass { static function show() { echo "Call to function pass::show()\n"; } } class fail extends pass { function show() { echo "Call to function fail::show()\n"; } } pass::show(); fail::show(); echo "Done\n"; // shouldn't be displayed of cause ?> --EXPECTF-- Fatal error: Cannot make static method pass::show() non static in class fail in %s on line %d Index: php4/tests/classes/static_mix_2.phpt +++ php4/tests/classes/static_mix_2.phpt --TEST-- You cannot overload a non static methods with a static methods --SKIPIF-- <?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> --FILE-- <?php class pass { function show() { echo "Call to function pass::show()\n"; } } class fail extends pass { static function show() { echo "Call to function fail::show()\n"; } } $t = new pass(); $t->show(); fail::show(); echo "Done\n"; // shouldn't be displayed of cause ?> --EXPECTF-- Fatal error: Cannot make non static method pass::show() static in class fail in %s on line %d

« previous php.cvs (#16617) next »