3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class A { const MSG = 'I am the base class'; // You'd think this would print out the above, but it prints out the one that's extending this instead public function getOriginalMessage() { echo static::MSG; } } class B extends A{ const MSG = 'I am Class B'; } $b = new B; $b->getOriginalMessage();

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
149.62 ms | 2740 KiB | 10 Q