ãã¢ãã³PHPåå¼·ä¼ãã¬ãã¼ã
ä»æ¥ã¯ã¢ãã³PHPåå¼·ä¼ã«åå ãã¾ããã
å ´æã¯å
æ¬æ¨ã®Greeãåãã¦ããï¼åå ç³ãè¾¼ã¿æ°ï¼ï¼äººã§è£æ¬ å¾
ãã§ã¦ã¾ãã
ä»åã¯ã¢ãã³ãªPHPã®ä½¿ãæ¹ããã¼ãã¨ãããã¨ã§ãææ°ã®PHPæè¡ãåå¼·ãããã¨æãã¾ãã
ã以ä¸ã¯åå¼·ä¼ã®ã¡ã¢ã
ãèãããã®ãã ããããã®ã¾ã¾æ¸ãåãã¦ããã®ã§ããã¬ã¼ã³è³æãå
¬éãããããã£ã¡ãã¿ãã»ããæ£ç¢ºã§ãããã¨æãã¾ãããé°å²æ°ãä¼ããæå³ã§è¼ãã¦ããã¾ãã誤åè±åã¯ã容赦ãã
ãã¾ããå½æ¥ã¯ustreamã§ã®ä¸ç¶ãããã¾ããâãã¡ãã
ãustreamã¸ã®çºè¨ã¯twitterã§ããã·ã¥ã¿ã°ã§æ¤ç´¢ããã°ã¾ã¨ãã¦è¦ãããã§ããããâãã¡ã
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
â ãã£ã¨ç¥ãããåå空é (çºè¡¨ï¼fivestaræ°ï¼ è³æ
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
PHP5.3.0ã§æè¼ãããåå空éã«ã¤ãã¦ã
ã¢ãã³ã¨ãã£ã¦æãã¤ãã®ã¯ã»ã»ã»
ã»PHPï¼ããå¼·åããããªãã¸ã§ã¯ãæåï¼
ã»ãã¬ã¼ã ã¯ã¼ã¯ã®æ©è½
â åå空éæ¦è¦
ãUNIXã®ãã¡ã¤ã«ã·ã¹ãã ã«ãã£ã¬ã¯ããªããªãã£ããããã¡ã¤ã«åããã¶ã£ã¦å¤§å¤ï¼ï¼
ããã¡ã¤ã«åããã¶ãããã¨ä¸é¨æ¹å¤ãã¦å¯¾å¦ãã¦ãzipãå±éããããã¶ã£ã¡ãã£ããï¼
ãPHPã§ãé¢æ°åãã¯ã©ã¹åããã¶ã£ã¦ãã¾ããã¨ã¯ããããã
ãâ
ãããã解決ããã®ãåå空éã
ãåå空éã¯ãPHP5.3.0ããå®è£
ããã¦ãé¢æ°åãã¯ã©ã¹åãå®æ°ãªããè¡çªããã®ãé²ãã
ãå¤æ°åã¯é©ç¨ãããªãã
ï¼ï¼php
namespace foo\bar; // åå空éã®å¶éããã®åã®è¡ã«ãªã«ãæ¸ãã¦ã¯ãããªãï¼
class MyObject{} // foo\bar\MyObject ã¨ãªã
$obj = new MyObject(); // foo\bar\MyObject
åå空éã¯ããnamaespaseãã§å®£è¨ãåå空éã®åºåãã¯ã\ã(ããã¯ã¹ã©ãã·ã¥âæ¥æ¬èªãã©ã³ãã ã¨åãã¼ã¯ã ãã©ã»ã»ã»ã¾ãä¸æåã§ãã¡ãããããã»ã»ã»ããããã»ã»ã»ãªãã¦ããæå¥ãã£ã¦ãã ããã¨ã®ãã¨)
å
é ã«ãï¿¥ããã¤ããã¨ã°ãã¼ãã«ï¼ã«ã¼ãï¼ããã®çµ¶å¯¾æå®ã«ãªãã
UNIXã®ãã¡ã¤ã«ã·ã¹ãã ã®ãã£ã¬ã¯ããªã¨èããã¨ããããããã
ã__NAMESAPCE__ãå®æ°ãnamespaceæ¼ç®åã§ç¾å¨ã®namespaceãå¾ãããã
â¼ å®ç¾©
é修飾åãåºåãæåãå«ã¾ãªãèå¥å
修飾åãåºåãæåãå«ã¾ãªãèå¥å
å®å
¨ä¿®é£¾åãåºåãæåãå«ã¾ãªãèå¥å
â¼ ã¤ã³ãã¼ãã»ã¨ã¤ãªã¢ã¹
ï¼?php
use foo\Foo; // ã¤ã³ãã¼ããç¾å¨ã®åå空éã«ã¤ã³ãã¼ãããåå空éãçç¥ã§ãã
$obj = new Foo();
use MyApplicaion_MyObj as MyObj; // ã¨ã¤ãªã¢ã¹
$obj = new MyObj();
use bar\baz as baz; // åå空éã®ã¨ã¤ãªã¢ã¹
$obj = new baz\MyObj();
â» åçã®å称ã§inportã¯ã§ããªã
â¼ãåä¸ç©ºéã§åå空éãè¤æ°æå®ããå ´å
è¤æ°æ¸ãã°è¯ãã
namespaceãã§ã¦ãããã¨ã«ãåãæ¿ããã
ã¾ãã¯ã{ } ã§å²ãã¨ããã®ç¯å²ãnamespaceã§æå®ãããããã£ã¡ã®ã»ããããã
â» namespace { } ã§å²ã¾ããã¨ã°ãã¼ãã«ç©ºéã§æå®ãããã
â» ãã¹ãã¯ã§ããªã
â» ä¸ã¤ã®ãã¡ã¤ã«ã§åå空éãè¤æ°æå®å¯è½ãåä¸ã®è¤æ°ã®åå空éãããã¤ãè¨è¿°ãããã¨ãå¯è½ã
â» ãã ããï¼ã¤ã®ãã¡ã¤ã«ã«ã¯ï¼ã¤ã®åå空éãæã¾ãã
â åå空éã®æ³¨æç¹
â¼ åå解決ã«ã¼ã«
ç¾å¨ã®åå空éããã®ç¸å¯¾æå®ã¨ãªãã
ã»ã¯ã©ã¹ã¯ãåå空éã«ãªãã¨ã¿ã¤ãããªã
ã»é¢æ°ã¯ãåå空éã«ãªããã°ã°ãã¼ãã«ã®ç©ºéãæ¢ãã«è¡ã
ã»åçã«æååå¤æ°ãnew ãã¦ããã®ä¿æãã¦ããæåã®ã¯ã©ã¹ãçæã§ããã
ãâ»ããã ãããï¿¥ãã¯ã¨ã¹ã±ã¼ãæåãªã®ã§ããâãã§ã¯ãªãã¦ãâãã§å²ãã æååã§æå®ããªãã¨ãããªãã
ãâ» æååã§æå®ããå ´åã¯kãªããã°ãã¼ãã«ç©ºéããæå®ãããã®ã§æ³¨æï¼
ãããï¼åå解決ã¯ã³ã³ãã¤ã«æã«è¡ããããããå®è¡æã«ã¯åå解決ãè¡ãããªãããã¨èããããï¼
â åå空éã¨ãªã¼ããã¼ãï¼ãã¬ã¼ã ã¯ã¼ã¯ã§ããå©ç¨ãããï¼
ãapl_autoload_register ã§é¢æ°ãæå®ããã¨ãæå®ããé¢æ°ãèªã¿è¾¼ã¾ãã¦ããªãç¶æ ã§ä½¿ç¨ãããã¨ããã¨ãã«å®è¡ãããã¹ã¯ãªããããããã
ãåå空éå ã§ããªã¼ããã¼ããããå ´åã¯ãã°ãã¼ãã«æå®ãããåå空éï¼åå解決ãããï¼ã«å¤æããã¦ã¯ã©ã¹åã渡ãããã
ãuseãããã ãã§ã¯ã¯ã©ã¹ã¯ãã¼ããããªãã
ããªãã¸ã§ã¯ããnewããæç¹ã§ããªã¼ããã¼ããããã
ãclass_exists()ã§ã¯ã©ã¹ã®åå¨å¤å®ãã§ããã
ãããã©ã«ãå¼æ°ã§ã¯ãªãå ´åã¯ããªã¼ããã¼ããããããã®å ´åã¯ãæååã®ã¾ã¾ï¼ã°ãã¼ãã«ããã®æå®ï¼ã§ã¯ã©ã¹ããã¼ããããã
â åå空éã¨ãã¬ã¼ã ã¯ã¼ã¯
ãSymphonyããã¯ããªã³ï¼O/Rãããã¼ï¼ã¯ãåå空éãæ´»ç¨ãã¦éçºããã¦ããã
ï¼ãã®ä»ã®ãã¬ã¼ã ã¯ã¼ã¯ã§ãåå空éãæ´»ç¨ããããã«ãªã£ã¦ããã ããï¼
â¼ ãPHP Standrds Working Groupãã§çå®ä¸ (Google Groupå ï¼
ããCoding standard for PHP ï¼ï¼ï¼ and aboveãã«ã§ãåå空éã«é¢ããã«ã¼ã«ãå®ãããã¦ããã
ã»åå空éã¯ã常ã«å°æåï¼ã¢ã³ãã¼ã¹ã³ã¢
ã»ãããã¬ãã«ã¯ãã³ãã¼åï¼æçã§ï¼ãä¾ï¼zend , cake ãªã©
ã»ãµãã®åå空éã¯èªç±ã«ã¤ãã£ã¦ãã
ã»åå空éã®ã»ãã¬ã¼ã¿ã¯ããã£ã¬ã¯ããªã»ãã¬ã¼ã¿ã表ã
ã»ååã¯ã¢ã³ãã¼ã¹ã³ã¢ï¼ï¼¿ï¼ã¯æå³ãæããªãï¼ãã£ã¬ã¯ããªã§ã¯ãªãï¼
ãã¯ã©ã¹åã
ã»ã¢ããã¼ãã£ã¡ã«ã§å½å
ã»ã¯ã©ã¹åã®ã¢ã³ãã¼ã¹ã³ã¢ã¯ï¼ï¼¿ï¼ã¯ããã£ã¬ã¯ããªã»ãã¬ã¼ã¿ã¼ã¨è¡¨ã
ã»ã¤ã³ã¿ã¼ãã§ã¼ã¹ã¯ãInterfaceãµãã£ãã¯ã¹ãã¤ãã
ã»æ½è±¡ã¯ã©ã¹ã¯ãAbstractãµãã£ãã¯ã¹
ãä¾å¤ã«é¢ããã«ã¼ã«ã
ã»ãã¹ã¦ã®ããã±ã¼ã¸ã¯ããã±ã¬ãã«ã®Exceptionãä½å
·ãã
ã»å¯è½ãªéãSPLã¬å¤ã使ããï¼ãã以å¤ã¯ããã±ã¼ã¸ã¬ãã«ã®ä¾å¤ï¼
ã主è¦ãã¬ã¼ã ã¯ã¼ã¯å¯¾å¿ç¶æ³ã®ä¾ï¼ã
ã» Lithiumãã¬ã¼ã ã¯ã¼ã¯
ãå½åè¦åã¯æºæ ãã¦ããã
ã»Zend Framework , PEAR2
ãä¸æï¼æºæ ããï¼
ãPEAR2ã¯ãpear2ã¨å
é ã®ãã³ãã¼åã ãã¯å°æåã§æºæ ãã¦ãã模æ§ããã®ä¸ä½é層ã¯æºæ ããªããã
ã»symfony / Doctrine
ãåå空éãã¢ããã¼ãã£ã¡ã«
ãâ» PEARã®å½åè¦åã®ããããã_ãããããï¿¥ãã«ç½®ãæãã¦ããã ãã®ãããªã»ã»ã»
ãâ» éçºéå§ããgroupãåºæ¥ãåã ã£ãããã§ã¯ãªããï¼
ã»ã»ã»æºæ ç¶æ³ã¯ã¾ã¡ã¾ã¡ã¿ããã§ããã»ã»ã»
SplClassLoaderã¨ãããªã¼ããã¼ãã使ãã°ããããããªå½åè¦åã«å¯¾å¿ã§ããããã
â ææ³ â
ãåå空éã¯ä»ã®ã¢ãã³ã½ãè¨èªåæ§æ´åããã¦ããã
ãã¤ã³ãã¼ããã¨ã¤ãªã¢ã¹ã¯ä¾¿å©ããã
ããã ãå±éã®ããæ¹ï¼ã«ã¬ã³ãããç¸å¯¾ãã°ãã¼ãã«ãããï¼ãå ´åã«ãã£ã¦ã¡ããã®ããããªããã
ãå½åè¦ç´ã«ã¤ãã¦ã¯çµ±ä¸åããããã®ã¯ã¼ãã³ã°ã°ã«ã¼ããããããæåãã¬ã¼ã ã¯ã¼ã¯ãæºæ åºæ¥ã¦ããªããã®ãå¤ãã«ãªã¹ã£ã½ãã
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
â ããã¶è¦ãã¾ãSPL (çºè¡¨ï¼sotarokæ°ï¼è³æ
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
â SPLã¨ã¯
ãStandard PHP Libraryã
PHP5ã«æ¨æºæè¼ãããæ¡å¼µæ©è½
PHPã®ãæ¨æºçãªåé¡ãã解決ããããã®
ã»ã¯ã©ã¹
ã»ã¤ã³ã¿ã¼ãã§ã¼ã¹
ã»ä¾å¤
ãªã©
PHP5.0以éã§å¯¾å¿ãï¼ï¼ï¼ã§ã¯ç¡å¹ã«ã§ããªãããããªããã¤ã³ã¹ãã¼ã«ããã¦ããã
ãã¼ã¸ã§ã³ãããããã³ã«ããªããã¼ã¸ã§ã³ãããã£ã¦ãã
ãã ã¾ã å©ç¨è ãå°ãªããããããªã«ããã®ãããã©ããªã¨ãã«ã¤ãããããããä»å解説ã
â¼ãããããï¼PHPã®ã¤ã³ã¿ã¼ãã§ã¼ã¹
interfaceå¥ã§å®ç¾©ã§ããã5.0ãã対å¿ã
å®ç¾©æ¸ã¿ã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã¯ä»¥ä¸ã®ãã®ããã
ã»Traversableãâ foreacå¯è½ã«ãªãï¼æ½è±¡ã¤ã³ã¿ã¼ãã§ã¼ã¹ï¼
ã»Iteratorãâãå復å¦çãè¡ãããã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ (nextã¨ãcurrent,keyãªã©)
ã»IteratirAggrigatorãâãå¤é¨ã¤ãã¬ã¼ã¿ãä½æããããã®ã¤ã³ã¿ã¼ãã§ã¤ã¹
ã»ArrayAccressãâãé
å風ã«ã¢ã¯ã»ã¹å¯è½ã«ãªããããâ[] ã
ã»Serializableãâãserialize/unsirializeæã®æåãç¬èªå®è£
ã§ãã
â SPLã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ç¾¤ï¼ã»ã¨ãã©ã¤ãã¬ã¼ã¿ç¨ï¼
ã»Countableãâãcounté¢æ°ã®å¼æ°ã«æ¸¡ãããããã«ãªã
ã»OuterIteratorãâãã¤ãã¬ã¼ã¿ã¤ã³ã¿ã¼ãã§ã¤ã¹ï¼ã¤ãã¬ã¼ã¿ãä½ãããã®
ã»RecursiveIteratorãâãé層æ§é ããã¤ã¯ã©ã¹ãå®è£
ãã
ã»SeekableItrerator â seekã¡ã½ããã«ãã£ã¦ãã¦ã¬ã¼ãä½ç½®ããã©ããã¦è¦ç´ ã®ã¢ã¯ã»ã¹ãã
â SPLã®ã¯ã©ã¹
ã»SplFileinfo âããã£ã«è²æ©ããæ±ãã¯ã©ã¹ï¼SplFileObjectãªã©ã®ãã¼ã¹ï¼GetRealaPath ,getBasenameãªã©
ã»SplFileObject â ãã¡ã¤ã«ããªãã¸ã§ã¯ãã¨ãã¦ã®èªã¿æ¸ããæ±ããããã«ããã¯ã©ã¹ãè¤æ°ã¤ãã¬ã¼ã¿ãå®è£
ããã¦ãããããï¼è¡ã¥ã¤ãã¦ã¬ã¼ããããã§ãããæ¨æºã®PHPã®é¢æ°ã¨åããããªã¡ã½ãããå®è£
ããã¦ãããâä¸æãã¡ã¤ã«ç¨ã¯ãSplTmpFileObject
ã»ArrayObjectâ ãªãã¸ã§ã¯ããé
åã¨ãã¦åä½ããããã¨ãã§ãããâã¯ã©ã¹ã®è¤æ°ã®ã¡ã³ãã¼ãé
åã®ããã«ã¢ã¯ã»ã¹ï½ããã
ã»SplObserver/SplSubjectãâãObserverãã¿ã¼ã³ãå®è£
ããããã®ã¯ã©ã¹ãå®è£
ã¯èªåã§ãããï¼PEAR::HTP_Request2ãªã©ã§æ´»ç¨ããã¦ããï¼
â SPLã®ã¤ãã¬ã¼ã¿ã¼ã
ï¼ï¼åãããâä»åã¯ï¼ï¼åã ã
ã»ArrayIterator â é
åãã¤ãã¬ã¼ãããããã®ãã®ï¼é
åããã¤ãã¬ã¼ã¿ãgetãã¦ä½¿ããé
åã§ããæå³ã¯ï¼ï¼
ã»RecursiveArrayIterator â é層é
åãã¤ãã¬ã¼ããããã§ããã®ã¾ã¾ã§ã¯ãå帰ã¯ãããªããâRecursiveIteratorIteratorã使ãã¨å帰ããã¦å
¨é¨ãã¤ãã¬ã¼ãã§ããã
ã»InifinityIterator â ç¡éã«ãããããããã¤ãã¬ã¼ã¿ã¼ãã«ãã³ããï¼ãã©ãä½ã«ã¤ããã®ãï¼
ã»LimitiiTERATOR â ãªãã»ãããã¤ãã¬ã¼ãåæ°å¶éãæå®ã§ãã (Zendã§ãã«ããããªãã®ãã¤ããããã¦ããï¼
ã»DirectoryIterator â æå®ãã£ã¬ã¯ããªã®ãã¡ã¤ã«ã®ä¸è¦§ãªã©ã¨ããï¼ã¯ã¤ã«ãã©ã«ã¼ãã§ãã£ã«ã¿ãã§ããï¼
ã»RecurciveDeirectoryIterator â å帰çã«ãã£ã¬ã¯ããªé層ãã¹ãã£ã³ã§ãããããã¯ä¾¿å©ã ãª
ã»RecursiveTreeIterator â ããªã¼è¡¨ç¤ºã§ã§ã¦ãããã¢ã¹ãã¼ã¢ã¼ãã§
ã»FileSystemIteratorâDirectoryIteratorãç¶æ¿ããããã©ã°ãæå®ãã¦ãã.ãã..ããªã©ãã¹ããããããã¨ãã£ãæå®ãã§ãããforeachã®asã§ãããå¤æ°ã«ããªã«ãããããæå®ã§ããã
ãâ» __DIR__ å®æ°ã¯ãPHP5.3ã§ã¤ããããã«ãªã£ãã
ã»GlobIterator â ãã©ã°ã§æå®ã§ããï¼
ã»FilterIterator â ãæã¾ããå¤ããã£ã«ã¿ãã¦ãããããacceptã¡ã½ãããå®è£
ãããã¨ã§ã§ãã£ã«ã¿ã¼å¯¾è±¡ãå¤å®ããï¼æ»ãå¤ã§æå®ï¼
ã»RecurusiveFilterIteratorãâååºæ¿
ã»RegexIteratorâFilterIteratorãç¶æ¿ãæ£è¦è¡¨ç¾ã§ãããããããå¤å®ã§ãã
ã»NoRewidIteratorãâRewindã§ããªãã¤ãã¬ã¼ã¿ãstdinãªã©ãforeachã«ããããã¨ãã§ããããã«ãªãã
ã»MultipleIteratorãâè¤æ°ã®ã¤ãã¬ã¼ã¿ã¼ãåæã«ã¾ãããã¨ãï½ããããâè¤æ°ãã¡ã¤ã«ã並åã«åæã«å¦çãããã¨ãã«ä½¿ããªã©ãAttachIteratorã¡ã½ããã§ã¤ãã¬ã¼ã¿ã¼ãç»é²ãåæã«ãããããé²ã
ã»SimpleXMLIteratorãâSimpleXMLãã¤ãã¬ã¼ãã§ãããâRecursiveIteratorIteratorã«ãããã¨XMLãå
¨é¨ã¹ãã£ã³ã§ãã
ã»EmptyIterator â空ã®ã¤ãã¬ã¼ã¿ã¼ãâ使ãéããããªããâNULL Iteratorã¨ãã¦ä½¿ããããï¼ä¼å ´ããï¼
â SPLã®Exception
ã SPLä¾å¤
ããã£ãã対å¿ãã¦ãã®ã«PHPã®çµã¿è¾¼ã¿é¢æ°ã§ã¯ããã¾ãä¾å¤ã¨ã°ããªãã
ãSPLã§ã¯ãã¨ã©ã¼æã¯ä¾å¤ãæ´»ç¨ãã¦ãã
â SPLã®Function
ãªãã¬ã¯ã·ã§ã³çãª
ã»clss_implement âãã®ã¯ã©ã¹ãå®è£
ãã¦ããã¤ã³ããªã¡ã³ããè¿ã
ã»class_parameter
ã¤ãã¬ã¼ã¿ã¼çãª
ã»iterator_to_arrayããªã©
ã¯ã©ã¹çãª
ã»spl_calasses âå©ç¨å¯è½ãªSPLã¯ã©ã¹ã帰ã
ã»spl_oject_hash
ãspl_autoloadã
PHPã®autoloadã便å©ã«ããã¯ã©ã¹ãããå©ç¨ããã¦ããã
ã»spl_autoread_registerãâ ã¯ã©ã¹ãã¡ã½ãããautoloadã«ç»é²ã§ãã
ã»apl_autoload â autoloadã®ããã©ã«ãã®å®è¡ãHogeã¯ã©ã¹ãnewããã¨ãhoge.php , hoge.incãèªåçã«å¼ã³åºããâæ¡å¼µåããã¦ããããã®é¢æ°ãç¨æããã¦ãã
autoloadã¯ã©ã¤ãã©ãªéçºè ã主ã«å©ç¨ããã ãã
â PHPã®DATA STRUCTURE
ã»SplDoublyLinkedList â ãªã³ã¯ãªã¹ãããã¥ã¼ãã¹ã¿ãã¯ãå®è£
ã§ããã
ã»SplStack / SplQueue â ã¹ã¿ãã¯ããã¥ã¼
â» PHPæ¨æºã®Arrayã«push,popãããã¨ã§ãåããã¨ã¯ã§ãããã»ã»ã»ãã³ããããé度ã¯ã»ã¨ãã©ããããªãã£ãã
ãªã©ã»ã»ã»
â ã¾ã¨ã
SPL便å©
ã±ã£ã¨ã¿ä½¿ãéãããããªããã®ããããããã®æ©ä¼ã«ã¤ãã£ã¦ã¿ã¦ãããããã
â ææ³ â
ã大å¤ä¾¿å©ãªã©ã¤ãã©ãªç¾¤ã ã¨ããã£ãããã£ã¨ä½¿ãã¹ãã
ãPHP5.3ããã¯æ¨æºã§æè¼ï¼ãªãã«ã§ããªãï¼ãããå®å¿ãã¦ä½¿ããã®ã¯ã¤ã¤
ãAutoloadã¨çµã¿åããã¦ããªã¬ãªã¬ãã¬ã¼ã ã¯ã¼ã¯ãä½ããããªãã
ã第ï¼é¨ã第ï¼é¨ã¨ã大å¤å¾ããã®ãããã¾ããã
ãå¾æ¥åã®éçºã ãã§ã¯ãªãææ°ã®PHPã®æç¨ãªæ©è½ãæ´»ç¨ãããã¨ã§ã§ãããã¨ãå¹çãããã¨å¤§ãããªãã¨æãã¾ãã
ããã®å¾æ親ä¼ã
ãä¹¾æ¯ã
ããã¡ãã§ã®åå¼·ä¼ã¯åãã¦åå ãã¾ããããç±ãè°è«ã交ããããæå¾
以ä¸ã«æ¥½ããã£ãã
ããã¶ã¤ãã¼ã¨ã®åæ¥ã®æ¹æ³è«ï¼ã¿ãªããæ¡ç¨ãã¦ããæ¹å¼ã«ã¯ãã ãããããï¼ããæ°ãµã¼ãã¹ã«ã¤ãã¦ãªã©èªãåãã¾ããã
ã»PHPã®ãã³ãã¬ã¼ãã¨ã³ã¸ã³ã«ã¤ãã¦çªçºLT