Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77245 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64347 invoked from network); 16 Sep 2014 12:39:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2014 12:39:24 -0000 Authentication-Results: pb1.pair.com header.from=are.you.winning@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=are.you.winning@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.53 as permitted sender) X-PHP-List-Original-Sender: are.you.winning@gmail.com X-Host-Fingerprint: 209.85.216.53 mail-qa0-f53.google.com Received: from [209.85.216.53] ([209.85.216.53:62587] helo=mail-qa0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CE/2E-64534-A7F28145 for ; Tue, 16 Sep 2014 08:39:22 -0400 Received: by mail-qa0-f53.google.com with SMTP id n8so5488471qaq.12 for ; Tue, 16 Sep 2014 05:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=4eXEgrm838YNuJyQRoNBgCjnKiUqCi7QYNmhJUgtbmY=; b=WYYMcbuK34bTJZHkok+0uxZZG0OW4zbyCT6SfWXLyU08mI+5xKVecsiGQpYsRrSn2i X+J/SgHsU3WmdttK38MZw4qPJ/k1Ieq/NTI7ZWl+dxMhmDZYUWCBngTgyVJPPjhJCmay zTO3XQ9x63puNmzOM71CUWjvO3iM4LSm14+iiovIZtqY/AWeFuNN2HYYqe+wFx0kdc9h hdFLpx39UT1F213o3fh6FknHMcSWS5WZsypENtdYbGYDk5qrZJiivWGvRUcBT2qPlX7h WsckdqxAN1L1qmyCPIfK3wudketW7UIJxurFwW1ZyN/18Q8vnO0zO/mFPDfPd28IAPaL lqlg== MIME-Version: 1.0 X-Received: by 10.140.34.52 with SMTP id k49mr14591633qgk.100.1410871159434; Tue, 16 Sep 2014 05:39:19 -0700 (PDT) Sender: are.you.winning@gmail.com Received: by 10.141.28.193 with HTTP; Tue, 16 Sep 2014 05:39:19 -0700 (PDT) Date: Tue, 16 Sep 2014 13:39:19 +0100 X-Google-Sender-Auth: u6i0F8_FssZJ3IZ6nje98IVhjQY Message-ID: To: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: DOMDocument::load* return values From: daverandom@php.net (Chris Wright) All The return value of the DOMDocument::load* family of methods currently varies depending on whether it was invoked statically or as an instance method - when invoked on an instance it returns bool, and when invoked statically it returns the implicitly created instance or FALSE on error. Invoking statically also emits an E_STRICT, because it is an instance method (see: http://3v4l.org/JIRQn). As a result, I regularly find myself writing something like this: $doc = new DOMDocument; $doc->loadXML($xml); I propose that the success return value be changed to the instance regardless of how it was invoked, which would allow one to write this: $doc = (new DOMDocument)->loadXML($xml); ...which has the same effect as invoking it statically, without provoking the E_STRICT. This would be a very minor BC break (it would only break code that compares the return value with === TRUE, the failure return value would be unaffected). Thoughts, anyone? Would a minor change such as this require an RFC? Thanks, Chris