[PHP-DEV] Unsetting loop variables at the end of the loop

2009-12-27 Thread Mike Wacker
PHP's documentation for foreach states that if you iterate by reference [foreach ($ii as $i) ...], you should unset $i after the loop. $i still points to the last element of the array - updating $i or reusing it will update the last element of the array. In short, why doesn't PHP

Re: [PHP-DEV] Unsetting loop variables at the end of the loop

2009-12-27 Thread Adam Harvey
2009/12/27 Mike Wacker mwac...@cornellsun.com: PHP's documentation for foreach states that if you iterate by reference [foreach ($ii as $i) ...], you should unset $i after the loop.  $i still points to the last element of the array - updating $i or reusing it will update the last element of

Re: [PHP-DEV] PHP6's future

2009-12-27 Thread Mike Wacker
Chris Stockton wrote: Hello, On Mon, Nov 16, 2009 at 6:13 PM, Kalle Sommer Nielsen ka...@php.net wrote: But what is every ones input on the matter of attempting to boost PHP6's development? I'm willing to give my part in whatever I can to help getting up on the feet to get this ball rolling.

Re: [PHP-DEV] Unsetting loop variables at the end of the loop

2009-12-27 Thread Mike Wacker
Adam Harvey wrote: 2009/12/27 Mike Wacker mwac...@cornellsun.com: PHP's documentation for foreach states that if you iterate by reference [foreach ($ii as $i) ...], you should unset $i after the loop. $i still points to the last element of the array - updating $i or reusing it will update the

Re: [PHP-DEV] Unsetting loop variables at the end of the loop

2009-12-27 Thread Ferenc Kovacs
On Sun, Dec 27, 2009 at 3:11 PM, Mike Wacker mwac...@cornellsun.com wrote: Adam Harvey wrote: 2009/12/27 Mike Wacker mwac...@cornellsun.com: PHP's documentation for foreach states that if you iterate by reference [foreach ($ii as $i) ...], you should unset $i after the loop.  $i still

[PHP-DEV] Are there zend classes hidden from php?

2009-12-27 Thread Hans-Peter Oeri
Hi! As some already know, I'm using the holidays to prepare a proposal for error handling in extensions (https://saintcyr.oeri.ch/trac/php-intl/wiki/ErrorHandling). Digging through many zend internals, I wonder if there is a possibility to use a common ancestor class without cluttering

Re: [PHP-DEV] Unsetting loop variables at the end of the loop

2009-12-27 Thread Rasmus Lerdorf
We can't just randomly reset variables based on their scope in this one specific case. If we are going to fix this, it should be done by introducing a way to do proper local scope variables. Resetting a reference simply because it is convenient in this one case would be completely inconsistent.

Re: [PHP-DEV] Unsetting loop variables at the end of the loop

2009-12-27 Thread Mike Wacker
Rasmus Lerdorf wrote: We can't just randomly reset variables based on their scope in this one specific case. If we are going to fix this, it should be done by introducing a way to do proper local scope variables. Resetting a reference simply because it is convenient in this one case would be

[PHP-DEV] Test OpenGrok installation (LXR replacement?)

2009-12-27 Thread Michael Maclean
Hi, Since LXR hasn't been updating since the shift to SVN, I've been investigating bringing it back. Today, though, I came across OpenGrok which appears to be a far more modern implementation of the same thing, using Lucene as the back end. I've set up a test installation of it at

Re: [PHP-DEV] Test OpenGrok installation (LXR replacement?)

2009-12-27 Thread Pierre Joye
hi, On Sun, Dec 27, 2009 at 10:17 PM, Michael Maclean mich...@no-surprises.co.uk wrote: Hi, Since LXR hasn't been updating since the shift to SVN, I've been investigating bringing it back. Today, though, I came across OpenGrok which appears to be a far more modern implementation of the same

Re: [PHP-DEV] Unsetting loop variables at the end of the loop

2009-12-27 Thread jvlad
Rasmus Lerdorf ras...@lerdorf.com wrote in message news:4b3785ac.2000...@lerdorf.com... We can't just randomly reset variables based on their scope in this one specific case. If we are going to fix this, it should be done by introducing a way to do proper local scope variables. Resetting a

Re: [PHP-DEV] Unsetting loop variables at the end of the loop

2009-12-27 Thread Rasmus Lerdorf
jvlad wrote: Rasmus Lerdorf ras...@lerdorf.com wrote in message news:4b3785ac.2000...@lerdorf.com... We can't just randomly reset variables based on their scope in this one specific case. If we are going to fix this, it should be done by introducing a way to do proper local scope variables.

Re: [PHP-DEV] Test OpenGrok installation (LXR replacement?)

2009-12-27 Thread Philip Olson
On Dec 27, 2009, at 1:17 PM, Michael Maclean wrote: Hi, Since LXR hasn't been updating since the shift to SVN, I've been investigating bringing it back. Today, though, I came across OpenGrok which appears to be a far more modern implementation of the same thing, using Lucene as the back

Re: [PHP-DEV] Unsetting loop variables at the end of the loop

2009-12-27 Thread jvlad
No chance. No .ini settings, and I still maintain it is inconsistent. So, if I write this: $a = array(1); $b = 0; $c = $b; $c = $a[0]; Would you agree that $b should be 1 at this point? If so, just because I rewrite that code like this: $a = array(1); $b = 0; $c = $b; foreach($a

Re: [PHP-DEV] Unsetting loop variables at the end of the loop

2009-12-27 Thread Rasmus Lerdorf
jvlad wrote: $a = array(1); $b = 0; $c = $b; foreach($a as $c); Now you are arguing that $b should not be 1? The two pieces of code are identical It's just a nightmare example. I wonder have you ever see anything like this in real life? Could you please let me see it too, for example

Re: [PHP-DEV] Unsetting loop variables at the end of the loop

2009-12-27 Thread Rasmus Lerdorf
jvlad wrote: Meanwhile I see that php core developers and Evangelist propose the way of evolving difficulties. For example, I used split() for many many years. Now it throws a warning and it appears that this function will be removed soon. I have to rewrite all my scripts and replace