PHPÀàʵÀý½Ì³Ì£¨°Ë£©£ºÀàµÄ¼Ì³Ð
¼Ì³ÐÊÇÃæÏò¶ÔÏó×îÖØÒªµÄÌصãÖ®Ò»£¬¾ÍÊÇ¿ÉÒÔʵÏÖ¶ÔÀàµÄ¸´Óá£
ͨ¹ý“¼Ì³Ð”Ò»¸öÏÖÓеÄÀ࣬¿ÉÒÔʹÓÃÒѾ¶¨ÒåµÄÀàÖеķ½·¨ºÍÊôÐÔ¡£
¼Ì³Ð¶ø²úÉúµÄÀà½Ð×ö×ÓÀà¡£
±»¼Ì³ÐµÄÀ࣬½Ð×ö¸¸À࣬Ҳ±»³ÉΪ³¬Àà¡£
PHPÊǵ¥¼Ì³ÐµÄ£¬Ò»¸öÀàÖ»¿ÉÒԼ̳ÐÒ»¸ö¸¸À࣬µ«Ò»¸ö¸¸ÀàÈ´¿ÉÒÔ±»¶à¸ö×ÓÀàËù¼Ì³Ð¡£
´Ó×ÓÀàµÄ½Ç¶È¿´£¬Ëü“ ¼Ì³Ð£¨inherit £¬ extends£©”×Ô¸¸Àࣻ¶ø´Ó¸¸ÀàµÄ½Ç¶È¿´£¬Ëü“ÅÉÉú£¨derive£©”×ÓÀà¡£ËüÃÇÖ¸µÄ¶¼ÊÇͬһ¸ö¶¯×÷£¬Ö»ÊǽǶȲ»Í¬¶øÒÑ¡£
×ÓÀ಻Äܼ̳и¸ÀàµÄ˽ÓÐÊôÐÔºÍ˽Óз½·¨¡£
ÔÚPHP5ÖÐÀàµÄ·½·¨¿ÉÒÔ±»¼Ì³Ð£¬ÀàµÄ¹¹Ô캯ÊýÒ²Äܱ»¼Ì³Ð¡£
¼Ì³ÐµÄ¼òµ¥Àý×Ó
ÎÒÃÇ·ÖÎö×ÔÈ»½çÖеĹØϵ£¬¶¯ÎïÀàÓëÈ®ÀàµÄ¹Øϵ¡£
<?Php
class Animal
{
private $weight;
public function getWeight() {
return $this->weight;
}
public function setWeight($W) {
$this->weight = $W;
}
}
class Dog extends Animal
{
}
?>
µ±ÎÒÃÇʵÀý»¯animalÀàµÄ×ÓÀàDogÀàʱ£¬ ¸¸ÀàµÄ·½·¨setWeight() ºÍ getWeight() ±»¼Ì³Ð¡£
ÎÒÃÇ¿ÉÒÔÖ±½Óµ÷Óø¸ÀàµÄ·½·¨ÉèÖÃÆäÊôÐÔ$weight£¬È¡µÃÆäÊôÐÔ$weight ¡£
<?php
……….
$myDog = new Dog();
$myDog->setWeight(20);
echo "Mydog's weight is " . $myDog->getWeight() . "<br />";
$myDog->Bark();
?>
¹¹Ô캯ÊýµÄ¼Ì³Ð
ÓÐЩ×ÊÁÏÉÏ˵PHP5µÄ¹¹Ô캯Êý²»±»¼Ì³Ð¡£ÑÝʾµÄ½á¹ûÖ¤Ã÷£¬PHP5µÄ¹¹Ô캯Êý±»¼Ì³ÐÁË¡£µ±×ÓÀàDog1±»ÊµÀý»¯Ê±£¬¼Ì³ÐµÄ¹¹Ô캯Êý±»µ÷ÓÃÁË£¬ÆÁÄ»ÉÏÏÔʾÁËÒ»¾ä “I am an Animal.”¡£
<?php
class Animal
{
public $legNum = 0;
public function __construct() {
$this->legNum = 4;
echo "I am an animal <br />";
}
}
class Dog1 extends Animal
{
}
$dog1 = new Dog1();
echo "<br />";
echo "legNum is " . $dog1->legNum;
/*
ʵÀý»¯×ÓÀàʱ£¬¹¹Ô캯Êý±»µ÷ÓÃÁË¡£
*/
?>
˽ÓбäÁ¿ºÍ·½·¨²»±»¼Ì³Ð
Ïà¹ØÎĵµ£º
Ç°Ò»ÕóÊÔÓà tokyo tyrant Åöµ½Ò»¸öÂé·³£¬
ÔÚphpÉÏÓÃmemcache½Ó¿Ú£¬È¡³öÊý¾ÝµÄʱºò£¬²»»á×Ô¶¯·´ÐòÁл¯¡£±ÈÈçÁËÒ»¸ö array(1,2,3,4,5)£¬³öÀ´¾ÍÊÇ 'a:5:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;i:4;i:5;}' ÁË¡£
ÓÃ
Wireshark ¸ú×ÙÁËһϣ¬·¢Ïֺͱê×¼memcached·µ»ØµÄÊý¾ÝÀï²îÒ»¸ö×Ö½Ú¡£È¥¿´ÁËÏ memcached
ÐÒ飬·¢ÏÖÕâ¸ö×Ö½ÚÊǸ ......
PHP³ÌÐòÔ±Ó¦¸Ã¶¼ÖªµÀÁ¬½ÓMySQLÊý¾Ý¿â¿ÉÒÔʹÓÃmysql_pconnect£¨ÓÀ¾ÃÁ¬½Ó£©º¯Êý£¬Ê¹ÓÃÊý¾Ý¿âÓÀ¾ÃÁ¬½Ó¿ÉÒÔÌá¸ßЧÂÊ£¬µ«ÊÇʵ¼ÊÓ¦ÓÃÖÐÊý¾Ý¿âÓÀ¾ÃÁ¬½ÓÍùÍù»áµ¼Ö³öÏÖһЩÎÊÌ⣬ͨ³£µÄ±íÏÖ¾ÍÊÇÔÚ´ó·ÃÎÊÁ¿µÄÍøÕ¾ÉÏʱ³£·¢Éú¶Ï¶ÏÐøÐøµÄÎÞ·¨Á¬½ÓÊý¾Ý¿âµÄÇé¿ö£¬³öÏÖÀàËÆ£¢Too many connections in ...£¢µÄ´íÎóÌáʾÐÅÏ¢£¬ÖØÐÂÆô¶¯·þÎñÆ÷Ó ......
ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«Ñ§Ï°ÈçºÎͨ¹ýPHP 5µÄÒ»¸ö»ù±¾³éÏóÀàʹÓÃÍâ¼üÔ¼ÊøÀ´¸üÐÂÁ½¸öInnoDB±íµÄÊý¾Ý¡£ ÎÒÃǽ«Í¨¹ý¾ßÌåʾÀýÀ´ËµÃ÷ÈçºÎͨ¹ý·þÎñÆ÷¶Ë½Å±¾ÓïÑÔÀ´Ê¹ÓÃÍâ¼üÔ¼Êø¡£
¡¡¡¡Ò»¡¢ÀûÓÃÍâ¼üÔ¼Êø¸üÐÂMySQLÖеÄÊý¾Ý
¡¡¡¡ÏÖÔÚ£¬×îÁ÷ÐеĿªÔ´¹ØϵÐÍÊý¾Ý¿â¹ÜÀíϵͳ·ÇMySQLĪÊô£¬¶øMySQLÓÖÖ§³Ö¶à¸ö´æ´¢ÒýÇ棬ÆäÖÐĬÈϵÄÒ²ÊÇËٶȽϿìµÄ´ ......
Ò»¡¢°²×°
³õ´ÎʹÓÃEclipse¿ª·¢PHPÏîÄ¿£¬°²×°»¹Êǵû¨·ÑÒ»¶¨µÄʱ¼äµÄ£¬×Ðϸ¿´Ò»Ï±¾
ÎÄ£¬¿ÉÒÔ½ÚÔ¼²»ÉÙʱ¼ä¡£Ê×ÏÈ¡£EclipseÏîÄ¿ÊÇÓÃJava¿ª·¢µÄ£¬ËùÒÔÐèÒªÔÚJavaµÄÐéÄâ»úÉÏÔËÐУ¬¶øEclipseȱʡÊÇûÓдøÐéÄâ»úµÄ£¬ËùÒÔÈç
¹ûÄãµÄ»úÆ÷ÉÏûÓа²×°JavaÐéÄâ»ú£¨Ò»°ãµÄWindows»úÆ÷É϶¼Ã»°²×°£©£¬ÄãÏȵð²×°Ò»¸ö£¬ÔÚÕâÀï˳±ã˵һÏ£ ......
0¡¢Óõ¥ÒýºÅ´úÌæË«ÒýºÅÀ´°üº¬×Ö·û´®£¬ÕâÑù×ö»á¸ü¿ìһЩ¡£ÒòΪPHP»áÔÚË«ÒýºÅ°üΧµÄ×Ö·û´®ÖÐËÑÑ°±äÁ¿£¬µ¥ÒýºÅÔò²»»á£¬×¢Ò⣺ֻÓÐechoÄÜÕâô×ö£¬ËüÊÇÒ»ÖÖ¿ÉÒ԰Ѷà¸ö×Ö·û´®µ±×÷²ÎÊýµÄ“º¯Êý”£¨Òë×¢£ºPHPÊÖ²áÖÐ˵echoÊÇÓïÑԽṹ£¬²»ÊÇÕæÕýµÄº¯Êý£¬¹Ê°Ñº¯Êý¼ÓÉÏÁËË«ÒýºÅ£©¡£
1¡¢Èç¹ûÄܽ«ÀàµÄ·½·¨¶¨Òå³Éstatic£¬¾Í¾¡ ......