3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class a { public function run() { echo "a::run get_class: " . get_class($this); echo "\na::run __CLASS__: " . __CLASS__; } } class b extends a{ public function run_b() { echo "b::run_b get_class: " . get_class($this); echo "\nb::run_b __CLASS__: " . __CLASS__; } } //$a = new a(); $b = new b(); //echo "\na->run();\n"; //$a->run(); echo "\n\nb->run();\n"; $b->run(); echo "\n\nb->run_b();\n"; $b->run_b();
Output for 5.4.9 - 7.1.7
b->run(); a::run get_class: b a::run __CLASS__: a b->run_b(); b::run_b get_class: b b::run_b __CLASS__: b