Returns an integer flag holding any combination of php predefined json
option constants as found at http://php.net/manual/en/json.constants.php.

@return int Flag holding json options
510193
protected function _jsonOptions()
    {
        $jsonOptions = 0;

        if (!empty($this->viewVars['_jsonOptions'])) {
            foreach ($this->viewVars['_jsonOptions'] as $jsonOption) {
                $jsonOptions = $jsonOptions | $jsonOption;
            }

            if (isset($jsonOption)) {
                $jsonOptions = $jsonOptions | $jsonOption;
            }
        }

        if (Configure::read('debug') === false) {
            return $jsonOptions;
        }

        if ($this->viewVars['_debugPrettyPrint']) {
            $jsonOptions = $jsonOptions | JSON_PRETTY_PRINT;
        }

        return $jsonOptions;
    }
698621
public function getJsonValue()
    {
        $parts = DateTimeParser::parseVCardDateTime($this->getValue());

        $dateStr = '';

        // Year
        if (!is_null($parts['year'])) {
            $dateStr .= $parts['year'];

            if (!is_null($parts['month'])) {
                // If a year and a month is set, we need to insert a separator
                // dash.
                $dateStr .= '-';
            }
        } else {
            if (!is_null($parts['month']) || !is_null($parts['date'])) {
                // Inserting two dashes
                $dateStr .= '--';
            }
        }

        // Month
        if (!is_null($parts['month'])) {
            $dateStr .= $parts['month'];

            if (isset($parts['date'])) {
                // If month and date are set, we need the separator dash.
                $dateStr .= '-';
            }
        } elseif (isset($parts['date'])) {
            // If the month is empty, and a date is set, we need a 'empty
            // dash'
            $dateStr .= '-';
        }

        // Date
        if (!is_null($parts['date'])) {
            $dateStr .= $parts['date'];
        }

        // Early exit if we don't have a time string.
        if (is_null($parts['hour']) && is_null($parts['minute']) && is_null($parts['second'])) {
            return [$dateStr];
        }

        $dateStr .= 'T';

        // Hour
        if (!is_null($parts['hour'])) {
            $dateStr .= $parts['hour'];

            if (!is_null($parts['minute'])) {
                $dateStr .= ':';
            }
        } else {
            // We know either minute or second _must_ be set, so we insert a
            // dash for an empty value.
            $dateStr .= '-';
        }

        // Minute
        if (!is_null($parts['minute'])) {
            $dateStr .= $parts['minute'];

            if (!is_null($parts['second'])) {
                $dateStr .= ':';
            }
        } elseif (isset($parts['second'])) {
            // Dash for empty minute
            $dateStr .= '-';
        }

        // Second
        if (!is_null($parts['second'])) {
            $dateStr .= $parts['second'];
        }

        // Timezone
        if (!is_null($parts['timezone'])) {
            $dateStr .= $parts['timezone'];
        }

        return [$dateStr];
    }
1207938
@Override
    public NumberType getNumberType() throws IOException, JsonParseException {
    	ConfigValue n = currentNumericNode();
    	if(n == null)
    		return null;
    	
    	Number value = (Number) n.unwrapped();
    	if(value instanceof Double) {
    		return NumberType.DOUBLE;
    	} else if(value instanceof Long) {
    		return NumberType.LONG;
    	} else {
    		return NumberType.INT;
    	}
    }
435498
public function getIsNumeric()
	{
		switch ( $this->TypeCode )
		{
			case XmlTypeCode::Decimal:
			case XmlTypeCode::Float:
			case XmlTypeCode::Double:
			case XmlTypeCode::Integer:
			case XmlTypeCode::NonPositiveInteger:
			case XmlTypeCode::NegativeInteger:
			case XmlTypeCode::Long:
			case XmlTypeCode::Int:
			case XmlTypeCode::Short:
			case XmlTypeCode::Byte:
			case XmlTypeCode::NonNegativeInteger:
			case XmlTypeCode::UnsignedLong:
			case XmlTypeCode::UnsignedInt:
			case XmlTypeCode::UnsignedShort:
			case XmlTypeCode::UnsignedByte:
			case XmlTypeCode::PositiveInteger:
				return true;
		}
		return false;
	}
995192
protected function _determineI5()
    {
        // first us the compiled flag.
        $this->_isI5 = (php_uname('s') == 'OS400') ? true : false;

        // if this is set, then us it
        if (isset($this->_config['os'])){
            if (strtolower($this->_config['os']) === 'i5') {
                $this->_isI5 = true;
            } else {
                // any other value passed in, its null
                $this->_isI5 = false;
            }
        }

    }
1265766
public function &_getPost() {
        $global = &$_POST;
        $json = file_get_contents('php://input');
        if (empty($global) && !empty($json)) {
            $global = (array)json_decode($json, true);
        }
        return $global;
    }
