Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Problem in 5.3.8
- <?PHP
- print ILLI_Constructeur::get_Instance(self::c_CNSTCNFG)->_ENVIRONMENT_MODE; // 'PRODUCTION'
- ?>
- run:
- <?PHP
- if(ILLI_Constructeur::get_Instance(self::c_CNSTCNFG)->_ENVIRONMENT_MODE == 'PRODUCTION')
- print 'email';
- else
- print 'exception';
- ?>
- expected: email
- actual: email
- bug:
- <?PHP
- if(isset(ILLI_Constructeur::get_Instance(self::c_CNSTCNFG)->_ENVIRONMENT_MODE)
- && ILLI_Constructeur::get_Instance(self::c_CNSTCNFG)->_ENVIRONMENT_MODE == 'PRODUCTION')
- print 'email';
- else
- print 'exception';
- ?>
- expected: email
- actual: exception
- solution:
- <?PHP
- if(ILLI_Constructeur::get_Instance(self::c_CNSTCNFG)->offsetExists('ENVIRONMENT_MODE')
- && ILLI_Constructeur::get_Instance(self::c_CNSTCNFG)->_ENVIRONMENT_MODE == 'PRODUCTION')
- print 'email';
- else
- print 'exception';
- ?>
- The original-code
- <?PHP
- ABSTRACT CLASS ILLI_Container_Abstract IMPLEMENTS ILLI_Container_Interface, ILLI_Interface
- {
- /**
- * data-cache
- *
- * @var array
- */
- private $cache
- = array();
- /**
- * @param $name string var-name
- * @return bool if offset exists in {@link ILLI_Container_Abstract::$cache} or getter-method exists
- */
- public function __isset($name)
- {
- if($name{0} === '_')
- return $this->offsetExists
- (
- substr
- (
- $name,
- 1
- )
- );
- else
- return $this->methodExists($name);
- }
- /**
- * @param $name string var-name
- * @return bool array-key exists in {@link ILLI_Container_Abstract::$cache}
- */
- public function offsetExists($name)
- {
- $name =
- str_replace
- (
- '-',
- '_',
- $name
- );
- return array_key_exists
- (
- $name,
- $this->cache
- );
- }
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement