|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-01-28 00:38 UTC] danack@php.net
[2019-01-28 00:53 UTC] jerry at jmweb dot net
[2019-01-28 01:08 UTC] stas@php.net
-Package: PHP Language Specification
+Package: Scripting Engine problem
[2019-01-28 11:40 UTC] girgias@php.net
-Summary: foreach just over keys
+Summary: foreach iteration over keys without
values
-Operating System: n/a
+Operating System:
[2019-01-28 11:40 UTC] girgias@php.net
[2019-01-28 16:24 UTC] jerry at jmweb dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 19:00:01 2025 UTC |
Description: ------------ Too often I do something like: foreach( $array as $key => $noop ) { // do something with $key only } Why not use array_keys? Well, I guess to avoid the overhead of calling a function. It would be super if we could simply do: foreach( $array as $key => null ) { // do something with $key only } I am not 100% set on using null, but I will let the community decide on the specifics.