/** * Extended method in PHP 5.3 test. * @return void */ public function testExtendedMethod53() { if (version_compare(PHP_VERSION, '5.3.0', '<')) { return; } eval(' TestClass::extensionMethod("join53", function (TestClass $_this, $separator) { return $_this->foo . $separator . $_this->bar; } ); '); $obj = new TestClass('Hello', 'World'); $this->assertEquals("Hello*World", $obj->join53("*")); }