AW: [PHP-DEV] Namespace resolution

2007-12-10 Thread Matthias Pigulla
> -Ursprüngliche Nachricht- > Von: Sam Barrow [mailto:[EMAIL PROTECTED] > Gesendet: Montag, 10. Dezember 2007 22:48 > An: internals@lists.php.net > Betreff: [PHP-DEV] Namespace resolution > > Ok, it's supposed to be this way right? If i define a custom class in > the global namespace cal

Re: [PHP-DEV] PHP 5.3 bug or changed feature??

2007-12-10 Thread Frank M. Kromann
Hi Marcus, Will there be another way to do this or will they only be accessible from the object? - Frank > Hello Rob, > > this is intended. The 5.2 solution is just a hack and returns a wrong > result in the first place. The hack was however introduced to make > development easier. Now with 5

[PHP-DEV] Namespace resolution

2007-12-10 Thread Sam Barrow
Ok, it's supposed to be this way right? If i define a custom class in the global namespace called "myClass" and I'm in another namespace, I can only access it using ::myClass, not just myClass (without the colons)? Seems to me that it should check the local namespace and then the global, but it onl

Re: [PHP-DEV] question regarding type hinting parameters of php functions (array_slice)

2007-12-10 Thread Steph Fox
Both are now on http://bugs.php.net/bug.php?id=43541. Ignore the first of the three, it breaks when the length param isn't passed. I'm going offline before I say anything else stupid :) - Steph - Original Message - From: "Steph Fox" <[EMAIL PROTECTED]> To: "Stanislav Malyshev" <[EMAIL

Re: [PHP-DEV] RFC: Arguments (and suggestions) against the current implementation of namespaces

2007-12-10 Thread Sam Barrow
Agreed. I don't see any point in this limitation. As for confusion, debugging would not be too hard (just echo __NAMESPACE__), or brackets would solve that problem. On Mon, 2007-12-10 at 16:59 -0300, Martin Alterisio wrote: > 2007/12/10, Martin Alterisio <[EMAIL PROTECTED]>: > > > > > > > c) If br

Re: [PHP-DEV] PHP 5.3 bug or changed feature??

2007-12-10 Thread Marcus Boerger
Hello Rob, this is intended. The 5.2 solution is just a hack and returns a wrong result in the first place. The hack was however introduced to make development easier. Now with 5.3 we were able to change the API and coudl apply the solution that was first developed in HEAD. marcus Sunday, Dece

Re: [PHP-DEV] question regarding type hinting parameters of php functions (array_slice)

2007-12-10 Thread Steph Fox
So it's better to check for == 0? What's the difference? Is an IS_NULL check slower? No, it's not slower, but it makes no sense to compare variable value to a type constant. Even if coincidentally constant value is the same one you need to compare to. OK, so if I clean up those patches and r

Re: [PHP-DEV] question regarding type hinting parameters of php functions (array_slice)

2007-12-10 Thread Steph Fox
It builds without complaint and works as expected - what am I missing? IS_NULL is variable type. length is variable value. So it's better to check for == 0? What's the difference? Is an IS_NULL check slower? - Steph -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http:/

Re: [PHP-DEV] RFC: Arguments (and suggestions) against the current implementation of namespaces

2007-12-10 Thread Martin Alterisio
2007/12/10, Martin Alterisio <[EMAIL PROTECTED]>: > > > > c) If bracketed namespaces are a no-go, consider the possibility of > > > declaring the full name of the namespaced element in its definition: > > > > Which would lead to people routinely mixing different namespaces inside > > one file. Bad

Re: [PHP-DEV] question regarding type hinting parameters of php functions (array_slice)

2007-12-10 Thread Stanislav Malyshev
So it's better to check for == 0? What's the difference? Is an IS_NULL check slower? No, it's not slower, but it makes no sense to compare variable value to a type constant. Even if coincidentally constant value is the same one you need to compare to. -- Stanislav Malyshev, Zend Software Arch

Re: [PHP-DEV] question regarding type hinting parameters of php functions (array_slice)

2007-12-10 Thread Stanislav Malyshev
It builds without complaint and works as expected - what am I missing? IS_NULL is variable type. length is variable value. -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http://www.zend.com/ (408)253-8829 MSN: [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development M

Re: [PHP-DEV] question regarding type hinting parameters of php functions (array_slice)

