library superserializer
Can serialize everything, even object with properties contains Closures (big thx to SuperClosure project) and callables
edwardstock/superserializer
Can serialize everything, even object with properties contains Closures (big thx to SuperClosure project) and callables
- Tuesday, February 28, 2017
- by edwardstock
- Repository
- 1 Watchers
- 1 Stars
- 18 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 29 % Grown
SuperSerializer
Can serialize everything, even object with properties contains Closures (big thx to SuperClosure project) and callables, (*1)
, (*2)
Usage
<?php
use edwardstock\superserializer\Serializer;
$o = new \stdClass();
$o->func = function () {};
$o2 = new \stdClass();
$o2->prop = [
'k' => function () {
},
];
$values = [
'integer' => 1,
'float' => 111.111,
'object' => new \stdClass(),
'array' => ['k' => 'v'],
'array_with_closure' => [
'k' => function () {
},
],
'object_with_closure' => $o,
'bool_true' => true,
'bool_false' => false,
'null' => null,
];
$ser1 = Serializer::serialize($o);
$ser2 = Serializer::serialize($o2);
$ser3 = Serializer::serialize($values);
// $o1
$unser1 = Serializer::unserialize($ser1);
// $o2
$unser2 = Serializer::unserialize($ser2);
// $values
$unser3 = Serializer::unserialize($ser3);
dev-master
9999999-dev
Can serialize everything, even object with properties contains Closures (big thx to SuperClosure project) and callables
Sources
Download
MIT
The Requires
-
jeremeamia/superclosure ^2.3
The Development Requires
by
Eduard Maximovich
1.0.0
1.0.0.0
Can serialize everything, even object with properties contains Closures (big thx to SuperClosure project) and callables
Sources
Download
MIT
The Requires
-
jeremeamia/superclosure ^2.3
The Development Requires
by
Eduard Maximovich