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");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mBYtJ
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  100     0  E >   INIT_STATIC_METHOD_CALL                                  'Horde_Core_Translation', 't'
          1        SEND_VAL                                                 'A+fatal+error+has+occurred'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Class Horde_Translation:
Function loadhandler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/mBYtJ
function name:  loadHandler
number of ops:  14
compiled vars:  !0 = $handlerClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   RECV                                             !0      
   35     1        FETCH_STATIC_PROP_R          unknown             ~1      '_domain'
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPNZ_EX                                         ~2      ~2, ->7
          4    >   FETCH_STATIC_PROP_R          unknown             ~3      '_directory'
          5        BOOL_NOT                                         ~4      ~3
          6        BOOL                                             ~2      ~4
          7    > > JMPZ                                                     ~2, ->12
   36     8    >   NEW                                              $5      'Exception'
          9        SEND_VAL_EX                                              'The+domain+and+directory+properties+must+be+set+by+the+class+that+extends+Horde_Translation.'
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $5
   38    12    >   ECHO                                                     'Success'
   39    13      > RETURN                                                   null

End of function loadhandler

Function t:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/mBYtJ
function name:  t
number of ops:  17
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   RECV                                             !0      
   42     1        FETCH_STATIC_PROP_R          unknown             ~2      '_domain'
          2        FETCH_STATIC_PROP_IS                             ~1      '_handlers'
          3        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      ~1, ~2
          4        BOOL_NOT                                         ~4      ~3
          5      > JMPZ                                                     ~4, ->9
   43     6    >   INIT_STATIC_METHOD_CALL                                  'loadHandler'
          7        SEND_VAL_EX                                              'Horde_Translation_Handler_Gettext'
          8        DO_FCALL                                      0          
   45     9    >   FETCH_STATIC_PROP_R          unknown             ~7      '_domain'
         10        FETCH_STATIC_PROP_R          unknown             ~6      '_handlers'
         11        FETCH_DIM_R                                      ~8      ~6, ~7
         12        INIT_METHOD_CALL                                         ~8, 't'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0  $9      
         15      > RETURN                                                   $9
   46    16*     > RETURN                                                   null

End of function t

End of class Horde_Translation.

Class Horde_Translation_Autodetect:
Function loadhandler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 20
Branch analysis from position: 11
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mBYtJ
function name:  loadHandler
number of ops:  26
compiled vars:  !0 = $handlerClass, !1 = $directory
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   67     0  E >   RECV                                             !0      
   69     1        FETCH_STATIC_PROP_R          unknown             ~2      '_domain'
          2        BOOL_NOT                                         ~3      ~2
          3      > JMPZ                                                     ~3, ->8
   70     4    >   NEW                                              $4      'Exception'
          5        SEND_VAL_EX                                              'The+domain+property+must+be+set+by+the+class+that+extends+Horde_Translation_Autodetect.'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $4
   73     8    >   ASSIGN                                                   !1, '%2Ftmp'
   74     9        BOOL_NOT                                         ~7      !1
         10      > JMPZ                                                     ~7, ->20
   75    11    >   NEW                                              $8      'Exception'
         12        INIT_FCALL                                               'sprintf'
         13        SEND_VAL                                                 'Could+not+found+find+any+locale+directory+for+%25s+domain.'
         14        FETCH_STATIC_PROP_R          unknown             ~9      '_domain'
         15        SEND_VAL                                                 ~9
         16        DO_ICALL                                         $10     
         17        SEND_VAR_NO_REF_EX                                       $10
         18        DO_FCALL                                      0          
         19      > THROW                                         0          $8
   78    20    >   ASSIGN_STATIC_PROP                                       '_directory'
         21        OP_DATA                                                  !1
   79    22        INIT_STATIC_METHOD_CALL                                  'loadHandler'
         23        SEND_VAR_EX                                              !0
         24        DO_FCALL                                      0          
   80    25      > RETURN                                                   null

End of function loadhandler

