phpstrom查看php内置函数,phpstorm查看方法的实现

87b93325c458f8ccd65df71aef603f8b.png

SMILET

\\php-7.1.0\\ext\\standard\\string.c line:4091

PHP_FUNCTION(str_replace)

/* Phpstorm中的方法定义实际是加载了一个php文件,以供IDE建立函数索引,该文件列出了各函数定义及参数

实际方法的实现需要阅读源码 */

// 核心函数:

#define php_memnstr zend_memnstr

static zend_always_inline const char *

zend_memnstr(const char *haystack, const char *needle, size_t needle_len, const char *end)

// 功能:在字符串中搜索needle出现的位置

static zend_string *php_str_to_str_ex(zend_string *haystack,

char *needle, size_t needle_len, char *str, size_t str_len, zend_long *replace_count)

static zend_string *php_str_to_str_i_ex(zend_string *haystack, char *lc_haystack,

zend_string *needle, char *str, size_t str_len, zend_long *replace_count)

// 功能:在haystack中搜索needle,并将其替换为str,i版本为大小写不敏感

static zend_string* php_char_to_str_ex(zend_string *str, char from, char *to, size_t to_len, int case_sensitivity, zend_long *replace_count)

// 功能:将单字符search替换为目标repalce

static zend_long php_str_replace_in_subject(zval *search, zval *replace, zval *subject, zval *result, int case_sensitivity)

// 功能:将subject中的search字符串替换为replace字符串,并返回替换次数

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值