3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class JsonSerializer { public static function serialize($value) { var_dump($value); } public function __call($method, $args) { if ('serialize' !== strtolower('serialize')) { throw new \BadMethodCallException('Call to undefined method '.__METHOD__); } return self::serialize(...$args); } } JsonSerializer::serialize('foo'); (new JsonSerializer())->serialize('bar'); (new JsonSerializer())->baz('qux');
based on nUXDJ
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
string(3) "foo" string(3) "bar" string(3) "qux"