Function t:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/mBYtJ
function name:  t
number of ops:  17
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   RECV                                             !0      
   42     1        FETCH_STATIC_PROP_R          unknown             ~2      '_domain'
          2        FETCH_STATIC_PROP_IS                             ~1      '_handlers'
          3        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      ~1, ~2
          4        BOOL_NOT                                         ~4      ~3
          5      > JMPZ                                                     ~4, ->9
   43     6    >   INIT_STATIC_METHOD_CALL                                  'loadHandler'
          7        SEND_VAL_EX                                              'Horde_Translation_Handler_Gettext'
          8        DO_FCALL                                      0          
   45     9    >   FETCH_STATIC_PROP_R          unknown             ~7      '_domain'
         10        FETCH_STATIC_PROP_R          unknown             ~6      '_handlers'
         11        FETCH_DIM_R                                      ~8      ~6, ~7
         12        INIT_METHOD_CALL                                         ~8, 't'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0  $9      
         15      > RETURN                                                   $9
   46    16*     > RETURN                                                   null

End of function t

End of class Horde_Translation_Autodetect.

Class Horde_Core_Translation:
Function loadhandler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 20
Branch analysis from position: 11
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mBYtJ
function name:  loadHandler
number of ops:  26
compiled vars:  !0 = $handlerClass, !1 = $directory
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   67     0  E >   RECV                                             !0      
   69     1        FETCH_STATIC_PROP_R          unknown             ~2      '_domain'
          2        BOOL_NOT                                         ~3      ~2
          3      > JMPZ                                                     ~3, ->8
   70     4    >   NEW                                              $4      'Exception'
          5        SEND_VAL_EX                                              'The+domain+property+must+be+set+by+the+class+that+extends+Horde_Translation_Autodetect.'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $4
   73     8    >   ASSIGN                                                   !1, '%2Ftmp'
   74     9        BOOL_NOT                                         ~7      !1
         10      > JMPZ                                                     ~7, ->20
   75    11    >   NEW                                              $8      'Exception'
         12        INIT_FCALL                                               'sprintf'
         13        SEND_VAL                                                 'Could+not+found+find+any+locale+directory+for+%25s+domain.'
         14        FETCH_STATIC_PROP_R          unknown             ~9      '_domain'
         15        SEND_VAL                                                 ~9
         16        DO_ICALL                                         $10     
         17        SEND_VAR_NO_REF_EX                                       $10
         18        DO_FCALL                                      0          
         19      > THROW                                         0          $8
   78    20    >   ASSIGN_STATIC_PROP                                       '_directory'
         21        OP_DATA                                                  !1
   79    22        INIT_STATIC_METHOD_CALL                                  'loadHandler'
         23        SEND_VAR_EX                                              !0
         24        DO_FCALL                                      0          
   80    25      > RETURN                                                   null

End of function loadhandler

Function t:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/mBYtJ
function name:  t
number of ops:  17
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   RECV                                             !0      
   42     1        FETCH_STATIC_PROP_R          unknown             ~2      '_domain'
          2        FETCH_STATIC_PROP_IS                             ~1      '_handlers'
          3        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      ~1, ~2
          4        BOOL_NOT                                         ~4      ~3
          5      > JMPZ                                                     ~4, ->9
   43     6    >   INIT_STATIC_METHOD_CALL                                  'loadHandler'
          7        SEND_VAL_EX                                              'Horde_Translation_Handler_Gettext'
          8        DO_FCALL                                      0          
   45     9    >   FETCH_STATIC_PROP_R          unknown             ~7      '_domain'
         10        FETCH_STATIC_PROP_R          unknown             ~6      '_handlers'
         11        FETCH_DIM_R                                      ~8      ~6, ~7
         12        INIT_METHOD_CALL                                         ~8, 't'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0  $9      
         15      > RETURN                                                   $9
   46    16*     > RETURN                                                   null

End of function t

End of class Horde_Core_Translation.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.46 ms | 1408 KiB | 15 Q