Re: [PHP-DEV] Re: named function arguments

2003-10-23 Thread Sebastian Bergmann
netcat wrote: > Named parameters - i think is very good idea. Named parameters are commonly implemented using an associated array in PHP: 'bar', 'bar' => 'foo' ) ); ?> -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/

[PHP-DEV] Re: named function arguments

2003-10-23 Thread Christian Schneider
netcat wrote: Named parameters - i think is very good idea. I know i would use them. I'm really not sure about the correct syntax for it though. Important for our application would be that it works with varargs, as we have a lot of (potential) parameters of which you normally only give a small su

[PHP-DEV] Re: named function arguments (was: Proposal: Dangling comma in function call parameters)

2003-10-23 Thread netcat
Christian Schneider wrote: [snip] I was also thinking of proposing named parameters, i.e. basically removing the need for array() in foo(array('style' => 'hot', 'size' => 42)); but I guess that'll be even more controversial :-) Named parameters - i think is very good idea. I know i would use t

Re: [PHP-DEV] overload extension

2003-10-23 Thread LingWitt
This may be where the problem: zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args); Would this do the trick? zend_get_parameters_array(ZEND_NUM_ARGS(), args); On Wednesday, Oct 22, 2003, at 20:47 America/New_York, Alan Knowles wrote: There is already a bug report on it, however It sounds like

[PHP-DEV] [PATCH] Memory corruption when freeing an object zval twice

2003-10-23 Thread Vesselin Atanasov
Hello. There is a bug in PHP5 code which shows when an object destructor tries to access the zval for the object being destroyed. Here is a sample code: What happens is that upon program shutdown the symtable is cleared the refcount for gA zval goes to zero and the zval destructor is called. It

RE: [PHP-DEV] database driver: no more rows

2003-10-23 Thread David Gillies
I use syntax like while(($dbrow=mysql_fetch_assoc($dbresult))!==false) in several hundred locations in a production ap. If PHP breaks my code then it won't get used. Simple as that. Anyway, unless I'm missing something, isn't the preferred PHP5 way to handle this via exceptions? Certainly the mysq

RE: [PHP-DEV] database driver: no more rows

2003-10-23 Thread Andi Gutmans
At 03:02 PM 10/23/2003 +0200, Lukas Smith wrote: mysql_error() will return you the last error over and over again. Shouldn't the mysql extension clear the last error on a successful query? Andi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsu

Re: [PHP-DEV] Proposal: Dangling comma in function call parameters

2003-10-23 Thread Christian Schneider
Andi Gutmans wrote: In this case I don't see the same advantage and I see a disadvantage in readability and the possibility for PHP to give such an empty argument a meaning in future (although I doubt that'll happen). Ok, here the real-world example from our HTML generation toolkit: table(

Re: [PHP-DEV] database driver: no more rows

2003-10-23 Thread Dirkjan Ochtman
> While I think about it: There would be one solution that wouldn't break BC: > adding a function that would clear the last error. Then you could manually > clear an error after you have read it. I could see that mysql_reset_error() would be useful. + 1! Regards, Manuzhai -- PHP Internals - PH

RE: [PHP-DEV] database driver: no more rows

2003-10-23 Thread Lukas Smith
> From: Cesare D'Amico [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 23, 2003 3:27 PM > > Alle 15:02, giovedì 23 ottobre 2003, Lukas Smith ha scritto: > > > . run query 1 > > > . check if q1 worked > > > . run query 2 > > > . check if q2 worked > > > . if q1 worked -> fetch data > > > > > >

Re: [PHP-DEV] database driver: no more rows

2003-10-23 Thread Cesare D'Amico
Alle 15:02, giovedì 23 ottobre 2003, Lukas Smith ha scritto: > > . run query 1 > > . check if q1 worked > > . run query 2 > > . check if q2 worked > > . if q1 worked -> fetch data > > > > ...and so on. > > > > Perhaps I'm missing something, but I can't see a real issue here. > > Yeah, you are missi

RE: [PHP-DEV] database driver: no more rows

2003-10-23 Thread Lukas Smith
> From: Cesare D'Amico [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 23, 2003 2:59 PM > Alle 00:18, giovedì 23 ottobre 2003, Lukas Smith ha scritto: > > run query that works > > run query that doesn't > > > > now when you fetch the rows of the first query you will usually > > determine if yo

Re: [PHP-DEV] database driver: no more rows

2003-10-23 Thread Cesare D'Amico
Alle 00:18, giovedì 23 ottobre 2003, Lukas Smith ha scritto: > run query that works > run query that doesn't > > now when you fetch the rows of the first query you will usually > determine if you hit the end if the result set by checking if you > don't get an array returned > > if you don't get an

Re: [PHP-DEV] database driver: no more rows

2003-10-23 Thread Derick Rethans
On Wed, 22 Oct 2003, Ard Biesheuvel wrote: > > Err .. I don't agree. > > Null means no data > > False means error. > > Maybe historically (PHP-wise) it does. > But the way I see it, every fetch() can 'fail' for two reasons: an > expected well-defined reason (eof), and an unexpected undefined rea

RE: [PHP-DEV] database driver: no more rows

2003-10-23 Thread Derick Rethans
On Wed, 22 Oct 2003, Lukas Smith wrote: > > I wouldn't mind such a change myself, however what about all the > > installations > > where people do while (*fetch_row() !== false) ? > > Yeah ... php5 would be a good time to make this change. Not really, this is just too much of a BC break to me.