Which programming language is this?
class Base
{
const LABEL = 'base';
public function label(): string { return static::LABEL; }
}
class Child extends Base
{
const LABEL = 'child';
}
echo (new Child()) instanceof Base ? (new Child())->label() : '';
Answer: PHP
Late static binding via
Play Programming Languages ▸
static::LABEL, the instanceof operator and ->label() method calls are PHP, not Perl.