PHP extension wrapping amzn/ion-c. See the Amazon ION specification.
BSD-2-Clause; see spdx.org.
phpize
./configure # --with-php-config=<path/to/php-config>
make # -j$(nproc)
sudo make install # INSTALL=install
pecl install ion
Watch out for PECL replicates and pharext packages attached to releases.
docker build -t php-ion
docker run --rm php-ion -r 'echo ion\serialize(ion\Symbol\PHP::asTable());'
See ion.stub.php.
Due to private internal state of ion-c's readers and writers, instances of the following PHP classes cannot be cloned:
This extension provides a stub file four your editor's auto-completion.
Download the Stub file:
Serialize a PHP value as ION data.
string
ion\serialize(mixed
$data, [ion\Serializer|array
|null
$serializer = NULL
])
Unserialize ION data (stream) as PHP value(s).
mixed
ion\unserialize(string
|resource
$data, [ion\Unserializer|array
|null
$unserializer = NULL
])
The Catalog holds a collection of ion\Symbol\Table instances queried from ion\Reader and ion\Writer instances.
class ion\Catalog implements Countable
An arbitrary precision fixed point decimal.
class ion\Decimal implements Stringable
Base exception for the ION extension.
class ion\Exception extends Exception
implements Throwable
A large object.
class ion\LOB
ION reader API.
interface ion\Reader implements RecursiveIterator
Serializer interface, used to customize ion\serialize()'s behavior.
interface ion\Serializer
class ion\Symbol implements Stringable
An ION Timestamp.
class ion\Timestamp extends DateTime
implements DateTimeInterface
, Stringable
ION data type.
enum
ion\Type implements BackedEnum
Unserializer interface, used to customize ion\unserialize()'s behavior.
interface ion\Unserializer
ION writer API.
interface ion\Writer