虚函数实现php版-PHP源码
虚函数,实现php1. virtual-function.php
Parent says $str"; } } class ChildClass extends ParentClass { static public function do_print( $str ) { echo "Child says $str
"; } } class AnotherChildClass extends ParentClass { static public function do_print( $str ) { echo "AnotherChild says $str
"; } } echo phpversion(); $a=new ChildClass(); $a->say( 'Hello' ); $b=new AnotherChildClass(); $b->say( 'Hello' );
以上就是虚函数实现php版的内容,更多相关内容请关注PHP中文网(www.php1.cn)!
PHP之友评论