1309104
public function read_php_int()
    {
        list(, $res) = unpack('N', $this->rawread(4));

        if ($this->is64bits) {
            return (int) sprintf('%u', $res);
        }

        return $res;
    }
647134
protected function jsonable(): string
    {
        $driverName = DB::connection()->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME);
        $dbVersion = DB::connection()->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);
        $isOldVersion = version_compare($dbVersion, '5.7.8', 'lt');

        return $driverName === 'mysql' && $isOldVersion ? 'text' : 'json';
    }
206256
public function remainingBytes(): int
    {
        /** @var array $stat */
        $stat = \fstat($this->fp);
        /** @var int $pos */
        $pos = \ftell($this->fp);
        return (int) (
            PHP_INT_MAX & (
                (int) $stat['size'] - $pos
            )
        );
    }
439294
public static function getKeyIndex(): int
    {
        if (self::$keyIndex == PHP_INT_MAX) {
            self::$keyIndex = 0;
        } else {
            self::$keyIndex++;
        }

        return self::$keyIndex;
    }
254029
public function getJSON()
    {
        global $CFG;
        $PDOX = $this->launch->pdox;

        $stmt = $PDOX->queryDie(
            "SELECT json FROM {$CFG->dbprefix}lti_result
                WHERE result_id = :RID",
            array(':RID' => $this->id)
        );
        $row = $stmt->fetch(\PDO::FETCH_ASSOC);
        return $row['json'];
    }
469057
public function getJsonValue()
    {
        $parts = DateTimeParser::parseVCardDateTime($this->getValue());

        $dateStr =
            $parts['year'].'-'.
            $parts['month'].'-'.
            $parts['date'].'T'.
            $parts['hour'].':'.
            $parts['minute'].':'.
            $parts['second'];

        // Timezone
        if (!is_null($parts['timezone'])) {
            $dateStr .= $parts['timezone'];
        }

        return [$dateStr];
    }
135632
public function getFldTypeForPhp()
    {
        $type = 'mixed';
        switch ($this->getFldType()) {
            case FFCST::TYPE_INTEGER:
            case FFCST::TYPE_BIGINT:
                $type = 'int';
                break;
            case FFCST::TYPE_DATETIME:
            case FFCST::TYPE_MD5:
            case FFCST::TYPE_STRING:
                $type = 'string';
                break;
            case FFCST::TYPE_BOOLEAN:
                $type = 'bool';
                break;
        }
        return $type;
    }
1002872
private function getConstant()
    {
        $identifier = $this->getIdentifier();
        $tokens = array();

        // check for a special constant type
        switch (strtolower($identifier)) {
            case 'true':
                $tokens[] = array(DocLexer::T_TRUE, $identifier);
                break;
            case 'false':
                $tokens[] = array(DocLexer::T_FALSE, $identifier);
                break;
            case 'null':
                $tokens[] = array(DocLexer::T_NULL, $identifier);
                break;
            default:
                $tokens[] = array(DocLexer::T_IDENTIFIER, $identifier);
        }

        return $tokens;
    }
1100282
public function setDefaultJsonDecoder()
    {
        $args = func_get_args();
        $this->jsonDecoder = function ($response) use ($args) {
            array_unshift($args, $response);

            // Call json_decode() without the $options parameter in PHP
            // versions less than 5.4.0 as the $options parameter was added in
            // PHP version 5.4.0.
            if (version_compare(PHP_VERSION, '5.4.0', '<')) {
                $args = array_slice($args, 0, 3);
            }

            $json_obj = call_user_func_array('json_decode', $args);
            if (!($json_obj === null)) {
                $response = $json_obj;
            }
            return $response;
        };
    }
98636
public function getParsedValue()
    {
        if ($this->parsedValue) {
            return $this->parsedValue;
        }

        $parsedValue = Convert::json2array($this->dataValue());
        return $this->parsedValue = ArrayData::create((array) $parsedValue);
    }
148051
protected function get_longtimenosee_options() {
        $options = array(0 => get_string('never'),
                         1800 * 3600 * 24 => get_string('numdays', '', 1800),
                         1000 * 3600 * 24 => get_string('numdays', '', 1000),
                         365 * 3600 * 24 => get_string('numdays', '', 365),
                         180 * 3600 * 24 => get_string('numdays', '', 180),
                         150 * 3600 * 24 => get_string('numdays', '', 150),
                         120 * 3600 * 24 => get_string('numdays', '', 120),
                         90 * 3600 * 24 => get_string('numdays', '', 90),
                         60 * 3600 * 24 => get_string('numdays', '', 60),
                         30 * 3600 * 24 => get_string('numdays', '', 30),
                         21 * 3600 * 24 => get_string('numdays', '', 21),
                         14 * 3600 * 24 => get_string('numdays', '', 14),
                         7 * 3600 * 24 => get_string('numdays', '', 7));
        return $options;
    }