Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65947 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52646 invoked from network); 19 Feb 2013 13:35:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2013 13:35:54 -0000 Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.171 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.216.171 mail-qc0-f171.google.com Received: from [209.85.216.171] ([209.85.216.171:51938] helo=mail-qc0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 72/86-17768-6BF73215 for ; Tue, 19 Feb 2013 08:35:50 -0500 Received: by mail-qc0-f171.google.com with SMTP id d1so2514608qca.2 for ; Tue, 19 Feb 2013 05:35:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=2y5L/RO4p/Rw6nzeoq7Cjevy2Kt+bvHxmYg9rYRpfHM=; b=fgwHRA26chRXcwZNPtyKc8kQhTAVbydbp5uhcqndM+gdBNsjQbs1Ya6oU2aG/6Y9Sk RvjtuoM/n6zujc58pyzzsmIrxZBF64nsISCxw6K/Jj4nN9LrOGq06xINDRKEl0ouF8QP GLmoRSUXnK2oyYtYL+inB8zFZrivVyqr3wsCvYZL4hmFMH/qicHN3Ete427OpWoV9qTU 6TFcGhg5giAYYhgys1sDc6YEy6Hs8kmJ55pvsDnDFBHdvBUoyXsk5Pr6T6Tb3jXhUwr1 emf7nqtrvfCzjixEZ9abupT+eBTTj815BIhO70WsAKIrgukAxch6FgwPmM8D/0PqYDCo 3R4A== X-Received: by 10.49.127.101 with SMTP id nf5mr7217721qeb.20.1361280947766; Tue, 19 Feb 2013 05:35:47 -0800 (PST) MIME-Version: 1.0 Sender: ekneuss@gmail.com Received: by 10.49.133.42 with HTTP; Tue, 19 Feb 2013 05:35:27 -0800 (PST) In-Reply-To: References: Date: Tue, 19 Feb 2013 14:35:27 +0100 X-Google-Sender-Auth: u6YuULJ-AhXP77jS_OflcdRwIRI Message-ID: To: Derick Rethans Cc: Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=047d7b6dc0bc54c57704d613eb0e Subject: Re: [PHP-DEV] [RFC] Allow non-scalar keys in foreach From: colder@php.net (Etienne Kneuss) --047d7b6dc0bc54c57704d613eb0e Content-Type: text/plain; charset=UTF-8 I think the warning can stay as-is, __toString is not necessarily available so casting to string in all occasions is probably not what we want. I'm glad somebody could take this over and provide a complete patch, thanks Nikita! On Tue, Feb 19, 2013 at 2:25 PM, Derick Rethans wrote: > On Tue, 19 Feb 2013, Nikita Popov wrote: > > > This RFC proposes to remove the type-restrictions on Iterator keys > > used in foreach: > > > > https://wiki.php.net/rfc/foreach-non-scalar-keys > > > > I took over Levi's RFC and added a patch for it. > > Under "Open Questions" you write: > > > What should be done with the keys that are valid in the iterator, but > not in > > the array? I think the best approach would be to just set the array keys > with > > the exact same semantics as PHP would do (i.e. with all casts and > warnings). > > Would __toString be called in case the key was an object? > > cheers, > Derick > > -- > http://derickrethans.nl | http://xdebug.org > Like Xdebug? Consider a donation: http://xdebug.org/donate.php > twitter: @derickr and @xdebug > Posted with an email client that doesn't mangle email: alpine > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Etienne Kneuss http://www.colder.ch --047d7b6dc0bc54c57704d613eb0e--