±¾ÎÄΪ´o¼ÒÖÏiÁËphp¹¹Ôi½¨Ö®Îo¹¹½*¨Ôڼ̳ÐÖеıiÏÖ£¬¹(C)´o¼Ò²Î¿¼£¬¾ßÌaÄÚÈÝÈçÏÂ
×ÓÀaÖÐûÓж¨Òa¹¹Ôi½¨Ê±£¬»a×Ô¶¯µ÷Óø¸ÀaµÄ¹¹Ôi½¨¡£Òo´ËʵÀý»¯×ÓÀaʱ£¬Ðe°´ÕÕ¸¸ÀaµÄ¹¹Ôi½¨µÄÐÎʽ½øÐС£
ÐÞ¸ÄΪ£º
×ÓÀa¶¨ÒaÁË×Ô¼ºµÄ¹¹Ôi½¨£¬Ôo²»»a×Ô¶¯µ÷Óø¸ÀaµÄ¹¹Ôi½¨£¬µ«¿ÉÒÔÊÖ¶¯µ÷Óãºparent::__construct();
µ«Í¨³££¬ÔÚ×ÓÀa£¬ºÜ¶aʱºo£¬ÔÚ¹¹Ôi½¨ÖУ¬¶¼Ó¦¸Ã£¨ÐeÒª£(C)È¥µ÷Óø¸ÀaµÄ¹¹Ôi½¨ÒÔ½ÚÊ¡´uÂe£¬Ôo¼Ó¿É¶ÁÐÔ£º
×ÓÀaÖÐûÓж¨ÒaÎo¹¹½¨Ê±£¬»a×Ô¶¯µ÷Óø¸ÀaµÄÎo¹¹½¨¡£×ÓÀa¶¨ÒaÁË×Ô¼ºµÄÎo¹¹½¨£¬Ôo²»»a×Ô¶¯µ÷Óø¸ÀaµÄÎo¹¹½¨£¬µ«¿ÉÒÔÊÖ¶¯µ÷Óãºparent::__destruct()¡£ÖØдoverride
ÖØдÓֽи²¸Ç£¬¾ÍÊǽ«´Ó¸¸Àa¼Ì³ÐÏÂÀ´µÄÊoÐÔ»o½¨ÖØС°¶¨Òa¡±¡ª¡ª¾ÍÊÇ´ÓÐÂд¡£
µ«×¢Òa£º×ÓÀa¸²¸Ç¸¸ÀaµÄ½¨£¬ËaÈ»¿ÉÒÔÈ¥µ÷Óø¸ÀaµÄͬÃu½¨È¥Íe³ÉÒ»¶¨µÄ¹¤×÷£¬µ«²»ÊDZØÐeµÄ¡£Ò²ÓпÉÄܸ¸ÀaµÄ¸Ã½¨ËuÖ´ÐеĽa¹u²¢²»ÊʺÏ×ÓÀa£¬´Ëʱ×ÓÀa¾ÍÈ¥ÍeÈ«×Ô¼ºÐ´ÁË¡£
ÖØдµÄ»u±¾ÒªÇo£º
ÃÎÊ¿ØÖÆȨÏÞ£ºÏ¼¶µÄÃÎÊ¿ØÖÆȨÏÞÓ¦¸Ã²»µÍÓÚÉϼ¶µÄ*ÃÎÊ¿ØÖÆȨÏÞ£ºÉϼ¶£ºpublic ϼ¶£ºÖ»ÄÜpublicÉϼ¶£ºprotected ϼ¶£º protected, publicÉϼ¶£ºprivate ϼ¶£ºprivate protected public¡ª¡ªÊµ¼Ê´ËÇe¿oÎÞÒaÒa¡£Ë½ÓеIJ»Äܸ²¸Ç£¬¶øÊÇÍeÈ«µ±×÷×Ô¼ºÈ«Ðµġ£
½¨µÄ²ÎÊýÐÎʽ£ºÓ¦¸Ã¸u¸¸ÀaµÄÒ»Ö¡£
˽ÓÐÊoÐÔºÍ˽Óн¨µÄÖØдÎÊÌa£ºË½ÓÐÊoÐԺͽ¨¶¼²»Äܸ²¸Ç£¬µ«Æaʵ×ÓÀa¿ÉÒÔ¶¨Òa¸u¸¸Àa˽ÓеÄͬÃuÊoÐÔ»o½¨¡£Ö»Êǵ±×÷Ò»¸o×ÔÉiµÄеÄÊoÐÔ»o½¨À´¿´´ý¶øÒÑ¡£²»¹ý½¨µÄ²ÎÊý±ØÐeÒ»Ö¡£¹¹Ôi½¨µÄÖØдÎÊÌa£º¹¹Ôi½¨²»µ«¿ÉÒÔÏñÆaËuÆÕͨ½¨Ò»ÑuÖØд£¬¶øÇÒ£¬±ÈÆÕͨ½¨¸u¿iËÉ£ºÖØдµÄʱºo²ÎÊý¿ÉÒÔ²»Ò»Ö¡£
×iÖÕÀafinal class£º
ͨ³££¬Ò»¸oÀa£¬Ã»ÓÐÌرðÉuÃ÷µÄ»°£¬Ôo¡°±ðÈË¡±¾Í¿ÉÒÔËaeÒaÄùýÀ´Ê¹Óò¢¶ÔÖ®½øÐС°À(C)Õ¹¡±¡ª¡ª¼Ì³Ð¡£
µ«ÊÇ£º
Èç¹uij¸oÀa²»Ï£Íu¶ÔÆa½øÐÐÀ(C)Õ¹£¬Ôo¿ÉÒÔ½«ÆaÉuÃ÷Ϊ¡°×iÖÕÀa¡±¡£
ÐÎʽ£º
final class ÀaÃu{ ¡£¡£¡£¡£Àa¶¨Òa¡£¡£¡£¡£}
×iÖÕ½¨final method
ͨ³££¬Ò»¸o½¨£¬Èç¹uûÓÐÌرðÉuÃ÷£¬Ôoϼ¶Àa¾Í¿ÉÒÔ¶ÔÆa½øÐС°¸²¸Ç¡±£¨ÖØд£(C)¡£
µ«ÊÇ£º
Èç¹uij¸o½¨²»Ï£Íu±»Ï¼¶Àa¸²¸Ç£¬¾Í¿ÉÒÔ¶ÔÆaÉuÃuΪ¡°×iÖÕ½¨¡±¡£
ÐÎʽ£º
final function ½¨Ãu(){¡£¡£¡£¡£½¨¶¨Òa¡£¡£¡£¡£}
ÒÔÉϾÍÊDZ¾ÎĵÄÈ«²¿ÄÚÈÝ£¬Ï£Íu¶Ô´o¼ÒµÄѧϰÓÐËu°iÖu¡£