¹ØÓÚphpÃæÏò¶ÔÏóµÄ¾²Ì¬±äÁ¿µÄÎÊÌâ
´úÂëÈçÏ£º
<?php
class Book{
static $num=0;
public function showme(){
echo 'ÄúÊǵÚ'.self::$num.'λ·Ã¿Í';
self::$num++;
}
}
$book1 = new Book();
$book1->showme();
echo"<br>";
$book2=new Book();
$book2->showme();
echo "<br>";
echo 'ÄúÊǵÚ'.Book::$num.'λ·Ã¿Í';
?>
½á¹ûÊÇ£º
ÄúÊǵÚ0λ·Ã¿Í
ÄúÊǵÚ1λ·Ã¿Í
ÄúÊǵÚ2λ·Ã¿Í
Èç¹û¸Äµôstatic ±ä³É public ÄÇôΪʲô»á³öÏÖ´íÎó£ºFatal error: Access to undeclared static property: Book::$num
ËäÈ»Book::$numÊǵ÷ÓõÄÀàÄÚ²¿±äÁ¿£¬¿ÉÊÇÈç¹ûÎÒÓÃÁËpublic²»ÊÇÄͼÄÜ·ÃÎʵĵ½Ã´£¿
ÄѵÀ Book::$num ±ØÐëÊǾ²Ì¬±äÁ¿£¿
Ôõô»ØÊ£¿
¾²Ì¬±äÁ¿²»ÓÃʵÀý»¯¶ÔÏ󣬵±ÀÛµÚÒ»´Î±»¼ÓÔØÊ±¾ÍÒѾ·ÖÅäÁËÄÚ´æµ¥Ôª¡£
Õâ¾ä»°£¬Èç¹ûÊÊÓ¦µ½Õâ¸ö³ÌÐòµÄ»°£¬ÊDz»ÊÇclass Book{
static $num=0;
public function showme(){
echo 'ÄúÊǵÚ'.self::$num.'λ·Ã¿Í';
self::$num++;
}
}
ÕâʱÒѾ±»·ÖÅäÁËÄÚ´æÁËÄØ£¿
Ïà¹ØÎĵµ£º
Õâ¾ÍÒª´ÓË«ÒýºÅºÍµ¥ÒýºÅµÄ×÷Óý²Æð£º
Ë«ÒýºÅÀïÃæµÄ×ֶλᾹý±àÒëÆ÷½âÊÍÈ»ºóÔÙµ±×÷HTML´úÂëÊä³ö£¬µ«Êǵ¥ÒýºÅÀïÃæµÄ²»ÐèÒª½âÊÍ£¬Ö±½ÓÊä³ö¡£ÀýÈ磺
$abc='I love u';
echo $abc //½á¹ûÊÇ:I love u
echo '$abc' //½á¹ûÊ ......
×÷Ϊһ¸öÈ«ÐµĻ¥ÁªÍøÏîÄ¿£¬ÓÐʱºò»áÃæÁÙÒ»¸öÑ¡ÔñʲôÑùµÄ¿ª·¢ÓïÑÔµÄÎÊÌâ¡£
ÎÒ˵µÄÕâ¸öÓÐʱºò£¬ÆäʵÊÇÖ¸ÏÖÓеÄÍŶÓÖУ¬Ã»Óм¼Êõ¿ª·¢µÄ³ÉÔ±µÄÇé¿ö¡£Èç¹ûÒѾÓÐÁËÒ»¸ö»òÕß¶à¸ö¼¼Êõ¿ª·¢ÈËÔ±£¬µ±È»ÊÇÑ¡ÔñÏÖÓгÉÔ±×îÊìϤºÍ×îÉó¤µÄÓïÑÔÁË¡£
ÄÇô¶ÔÓÚÒ»¸ö»¹Ã»Óм¼Êõ³ÉÔ±µÄÍŶӣ¬Ó¦¸ÃÑ¡ÔñʲôÑùµÄ¿ª·¢ÓïÑÔÄØ£¿»Ø´ðÕâ¸öÎÊÌ⣬Ê×Ï ......
/**********************************
APACHE
***********************************/
±à¼²ÎÊý£º
./configure" \
"--prefix=/usr/local/apache" \
"--enable-so" \
"--enable-ssl" \
"--enable-mods-shared=most" \
"--with-mpm=event" \
"--with-ssl=/usr/local/openssl" \
"--enable-cache" \
"--enable-mem- ......
Ö´ÐÐÒÔÏÂÓï¾ä£º
var_dump(2147483647); // int
var_dump(
2147483648); // float
¿ÉÒÔ¿´µ½£¬php intÐ͵Ä×î´óÖµ¾ÍÊÇ
2147483647£¬¼´231
-1£¬ÒòΪ32λµÄ×î¸ßλҪÓÃÀ´±íʾÕý¸º¡£
ÔÙÖ´ÐÐÒÔÏÂÓï¾ä£º
$u = sprintf("%u",
2147483648); # ¸ü»»Îª%b,%dÊÔÊÔ
var_dump($u);
......
¼Ì³ÐÌØÐÔ¼ò»¯Á˶ÔÏó£¬ÀàµÄ´´½¨£¬Ôö¼ÓÁË´úÂëµÄÖØÓÃÐÔ¡£µ«ÊÇPHPÖ®Ö§³Öµ¥¼Ì³Ð¡£Èç¹ûÏëʵÏÖ¶à¼Ì³ÐµÄ»°¾ÍÒªÓõ½PHPµÄ½è¿Ú¡£PHP¿ÉÊÇʵÏÖ¶à¸ö½Ó¿Ú¡£
²»ÒªÓÃpublicÒÔÍâµÄ¹Ø¼ü×ÖÀ´ÐÞÊνӿÚÖеÄÀà³ÉÔ±¡£¶ÔÓÚ·½·¨£¬²»Ð´¹Ø¼ü×ÖÒ²¿ÉÒÔ¡£ÕâÊÇÒ»¸ö½è¿ÚÀà×ÔÉíµÄÌìÐÔ¾ö¶¨µÄ¡£ÄÇôÎÒÏëËûÊÇÎªÊ²Ã´ÄØ£¿
¶ÔÓÚ½Ó¿ÚÀ´Ëµ£¬Ëü²»ÄÜÓÃprotected,ºÍpr ......