Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77413 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16974 invoked from network); 21 Sep 2014 11:39:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Sep 2014 11:39:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=florian@margaine.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=florian@margaine.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain margaine.com from 209.85.223.177 cause and error) X-PHP-List-Original-Sender: florian@margaine.com X-Host-Fingerprint: 209.85.223.177 mail-ie0-f177.google.com Received: from [209.85.223.177] ([209.85.223.177:53765] helo=mail-ie0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/00-16580-8F8BE145 for ; Sun, 21 Sep 2014 07:39:37 -0400 Received: by mail-ie0-f177.google.com with SMTP id x19so5713232ier.8 for ; Sun, 21 Sep 2014 04:39:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=nmQVXF+VgJSPGYZ7AiPjyf0BSBtEXDXrS0cZLQ5kDB4=; b=P4k0ICa1J0Z49VNkygOBwANCkfVqPCOIcUkWtfWP6b6bAroxRddQ+w42Kj55qk8LHx GIeVEj8xCOChg49nIviLvNUeEgw7ZK4pToCrryzi5x0QQIVb5CChOW6N0PwzPETNdU7t BWMWHGqFVRsCY0oo9oHgX6Yiq7SbHpeIIibgtqpvnO1OPSmtLLKO+7l0ch11lQBFgx4w t4TChMH5YMhfU+Y3fP996hHBMqv8jGhZIykF6KoTOD8aKsn7M9ukHfhdl/9vlMsCwEW3 sbpvvpMiLa1Q2GFDQE/soSG0Ov+c8b/20UaBOA44sMDFdSXm9X9j4qa3a8L8yFi8GI5o ZsaQ== X-Gm-Message-State: ALoCoQnq/E0jNWZ4o0qq6SjkifnjmPggD3ss0JNkLeTJPtQWqy0O4txKgP8pz0Xickp1H1bfEp5G X-Received: by 10.50.117.9 with SMTP id ka9mr7893992igb.38.1411299574354; Sun, 21 Sep 2014 04:39:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.41.20 with HTTP; Sun, 21 Sep 2014 04:39:14 -0700 (PDT) X-Originating-IP: [89.92.205.106] Date: Sun, 21 Sep 2014 13:39:14 +0200 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=089e01161710cd3433050391c987 Subject: Request #67949 DOMNodeList should implement ArrayAccess From: florian@margaine.com (Florian Margaine) --089e01161710cd3433050391c987 Content-Type: text/plain; charset=UTF-8 Hi list, The request is so that we can do this: $html = <<data HTML; $doc = new DOMDocument; $doc->loadHTML($html); var_dump($doc->getElementsByTagName('div')[0]->textContent); I started implementing this on my branch ( https://github.com/Ralt/php-src/tree/issue-67949), but then I was thinking... ::offsetSet and ::offsetUnset don't really make sense in this context. From what I understand, SimpleXML does some magic to make it work without implementing ArrayAccess. I think it's cleaner to use ArrayAccess and to throw errors on ::offsetSet and ::offsetUnset, but I'd like internals' opinion on this. Regards, *Florian Margaine* --089e01161710cd3433050391c987--