RE: [PHP-DEV] __clone() implementation

2004-02-02 Thread Steph
> I just had a look at zend_compile.c - it seems as if the variable name > $that was mandantory: > > [...] > || strcmp(CG(active_op_array)->arg_info[0].name, "that")!=0)) { > zend_error(E_COMPILE_ERROR, "The clone method > must be declared as __clone($that)"); > [...] > > Why sh

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Andi Gutmans
At 09:15 PM 2/2/2004 +0100, Ferdinand Beyer wrote: I like the new way very much but I dislike that PHP tells me how to name a function parameter. __set() and __get(), for instance, do not force fixed argument names either, do they? Some people use their own naming convention for parameters and will

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Stephane Drouard
== Quote from Ferdinand Beyer ([EMAIL PROTECTED])'s article > I like the new way very much but I dislike that PHP tells me how to > name a function parameter. __set() and __get(), for instance, do not > force fixed argument names either, do they? I agree. Anyway, do we now need $that to be passed

[PHP-DEV] CVS Account Request: adventure

2004-02-02 Thread Vladimir Butchny
programmers to php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Ferdinand Beyer
On 2 Feb 2004 at 21:57, Andi Gutmans wrote: > Because it's a good way of retrieving the to-be-cloned object (no behind > the scenes magic), and in my opinion, it's cleaner because everyone's clone > functions will look the same and it'll make it easier to understand them. > Why do you care so

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Adam Maccabee Trachtenberg
On Mon, 2 Feb 2004, Andi Gutmans wrote: > At 02:42 PM 2/2/2004 -0500, George Schlossnagle wrote: > >If you force the parameter to be name $that, what's the point of requiring > >it to be passed at all? Seems analogous to having all methods be required > >to pass $this as their first parameter. >

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread George Schlossnagle
On Feb 2, 2004, at 2:57 PM, Andi Gutmans wrote: At 02:42 PM 2/2/2004 -0500, George Schlossnagle wrote: If you force the parameter to be name $that, what's the point of requiring it to be passed at all? Seems analogous to having all methods be required to pass $this as their first parameter. Bec

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Andi Gutmans
At 02:42 PM 2/2/2004 -0500, George Schlossnagle wrote: On Feb 2, 2004, at 2:39 PM, Andi Gutmans wrote: At 07:32 PM 2/2/2004 +0100, Ferdinand Beyer wrote: On 2 Feb 2004 at 14:36, Zeev Suraski wrote: > Clone methods must now be declared as follows: > function __clone($that) > { > } I just had a lo

Re: Fwd: Re: [PHP-DEV] Only variables or references can be returned by reference

2004-02-02 Thread Andi Gutmans
Without checking it more thoroughly, I think the former and the latter should work with both PHP 4 and PHP 5. If you want to be 100% certain then the latter will definitely work but I think we allowed the former in PHP 4 too (in a hackish way). Don't sue me if I'm wrong :) Andi At 12:05 PM 2/2

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread George Schlossnagle
On Feb 2, 2004, at 2:39 PM, Andi Gutmans wrote: At 07:32 PM 2/2/2004 +0100, Ferdinand Beyer wrote: On 2 Feb 2004 at 14:36, Zeev Suraski wrote: > Clone methods must now be declared as follows: > function __clone($that) > { > } I just had a look at zend_compile.c - it seems as if the variable name

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Andi Gutmans
At 06:49 PM 2/2/2004 +, Stephane Drouard wrote: == Quote from Zeev Suraski ([EMAIL PROTECTED])'s article > Both are valid points, and they both sound like the same problem from two > different angles. I think that the best approach would be to first do an > implicit clone (i.e., 'dumb' copy of

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Andi Gutmans
At 07:32 PM 2/2/2004 +0100, Ferdinand Beyer wrote: On 2 Feb 2004 at 14:36, Zeev Suraski wrote: > Clone methods must now be declared as follows: > function __clone($that) > { > } I just had a look at zend_compile.c - it seems as if the variable name $that was mandantory: [...] || strcmp(CG(active_

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Andi Gutmans
At 01:26 PM 2/2/2004 -0500, Adam Bregenzer wrote: On Mon, 2004-02-02 at 13:18, Stephane Drouard wrote: > Another idea for case 1 could be to be able to call parent::__clone > even if the class does not implement it and have the bit for bit copy > (but just for the base class). I also think a defaul

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Stephane Drouard
== Quote from Zeev Suraski ([EMAIL PROTECTED])'s article > Both are valid points, and they both sound like the same problem from two > different angles. I think that the best approach would be to first do an > implicit clone (i.e., 'dumb' copy of all of the elements), and then call > __clone(), ev

[PHP-DEV] Re: [PHP-CVS] cvs: php-src / NEWS /ext/pcre php_pcre.c php_pcre.h

2004-02-02 Thread Andrei Zmievski
On Sat, 31 Jan 2004, Moriyoshi Koizumi wrote: > moriyoshi Sat Jan 31 17:36:34 2004 EDT > > Modified files: > /php-src NEWS > /php-src/ext/pcre php_pcre.c php_pcre.h > Log: > - Fix bug #27103 (preg_split('//u') incorrectly splits UTF-8 strings into octets)

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Ferdinand Beyer
On 2 Feb 2004 at 14:36, Zeev Suraski wrote: > Clone methods must now be declared as follows: > function __clone($that) > { > } I just had a look at zend_compile.c - it seems as if the variable name $that was mandantory: [...] || strcmp(CG(active_op_array)->arg_info[0].name, "that")!=0)) {

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Adam Bregenzer
On Mon, 2004-02-02 at 13:18, Stephane Drouard wrote: > Another idea for case 1 could be to be able to call parent::__clone > even if the class does not implement it and have the bit for bit copy > (but just for the base class). I also think a default __clone method that does a bit for bit copy wou

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Zeev Suraski
At 20:18 02/02/2004, Stephane Drouard wrote: == Quote from Zeev Suraski ([EMAIL PROTECTED])'s article > Andi and I have revisited the __clone() implementation and must agree that > it wasn't quite right (mainly due to it not working with inheritance). > We have rewritten it now (major change!!!) be

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Ferdinand Beyer
On 2 Feb 2004 at 14:36, Zeev Suraski wrote: > Using clone directly is now done using > $replica = clone $src; > Clone methods must now be declared as follows: > function __clone($that) > { > } Finally! I've suggested this change several times before ([EMAIL PROTECTED]) but no one was interested

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Stephane Drouard
== Quote from Zeev Suraski ([EMAIL PROTECTED])'s article > Andi and I have revisited the __clone() implementation and must agree that > it wasn't quite right (mainly due to it not working with inheritance). > We have rewritten it now (major change!!!) because we didn't want PHP 5 to > be released w

Re: [PHP-DEV] __clone() implementation

2004-02-02 Thread Zeev Suraski
Stephane, Andi and I have revisited the __clone() implementation and must agree that it wasn't quite right (mainly due to it not working with inheritance). We have rewritten it now (major change!!!) because we didn't want PHP 5 to be released with a fundamentally flawed mechanism. Here's our co

Fwd: Re: [PHP-DEV] Only variables or references can be returned by reference

2004-02-02 Thread Daniel Convissor
Hi: This continues to slip between the cracks. Can someone please answer it? Thanks, --Dan - Forwarded message from Daniel Convissor <[EMAIL PROTECTED]> - From: Daniel Convissor <[EMAIL PROTECTED]> To: PHP Internals List <[EMAIL PROTECTED]> Date: Wed, 14 Jan 2004 14:46:25 -0500 Subjec

[PHP-DEV] Re: PHP5: Exception not correctly thown with __get, __set and __toString

2004-02-02 Thread Christian Schneider
Stephane Drouard wrote: > The following code does not work as expected: I think it is a very good thing to test these things and I think it should be turned into phpt tests and added to the distribution. - Chris -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http

[PHP-DEV] PHP5: Exception not correctly thown with __get, __set and __toString

2004-02-02 Thread Stephane Drouard
Hello, The following code does not work as expected: foo; print('[/test]'); // printed: bug ?> '/get' is not printed, so the throw statement is correctly executed, but '/test' is printed, so the exception is not correctly "propagated" to the caller. Note that the exception will be thrown later

[PHP-DEV] php_init_config zero length allocation

2004-02-02 Thread Eric Colinet
Hi, Included a patch that avoid a zero length allocation in php_init_config when: - A configuration line like --with-config-file-scan-dir=d:/local/etc is given - The directory specified doesn't contain any *.ini files Let me know if I have to create a bug entry for it before postin

Re: [PHP-DEV] Is compiling apache in worker mode unstable?(what if i am loading a library which is multithreaded?)

2004-02-02 Thread Rasmus Lerdorf
I don't understand the question. You can use a multithreaded library with PHP if you want. That doesn't have anything to do with Apache being threaded. Or do you mean that the library is guaranteed to be threadsafe? If so, you may be ok, but you have to be sure that every other library invol

Re: [PHP-DEV] Is compiling apache in worker mode unstable?(what if i am loading a library which is multithreaded?)

2004-02-02 Thread ashish b\\
what if i am loading a library which is multithreaded? Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:Yup On Mon, 2 Feb 2004, ashish b\ wrote: > hello , > is compiling Apache in worker mode really unstable for production purposes? > Is multithreaded mode of apache really unsafe? > > Doumentation of P

Re: [PHP-DEV] Is compiling apache in worker mode unstable?

2004-02-02 Thread Rasmus Lerdorf
Yup On Mon, 2 Feb 2004, ashish b\ wrote: > hello , > is compiling Apache in worker mode really unstable for production purposes? > Is multithreaded mode of apache really unsafe? > > Doumentation of PHP says > In case you wish to build a multithreaded version of Apache 2.0 you must ove

[PHP-DEV] Is compiling apache in worker mode unstable?

2004-02-02 Thread ashish b\\
hello , is compiling Apache in worker mode really unstable for production purposes? Is multithreaded mode of apache really unsafe? Doumentation of PHP says In case you wish to build a multithreaded version of Apache 2.0 you must overwrite the standard MPM-Module prefork either with wor