3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach ((new ReflectionClass('\DateTime'))->getMethods() as $method) { if ($method->getName() == 'modify') { $returnType = $method->getTentativeReturnType(); if ($returnType instanceof ReflectionUnionType) { foreach ($returnType->getTypes() as $type) { var_dump($type->getName()); } } } }

preferences:
25.43 ms | 404 KiB | 5 Q