<?php final class DemoFile { /** * @var array{ * cache: array{directory: null} * } */ protected array $config = [ 'cache' => [ 'directory' => null, ], ]; public function getCacheDirectory(): ?string { $dir = $this->config['cache']['directory'] ?? null; \assert(\is_string($dir) || $dir === null, 'Invalid cache directory.'); return $dir; } } $demo = new DemoFile(); var_dump($demo->getCacheDirectory());
You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).