草庐IT

objectstorage

全部标签

php - SPL objectstorage vs SPL 数组 vs 普通数组

普通数组、SPL数组和SPL数据存储之间的区别、*用法*场景是什么?如果有人能给出一些使用SPLarray和SPLobjectsrorage的实际例子,那就太好了。 最佳答案 SplFixedArray的主要优势是对于数组的特定用例子集,它要快得多(该子集是只有整数键和固定长度的数组)。所以,例如:$a=array("foo",$bar,7,...thousandsofvalues...,$quux);$b=\SplFixedArray::fromArray($a);//here,$bwillbemuchfastertousetha