<?php class Foo {} class Bar {} function test($value) { var_dump(match (true) { $value instanceof Foo => 'Foo', $value instanceof Bar => 'Bar', }); } test(new Foo()); test(new Bar());
You have javascript disabled. You will not be able to edit any code.