您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP大数据处理要注意的

2025/5/8 4:54:56发布17次查看
1. 传递值使用引用传递 $a = get_large_array(); pass_to_function($a); 这样是传递变量的引用而不是拷贝 2.将大数据存在类的变量中 class a { function first() { $this-a = get_large_array(); $this-pass_to_function(); } function pass_to_function() {
1. 传递值使用引用传递
$a = get_large_array(); 
pass_to_function(&$a); 
这样是传递变量的引用而不是拷贝
2.将大数据存在类的变量中
class a 

function first() 

$this->a = get_large_array(); 
$this->pass_to_function(); 

function pass_to_function() 

//process $this->a 


3.变量使用完毕后尽快的unset变量,释放内存,减小脚本负担负担。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product