
PHP函数源码笔记
WJHCoding
phper
展开
-
PHP函数源码之var_export分析
今天在使用var_export函数时, 竟然有点手生的感觉, 于是把源码翻出来看了看 /* {{{ proto mixed var_export(mixed var [, bool return]) Outputs or returns a string representation of a variable */ PHP_FUNCTION(var_export) { zval *va原创 2016-09-10 23:25:50 · 549 阅读 · 0 评论 -
PHP函数源码之file_puth_contents分析
闲来无事,找个文件操作函数看下, 刚好中间涉及到底层对流的处理,也算作学习前的预先了解吧 /* {{{ proto int file_put_contents(string file, mixed data [, int flags [, resource context]]) Write/Create a file with contents data and return the nu原创 2016-09-15 13:34:08 · 1263 阅读 · 0 评论 -
PHP函数源码之SESSION实现机制
Session是以扩展的形式嵌入到PHP内核的,所以我们可以把Session当成扩展来看待。 一般扩展被载入到PHP会经过下面几个过程 [cpp] view plain copy #define PHP_MINIT_FUNCTION ZEND_MODULE_STARTUP_D // 初始化module时运行 #def转载 2016-09-03 11:04:57 · 952 阅读 · 0 评论 -
PHP函数源码之VLD实现原理
vld功能的实现要依赖 Zend引擎初始化(zend_startup)的时候 将zend_execute和zend_compile_file定义为函数指针的功劳了 默认的 zend_execute 指向 execute zend_compile_file 指向 compile_file 试想如果我们在实际编译和执行之前将zend_execute和zend_原创 2016-09-04 14:08:42 · 1420 阅读 · 0 评论 -
PHP函数源码之array_merge分析
在使用array_merge时是需要注意键的类型的,对于string 的key 和 数字key的处理方式是有区别的,虽然应用没问题, 但是偶尔写的时候总有点对预期结果不踏实,所以我们还是从底层来分析下,这样在用时候也就底气十足了 PHP_FUNCTION(array_merge) { php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_P原创 2016-10-09 21:59:16 · 1834 阅读 · 0 评论