public function AbstractOptions::toArray in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/zendframework/zend-stdlib/src/AbstractOptions.php \Zend\Stdlib\AbstractOptions::toArray()
Cast to array
Return value
array
File
- vendor/
zendframework/ zend-stdlib/ src/ AbstractOptions.php, line 73
Class
Namespace
Zend\StdlibCode
public function toArray() {
$array = [];
$transform = function ($letters) {
$letter = array_shift($letters);
return '_' . strtolower($letter);
};
foreach ($this as $key => $value) {
if ($key === '__strictMode__') {
continue;
}
$normalizedKey = preg_replace_callback('/([A-Z])/', $transform, $key);
$array[$normalizedKey] = $value;
}
return $array;
}