<?php
abstract class First{
const id = __CLASS__;
public static function start(){
static::run(new static);
}
protected static function run(First $instance){
echo __CLASS__, PHP_EOL;
$instance->dynamicRun();
}
protected function dynamicRun(){
echo self::id, PHP_EOL, get_class($this);
}
}
class Second extends First{
const id = __CLASS__;
public static function start(){
parent::run(new static);
}
}
Second::start();
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_VARIABLE in /in/UguvA on line 5
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
<br />
<b>Parse error</b>: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_VARIABLE in <b>/in/UguvA</b> on line <b>5</b><br />
Process exited with code 255.
Output for 5.0.0 - 5.0.5
<br />
<b>Parse error</b>: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_VARIABLE in <b>/in/UguvA</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.4.2 - 4.4.9
<br />
<b>Parse error</b>: syntax error, unexpected T_CLASS in <b>/in/UguvA</b> on line <b>2</b><br />
Process exited with code 255.