Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Apr 16, 2019
1 parent 066bc3e commit cda53ad
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,30 @@ Disallows exporting any custom object using direct property access and bound clo

Disallows exporting closures.

### `VarExporter::INLINE_NUMERIC_SCALAR_ARRAY`

Formats numeric arrays containing only scalar values on a single line:

```php
VarExporter::export([
'one' => ['hello', 'world', 123, true, false, null, 7.5],
'two' => ['hello', 'world', ['one', 'two', 'three']]
], VarExporter::INLINE_NUMERIC_SCALAR_ARRAY);
```

```php
[
'one' => ['hello', 'world', 123, true, false, null, 7.5],
'two' => [
'hello',
'world',
['one', 'two', 'three']
]
]
```

Types considered scalar here are `int`, `bool`, `float`, `string` and `null`.

## Error handling

Any error occurring on `export()` will throw an `ExportException`:
Expand Down

0 comments on commit cda53ad

Please sign in to comment.