3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\XmlRpc\Value
;
12 class Boolean
extends AbstractScalar
16 * Set the value of a boolean native type
17 * We hold the boolean type as an integer (0 or 1)
21 public function __construct($value)
23 $this->type
= self
::XMLRPC_TYPE_BOOLEAN
;
24 // Make sure the value is boolean and then convert it into a integer
25 // The double conversion is because a bug in the ZendOptimizer in PHP version 5.0.4
26 $this->value
= (int)(bool) $value;
30 * Return the value of this object, convert the XML-RPC native boolean value into a PHP boolean
34 public function getValue()
36 return (bool) $this->value
;