Osx-how to customize PHP built-in functions

Source: Internet
Author: User
I recently installed a liip version of PHP, and I feel that many functions are more interesting than native ones. Can I customize some built-in functions. If yes, can I post a method? Thank you very much. I recently installed a liip version of PHP, and I feel that many functions are more interesting than native ones. Can I customize some built-in functions. If yes, can I post a method? Thank you very much.

Reply content:

I recently installed a liip version of PHP, and I feel that many functions are more interesting than native ones. Can I customize some built-in functions. If yes, can I post a method? Thank you very much.

The answer above is a little more difficult (C is required)

In fact, there is a pure PHP Solution for PHP programmers.
In php. ini, there is a configuration item auto_prepend_file. You can set a php file as the file automatically loaded before each execution.

Write a function in this file and you can use it as a custom built-in function.

Write a PHP extension here

Any built-in function requires some underlying extensions of the C Language

@ Chenhengqi the answer is to write the PHP 7 extension. For more information about the extension development before php7, see here.
PHP extension development and getting started

Override_function

Http://php.net/manual/zh/function.override-function.php

Extensions need to be installed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.