2007-12-10 Thread Steph Fox
if (ZEND_NUM_ARGS() >= 3 && Z_TYPE_P(length_param) != IS_NULL) { +convert_to_long(length_param); Isn't convert_to_long non-separating one? I think the variable supposed to be separated before conversion, so convert_to_long_ex (and zval **) would be in place. Hm you're probably ri

Re: [PHP-DEV] RFC: Arguments (and suggestions) against the current implementation of namespaces

2007-12-10 Thread Martin Alterisio
2007/12/10, Martin Alterisio <[EMAIL PROTECTED]>: > > > > 2) Using :: as namespace separator generates ambiguity > > > > Would that be 20th reincarnation of "let's find weirdest namespace > > separator" thread? :) > > > Please no. Just find the right one. > PS: Wasn't : (one colon) used as namespa

Re: [PHP-DEV] question regarding type hinting parameters of php functions (array_slice)

2007-12-10 Thread Stanislav Malyshev
if (ZEND_NUM_ARGS() >= 3 && Z_TYPE_P(length_param) != IS_NULL) { +convert_to_long(length_param); Isn't convert_to_long non-separating one? I think the variable supposed to be separated before conversion, so convert_to_long_ex (and zval **) would be in place. +if (length == I

Re: [PHP-DEV] RFC: Arguments (and suggestions) against the current implementation of namespaces

2007-12-10 Thread Martin Alterisio
2007/12/10, Stanislav Malyshev <[EMAIL PROTECTED]>: > > > All namespace access should be explicit: > > Consequence: nobody uses namespaces, as it's too annoying. Putting $this-> and self:: is annoying , that didn't stop anybody from using objects in PHP. > b) Name aliasing with use should only g

Re: [PHP-DEV] question regarding type hinting parameters of php functions (array_slice)

2007-12-10 Thread Steph Fox
The manual kind of skirts around it: "If length is given and is positive, then the sequence will have that many elements in it. If length is given and is negative then the sequence will stop that many elements from the end of the array. If it is omitted, then the sequence will have everything

Re: [PHP-DEV] question regarding type hinting parameters of php functions (array_slice)

2007-12-10 Thread Stanislav Malyshev
There's an IS_NULL check... if (ZEND_NUM_ARGS() >= 3 && Z_TYPE_P(length_param) != IS_NULL) { If Z_TYPE_P(length_param) is 0, it's not NULL because it has something in it. If length_param were of type long and had a value of 0, it would be NULL. Ouch... Now I see. Is there anybody using

Fw: [PHP-DEV] question regarding type hinting parameters of php functions (array_slice)

2007-12-10 Thread Steph Fox
If Z_TYPE_P(length_param) is 0, it's not NULL because it has something in it. Bleh... but you know what I mean :) -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Arguments (and suggestions) against the current implementation of namespaces

2007-12-10 Thread Stanislav Malyshev
a) Introduce a special name to refer to the current namespace (as self:: works for the current class). namespace:: > All namespace access should be explicit: Consequence: nobody uses namespaces, as it's too annoying. b) Name aliasing with use should only generate namespaces aliases: See n

Re: [PHP-DEV] question regarding type hinting parameters of php functions (array_slice)

2007-12-10 Thread Steph Fox
Right, that's what "l" parameter spec is doing, doesn't it? Why convert it manually? Because it doesn't know the difference between NULL and 0 if it's a long. And why this difference is important in array_slice()? I don't see anything in manual that says anything about NULLs. Could you explai

[PHP-DEV] RFC: Arguments (and suggestions) against the current implementation of namespaces

2007-12-10 Thread Martin Alterisio
1) Lack of cohesiveness of name resolution rules Why is this an argument against: name resolution rules with namespaces change completely the way names are resolved in PHP. How does it affects: this breaks the explicitness of names in PHP. It will affect code debugging and review. Example: Su

[PHP-DEV] PHP 6 Bug Summary Report

2007-12-10 Thread internals
PHP 6 Bug Database summary - http://bugs.php.net Num Status Summary (63 total including feature requests) ===[*General Issues]== 26771 Suspended register_tick_funtions crash under threaded webservers 43408 Open get_called_class n

[PHP-DEV] PHP 4 Bug Summary Report

2007-12-10 Thread internals
PHP 4 Bug Database summary - http://bugs.php.net Num Status Summary (625 total including feature requests) ===[*Compile Issues]== 43389 Open configure ignoring --without-cdb flag ===[Apa