Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52871 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39397 invoked from network); 3 Jun 2011 20:38:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jun 2011 20:38:04 -0000 Authentication-Results: pb1.pair.com header.from=mjpelmear@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=mjpelmear@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: mjpelmear@gmail.com X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:50086] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/1D-08509-B2649ED4 for ; Fri, 03 Jun 2011 16:38:04 -0400 Received: by bwz18 with SMTP id 18so2351432bwz.29 for ; Fri, 03 Jun 2011 13:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=qsd/BALBRzGaZbTUawpRpp9tXlNTHoFH6L0gi5SS8e0=; b=q1HO8f9VgSOWKNNolTp2zvYBhQDmjH71GlXp+go39Nzm2H3ueb58FoP78NVIrqoR3A h7ZWv701luO4ku8VSbUwmwQgFFOqgV/s75v+8YEZd/8CtCQ/0HHvUT0Bjf3p35jhrsN0 tc087imc1+/ENl9Rk8dpCcIgVyOe8ty7aKFI8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Ool6RZvPK42O7791nKrMQXHOwxp0U+mDlu3Fqz7DBZ23VFF3ADLqtR1ue3lZUJoNIN O1M41lF/61weCH+NK9yYQoJMCvcf4X0xxpP/jL2KcRL5tPDho5XAE6KrdM2S81YtonXa 6smAX7gsIvS8cpMCc7FwiyKGSZmTk5ZFBZ/m8= MIME-Version: 1.0 Received: by 10.204.20.70 with SMTP id e6mr2362238bkb.145.1307133480213; Fri, 03 Jun 2011 13:38:00 -0700 (PDT) Received: by 10.205.82.201 with HTTP; Fri, 3 Jun 2011 13:38:00 -0700 (PDT) Date: Fri, 3 Jun 2011 16:38:00 -0400 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: DOMNode::getAttribute() From: mjpelmear@gmail.com (Matt Pelmear) Hello, I discovered today that the DOMNode::getAttribute() function (which is undocumented on the php site) returns an empty string if the requested attribute doesn't exist in the node. From the source: if (value == NULL) { RETURN_EMPTY_STRING(); } else { RETVAL_STRING((char *)value, 1); xmlFree(value); } Seems to me that it should return NULL. (That's what libxml does, apparently.) Does anyone know of a particular reason it returns an empty string instead? Does anyone know of a particular reason it is not documented? (I'd be happy to document and provide the ridiculously simple patch of returning NULL...) Thanks, -Matt