3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class BaseRepo { abstract public function getModel(); public function find($id) { $model = $this->getModel(); return $model::find($id); } } class Model { public function find($id) { return [1,2,3]; } } class MRepo extends BaseRepo { public function getModel() { return 'Model'; } } $o = new MRepo; var_dump($o->find(1));
based on 9EM76
Output for 7.0.0 - 7.2.0
Deprecated: Non-static method Model::find() should not be called statically in /in/r1CdY on line 11 array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) }
Output for 5.6.8 - 5.6.28
Deprecated: Non-static method Model::find() should not be called statically, assuming $this from incompatible context in /in/r1CdY on line 11 array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) }
Output for 5.4.12 - 5.5.35
Strict Standards: Non-static method Model::find() should not be called statically, assuming $this from incompatible context in /in/r1CdY on line 11 array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) }
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/r1CdY on line 19
Process exited with code 255.