3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class ItemMapperBase { public function newInstance($thing) { } } class RevtwoItemMapper extends ItemMapperBase { } $first = new ItemMapperBase::newInstance('foo'); $second = new RevtoItemMapper;
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.29, 5.6.8 - 5.6.13
Parse error: syntax error, unexpected 'newInstance' (T_STRING), expecting variable (T_VARIABLE) or '$' in /in/peLON on line 12
Process exited with code 255.

preferences:
181.64 ms | 1395 KiB | 62 Q