/** * Returns a string representation * * @return string String representation */ public function __toString() { if ($this->reflectionSource instanceof ReflectionFunction) { return $this->reflectionSource->__toString(); } else { return parent::__toString(); } }
public function testToString() { self::assertEquals($this->php_fctM1->__toString(), $this->fctM1->__toString()); self::assertEquals("{$this->php_fctM2}", "{$this->fctM2}"); self::assertEquals((string) $this->php_fctM3, (string) $this->fctM3); }