3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ public $a; public function __construct($a) { $this->a = $a; } public function __wakeup() { printf("Calling wakeup, a=%d\n", $this->a); if ($this->a === 3) { throw new Exception("wakeup threw exception"); } } } $x = [new A(1), new A(2), new A(3), new A(4), new A(5)]; unserialize(serialize($x));

preferences:
25.4 ms | 406 KiB | 5 Q