3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace Piwik\Plugins\Test; class Xyz extends \ArrayObject { public function tester() { } public function hasImplementedEvent($method) { $method = new \ReflectionMethod($this, $method); $declaringClass = $method->getDeclaringClass(); var_dump($declaringClass->name); return 0 === strpos($declaringClass->name, 'Piwik\Plugins'); }}$x = new Xyz(array());$y = $x->hasImplementedEvent('tester1');var_dump($y);
based on CkhSJ
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught ReflectionException: Method Piwik\Plugins\Test\Xyz::tester1() does not exist in /in/9UaVL:8 Stack trace: #0 /in/9UaVL(8): ReflectionMethod->__construct(Object(Piwik\Plugins\Test\Xyz), 'tester1') #1 /in/9UaVL(10): Piwik\Plugins\Test\Xyz->hasImplementedEvent('tester1') #2 {main} thrown in /in/9UaVL on line 8
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Uncaught exception 'ReflectionException' with message 'Method Piwik\Plugins\Test\Xyz::tester1() does not exist' in /in/9UaVL:8 Stack trace: #0 /in/9UaVL(8): ReflectionMethod->__construct() #1 /in/9UaVL(10): Piwik\Plugins\Test\Xyz->hasImplementedEvent() #2 {main}
Process exited with code 255.
Output for 5.3.0 - 5.6.28
Fatal error: Uncaught exception 'ReflectionException' with message 'Method Piwik\Plugins\Test\Xyz::tester1() does not exist' in /in/9UaVL:8 Stack trace: #0 /in/9UaVL(8): ReflectionMethod->__construct(Object(Piwik\Plugins\Test\Xyz), 'tester1') #1 /in/9UaVL(10): Piwik\Plugins\Test\Xyz->hasImplementedEvent('tester1') #2 {main} thrown in /in/9UaVL on line 8
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_STRING in /in/9UaVL on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING in /in/9UaVL on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/9UaVL on line 3
Process exited with code 255.