3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Horde_Translation { /** * The translation domain, e.g. the library name, for the default gettext * handler. * * @var string */ protected static $_domain; /** * The relative path to the translations for the default gettext handler. * * @var string */ protected static $_directory; /** * The handlers providing the actual translations. * * @var array */ protected static $_handlers = array(); /** * Loads a translation handler class pointing to the library's translations * and assigns it to $_handler. * * @param string $handlerClass The name of a class implementing the * Horde_Translation_Handler interface. */ public static function loadHandler($handlerClass) { if (!static::$_domain || !static::$_directory) { throw new Exception('The domain and directory properties must be set by the class that extends Horde_Translation.'); } echo "Success"; } public static function t($message) { if (!isset(static::$_handlers[static::$_domain])) { static::loadHandler('Horde_Translation_Handler_Gettext'); } return static::$_handlers[static::$_domain]->t($message); } } abstract class Horde_Translation_Autodetect extends Horde_Translation { /** * The absolute PEAR path to the translations for the default gettext handler. * * This value is automatically set by PEAR Replace Tasks. * * @var string */ protected static $_pearDirectory; /** * Auto detects the locale directory location. * * @param string $handlerClass The name of a class implementing the * Horde_Translation_Handler interface. */ public static function loadHandler($handlerClass) { if (!static::$_domain) { throw new Exception('The domain property must be set by the class that extends Horde_Translation_Autodetect.'); } $directory = '/tmp'; if (!$directory) { throw new Exception(sprintf('Could not found find any locale directory for %s domain.', static::$_domain)); } static::$_directory = $directory; parent::loadHandler($handlerClass); } } class Horde_Core_Translation extends Horde_Translation_Autodetect { /** * The translation domain * * @var string */ protected static $_domain = 'Horde_Core'; /** * The absolute PEAR path to the translations for the default gettext handler. * * @var string */ protected static $_pearDirectory = '@data_dir@'; } Horde_Core_Translation::t("A fatal error has occurred");
Output for git.master, git.master_jit, rfc.property-hooks
Success Warning: Undefined array key "Horde_Core" in /in/mBYtJ on line 45 Fatal error: Uncaught Error: Call to a member function t() on null in /in/mBYtJ:45 Stack trace: #0 /in/mBYtJ(100): Horde_Translation::t('A fatal error h...') #1 {main} thrown in /in/mBYtJ on line 45
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
44.27 ms | 401 KiB | 8 Q