<?php declare(strict_types = 1); class C { function __serialize() { return ['a' => 'b']; } /** @param array<string, string> $a */ function __unserialize(array $a) { throw new Exception("nope"); } } $c = new C(); $s = serialize($c); try { unserialize($s); } catch (Exception $e) { echo "caught " . $e->getMessage(); }
You have javascript disabled. You will not be able to edit any code.