简体   繁体   中英

PHP Extensions versus SPL

I keep hearing about php extensions, the standard php library, and built in classes. What are the differences? Let me explain what i mean,

http://us3.php.net/manual/en/extensions.membership.php The page is labeled php core extensions but then it mentions that the following classes are not actual extensions. Would it be the standard library? What is php's standard library? are they classes that come with php?

thanks

Core

PHP has some functions that are part of PHP no matter what. These are considered to be important to all of PHP. Those are considered Core .

Bundled

Some functions (like BC Math) are those you must choose to have as part of PHP. You can compile it with or without those libraries, allowing you the flexibility to decide what you do and don't need.. You can use a pre-compiled library to add those functions (ie in CentOS you can install the package php-bcmath to get BC Math). In Windows, these will be in a separate DLL.

External

Very similar to Bundled except that these functions also rely on programs outside PHP to work (ie you can't use MySQL functions without MySQL installed).

PECL

These are completely outside the PHP project (as in the author of the extension is responsible and not the PHP team). They must be compiled against PHP but you don't have to go to great lengths to do this thankfully, since the PEAR system contains a method that will download the project source and compile it. Understand that if you upgrade the PHP Core to a major version (ie 5.4 to 5.5) you will have to recompile any PECL libraries you compiled yourself. Some libraries (especially Windows) offer pre-compiled versions as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM