Skip to content

1.1.4

Choose a tag to compare

@koriym koriym released this 29 Apr 05:13
· 750 commits to 1.x since this release

This release the issue for serialization #32

For example, You set injectors in several properties as a singleton instance.

class A{}
class B{}
class C{}

$a = new A;
$b = new B;
$c = new C;
$a->c = $b->c = $c;

var_dump(spl_object_hash($a->c) === spl_object_hash($b->c)); // true

but it became no longer a singleton instance after serialization / un-serialization.

list($x, $y) = [unserialize(serialize($a)), unserialize(serialize($b))];
var_dump(spl_object_hash($x->c) === spl_object_hash($y->c)); // false

This become a problem for singleton instance with multiple Injectors.

This PR fix this issue. Different injectors share same singleton instance pool by static prop with injector ID.