Re: [PHP-DEV] toString() and Object #ID

2007-07-04 Thread Stanislav Malyshev
The first is cleared before the second is instantiated. Oh, that clears everything, please ignore my previous post. Still, don't you think this is a bit misleading? IMHO, new object should always have the unique id(or hash in terms of spl)... That's a valid point, reusing IDs might be not a go

Re: [PHP-DEV] toString() and Object #ID

2007-07-04 Thread Stanislav Malyshev
Not quite. It creates a hash of an object, so two objects with the same data yield the same hashes: var_dump(spl_object_hash(new stdClass()), spl_object_hash(new stdClass())); here's the code of spl_object_hash: len = spprintf(&hash, 0, "%p:%d", Z_OBJ_HT_P(obj), Z_OBJ_HANDLE_P(obj));

Re: [PHP-DEV] Simple Namespace Proposal

2007-07-04 Thread Stanislav Malyshev
I take it that when I include or conditionally include, the included file has its own namespace, if one is declared in that file. What if I do not declare a namespace in an include file? Does this file "inherit" the current namespace or are the contents added to the global namespace? No, namespa

Re: [PHP-DEV] Simple Namespace Proposal

2007-07-04 Thread Stanislav Malyshev
Does this mean that a project like Phorum could declare the same namespace at the top of all of our files and all the code in those files would exist in the same namespace? Theoretically, yes, that's the idea. Practically there could be some problems with variable names - right now the patch d

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard basic_functions.c streamsfuncs.c streamsfuncs.h /ext/standard/tests/file include_userstream_001.phpt include_userstream_002.phpt /main main.c p

2007-07-04 Thread Ilia Alshanetsky
Dmitry, From your explanation it sounds like there should be any issues with putting this patch into the next 5.2.X release. On 4-Jul-07, at 2:31 AM, Dmitry Stogov wrote: The core_globals structure is allocated/initialized in PHP itself (main.c). No one extension does it. Thanks. Dmitry

RE: [PHP-DEV] Simple Namespace Proposal

2007-07-04 Thread Dmitry Stogov
> > It is possible to use the same namespace in several PHP files. > > Does this mean that a project like Phorum could declare the same > namespace at the top of all of our files and all the code in > those files > would exist in the same namespace? Exactly. > common.php: > namespace Phorum

Re: [PHP-DEV] Simple Namespace Proposal

2007-07-04 Thread Stefan Priebsch
Hi Dmitry, it would be great to have namespaces in PHP6, as these always longer-getting classnames are somewhat annoying. I don't want to start a discussion about the separator (I think there was one before), but: > > 6) Calls to qualified functions are resolved at run-time. Call to > > "A::B::f

Re: [PHP-DEV] Simple Namespace Proposal

2007-07-04 Thread Brian Moon
It is possible to use the same namespace in several PHP files. Does this mean that a project like Phorum could declare the same namespace at the top of all of our files and all the code in those files would exist in the same namespace? common.php: list.php: Or, would list.php have to im

Re: [PHP-DEV] php curl extension

2007-07-04 Thread Antony Dovgal
On 04.07.2007 17:24, David Coallier wrote: On 7/4/07, Antony Dovgal <[EMAIL PROTECTED]> wrote: On 02.07.2007 16:42, Andrey A. Belashkov wrote: > On 02 Jul 2007 at 12:06:08, Antony Dovgal wrote: >> On 30.06.2007 09:54, Andrey A. Belashkov wrote: >>> Hello! >>> Can you add please CURLOPT_PRIVATE a

Re: [PHP-DEV] php curl extension

2007-07-04 Thread David Coallier
On 7/4/07, Antony Dovgal <[EMAIL PROTECTED]> wrote: On 02.07.2007 16:42, Andrey A. Belashkov wrote: > On 02 Jul 2007 at 12:06:08, Antony Dovgal wrote: >> On 30.06.2007 09:54, Andrey A. Belashkov wrote: >>> Hello! >>> Can you add please CURLOPT_PRIVATE and CURLINFO_PRIVATE text parameters >>> to c

Re: [PHP-DEV] php curl extension

2007-07-04 Thread Antony Dovgal
On 02.07.2007 16:42, Andrey A. Belashkov wrote: On 02 Jul 2007 at 12:06:08, Antony Dovgal wrote: On 30.06.2007 09:54, Andrey A. Belashkov wrote: Hello! Can you add please CURLOPT_PRIVATE and CURLINFO_PRIVATE text parameters to curl extension for php like CURLOPT_URL ? In which cURL version we

Re: [PHP-DEV] [PATCH] ext/snmp/snmp.c memleaks

2007-07-04 Thread Antony Dovgal
Are you sure this part of the patch is correct? if (st == SNMP_CMD_GET) { if ((pdu = snmp_fix_pdu(response, SNMP_MSG_GET)) != NULL) { + snmp_free_pdu(res

[PHP-DEV] Simple Namespace Proposal

2007-07-04 Thread Dmitry Stogov
Hi, Please review the following concept and patch for php6... http://dev.daylessday.org/diff/ns-06.diff.txt http://dev.daylessday.org/diff/tests.tar.gz Main assumption of the model is that the problem that we are to solve is the problem of the very long class names in PHP libraries. We would not

Re: [PHP-DEV] toString() and Object #ID

2007-07-04 Thread Lars Schultz
Oh, that clears everything, please ignore my previous post. Still, don't you think this is a bit misleading? IMHO, new object should always have the unique id(or hash in terms of spl)... I don't like it either;) But it does exactly what Stanislav Malyshev described: it hashes the "tuple of C po

Re: [PHP-DEV] toString() and Object #ID

2007-07-04 Thread Pavel Shevaev
The first is cleared before the second is instantiated. Oh, that clears everything, please ignore my previous post. Still, don't you think this is a bit misleading? IMHO, new object should always have the unique id(or hash in terms of spl)... -- Best regards, Pavel -- PHP Internals - PHP Runti

Re: [PHP-DEV] toString() and Object #ID

2007-07-04 Thread Pavel Shevaev
Not quite. It creates a hash of an object, so two objects with the same data yield the same hashes: var_dump(spl_object_hash(new stdClass()), spl_object_hash(new stdClass ())); Folks, is this really wanted behavior? Because if so, why does the following result in the same hash as well(PHP-5.2.1

Re: [PHP-DEV] toString() and Object #ID

2007-07-04 Thread Lars Schultz
Not quite. It creates a hash of an object, so two objects with the same data yield the same hashes: var_dump(spl_object_hash(new stdClass()), spl_object_hash(new stdClass())); I don't believe that it's data dependent. Rather in your example the same memory-space is used for those two objects

Re: [PHP-DEV] toString() and Object #ID

2007-07-04 Thread David Zülke
Am 01.07.2007 um 21:18 schrieb Pavel Shevaev: Again see mail archive for why. That said the name appears to be the best option already. Oh, yes, you're right spl_object_hash does its job and does it very well, there's really no point rename it(or make an alias) into object_get_id. I should hav