Fixed incorrect array_map example

This commit is contained in:
Eric 2016-07-20 14:19:09 -07:00 committed by GitHub
parent e738aa286a
commit 3617703f3a
1 changed files with 8 additions and 1 deletions

View File

@ -17,8 +17,14 @@ then use it with any array_* function.
```php
$arrObj->array_keys();
$arrObj->array_values();
$arrObj->array_map(function($arr) { return array_keys($arr); });
$arrObj->array_map(
function($value) {
print sprintf("%s\n", $value);
}
);
```
array_map(function($value) {
print sprintf("%s\n", $value); }, $arr));
use the normal `\ArrayObject` methods
```php
$arrObj->exchangeArray($myNewArray);
@ -28,3 +34,4 @@ MIT
## Todo
Finish writing the rest of the tests for array_* functions