public static function guessAndCastValue($value, &$type = '')
    {
        // matched values array
        $matchesTrue = ['true','yes','ja'];
        $matchesFalse = ['false','no','nein'];
        $matchesNull = ['null'];

        if (in_array(strtolower($value), $matchesTrue)) {
            $type = 'boolean';

            return true;
        } elseif (in_array(strtolower($value), $matchesFalse)) {
            $type = 'boolean';

            return false;
        } elseif (in_array(strtolower($value), $matchesNull)) {
            $type = 'null';

            return null;
        } else {
            // check for numerical string and cast if necessary
            if (strstr($value, ',') !== false) {
                $checkStr = str_replace(',', '.', $value);
                if (is_numeric($checkStr)) {
                    $value = $checkStr;
                }
            }
            //numbers
            if (is_numeric($value) && strstr($value, '.') !== false && substr_count($value, '.') == 1) { //float
                $type = 'float';

                return (float) $value;
            } elseif (is_numeric($value)) { //int
                $type = 'integer';

                return (int) $value;
            } else {
                $type = 'string';

                return $value;
            }
        }
    }