Return to final.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / tests / classes |
1.1 ! misho 1: --TEST-- ! 2: ZE2 A method may be redeclared final ! 3: --SKIPIF-- ! 4: <?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> ! 5: --FILE-- ! 6: <?php ! 7: ! 8: class first { ! 9: function show() { ! 10: echo "Call to function first::show()\n"; ! 11: } ! 12: } ! 13: ! 14: $t = new first(); ! 15: $t->show(); ! 16: ! 17: class second extends first { ! 18: final function show() { ! 19: echo "Call to function second::show()\n"; ! 20: } ! 21: } ! 22: ! 23: $t2 = new second(); ! 24: $t2->show(); ! 25: ! 26: echo "Done\n"; ! 27: ?> ! 28: --EXPECTF-- ! 29: Call to function first::show() ! 30: Call to function second::show() ! 31: Done