getValue(); } if (is_null($arg)) { return 'NULL'; } if (is_bool($arg)) { return $arg ? 'TRUE': 'FALSE'; } if (is_int($arg)) { return strval($arg); } if (is_float($arg)) { return strval($arg); } if (is_string($arg)) { return '\'' . str_replace('\'', '\\\'', $arg) . '\''; } throw new InvalidArgumentException("Bad argument type."); } }