3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class BaseTest { public function toFloat() { return 0.0; } public function equals($value) { return $value instanceof static; } } class Test extends BaseTest { } class Test2 extends BaseTest { public function toFloat($useOne = false) { return $useOne ? 1.0 : 0.0; } } $a = new Test(); $b = new Test(); $c = new Test2(); var_dump($a->toFloat()); var_dump($b->toFloat());
based on UbENP
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0beta1
float(0) float(0)