3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum MyEnum: string { case value = 'value'; } $object = new \stdClass(); $enum = MyEnum::value; $payload = 'payload'; $map = new \SplObjectStorage(); $map[$object] = $payload; $map[$enum] = $payload; foreach ($map as $key => $value) { var_dump($key, $value); }

preferences:
24.53 ms | 404 KiB | 5 Q