3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CacheabilityMetadata {} class_alias('CacheabilityMetadata', 'CacheableMetadata'); class SomethingElse {} function f(CacheabilityMetadata $m) {} function g(CacheableMetadata $m) {} f(new CacheabilityMetadata); f(new CacheableMetadata); g(new CacheabilityMetadata); g(new CacheableMetadata); f(new SomethingElse);
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
Fatal error: Uncaught TypeError: f(): Argument #1 ($m) must be of type CacheabilityMetadata, SomethingElse given, called in /in/80D6A on line 14 and defined in /in/80D6A:7 Stack trace: #0 /in/80D6A(14): f(Object(SomethingElse)) #1 {main} thrown in /in/80D6A on line 7
Process exited with code 255.

preferences:
68.66 ms | 406 KiB | 5 Q