Am 20.01.2015 um 16:42 schrieb Rowan Collins: > Given the ability to write foreach ( $foo as $key => $value ), I'm not > sure adding a variant syntax of for ( $key in $foo ) has that much value > for PHP.
I totally agree with you here. The only real reason why Javascript has a for-in operation that iterates over object properties is the lack of non-integer keys in Javascript arrays. For PHP iterating over object properties is a very rare case IMHO. So I would stick with foreach for that case. Kind regards, Dennis Birkholz -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php