[PHP-DEV] Case sensitivity

2008-11-06 Thread Stan Vassilev | FM
NOTE: Continuing from thread "Call it: allow reserved words in a class or not?":

> As much as I'd love to see more case-sensitivity, I'm afraid it would
> break quite a lot of existing apps, according to Google Code.
> 
> http://www.google.com/codesearch?q=lang%3Aphp+%3D%5Cs%2AArray
> 
> -JD

It's worse than I thought, really out of the question for 5.x. 

Though I still think it's something we should consider for 6.0 as it's 
something we need to fix in the long term (and 6.0 already has breaks, such as 
strings used in binary operations need to be changed to binary strings). 

I can provide a short PHP script which can automatically fix the case of 
internal classes and keywords like array() in most source code out there.

We can test such automated porting scripts on samples collected from PEAR, 
Google Code and projects like Drupal, Joomla etc. to reduce side effects.

Regards, Stan Vassilev

Re: [PHP-DEV] Case sensitivity

2008-11-06 Thread Lukas Kahwe Smith


On 06.11.2008, at 18:46, Stan Vassilev | FM wrote:

NOTE: Continuing from thread "Call it: allow reserved words in a  
class or not?":



As much as I'd love to see more case-sensitivity, I'm afraid it would
break quite a lot of existing apps, according to Google Code.

http://www.google.com/codesearch?q=lang%3Aphp+%3D%5Cs%2AArray

-JD


It's worse than I thought, really out of the question for 5.x.

Though I still think it's something we should consider for 6.0 as  
it's something we need to fix in the long term (and 6.0 already has  
breaks, such as strings used in binary operations need to be changed  
to binary strings).


I can provide a short PHP script which can automatically fix the  
case of internal classes and keywords like array() in most source  
code out there.


We can test such automated porting scripts on samples collected from  
PEAR, Google Code and projects like Drupal, Joomla etc. to reduce  
side effects.



NO!

regards,
Lukas Kahwe Smith
[EMAIL PROTECTED]




--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Case sensitivity

2008-11-08 Thread Lester Caine

Lukas Kahwe Smith wrote:


On 06.11.2008, at 18:46, Stan Vassilev | FM wrote:

NOTE: Continuing from thread "Call it: allow reserved words in a class 
or not?":



As much as I'd love to see more case-sensitivity, I'm afraid it would
break quite a lot of existing apps, according to Google Code.

http://www.google.com/codesearch?q=lang%3Aphp+%3D%5Cs%2AArray

-JD


It's worse than I thought, really out of the question for 5.x.

Though I still think it's something we should consider for 6.0 as it's 
something we need to fix in the long term (and 6.0 already has breaks, 
such as strings used in binary operations need to be changed to binary 
strings).


I can provide a short PHP script which can automatically fix the case 
of internal classes and keywords like array() in most source code out 
there.


We can test such automated porting scripts on samples collected from 
PEAR, Google Code and projects like Drupal, Joomla etc. to reduce side 
effects.


NO!


Is that to any move to case sensitivity? Even if it is the tidiest way of 
plugging some of the holes in a clean UTF8 implementation via 6.0 where 
'lower' or 'upper' may produce different results?


Personally I've always worked with maintaining case - C++ dictates it - so 
it's natural to ensure that a case-sensitive search always provides the 
correct results. I'll even correct code that differs 


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Case sensitivity of require_once

2004-07-19 Thread Jakub Vrana
File a.php is required twice with this code on Windows:


Should I document this behavior or should patch similar to this be
applied?

Index: zend_execute.c
===
RCS file: /repository/Zend/Attic/zend_execute.c,v
retrieving revision 1.316.2.38
diff -u -r1.316.2.38 zend_execute.c
--- zend_execute.c  12 Jul 2004 17:47:32 -  1.316.2.38
+++ zend_execute.c  19 Jul 2004 08:48:44 -
@@ -2148,6 +2148,10 @@
file_handle.opened_path = 
estrndup(inc_filename->value.str.val, inc_filename->value.str.len);
}
 
+#ifdef ZEND_WIN32
+   zend_str_tolower(file_handle.opened_path, 
strlen(file_handle.opened_path));
+#endif
+
if (zend_hash_add(&EG(included_files), 
file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, 
sizeof(int), NULL)==SUCCESS) {
new_op_array = zend_compile_file(&file_handle, 
(EX(opline)->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) 
TSRMLS_CC);
zend_destroy_file_handle(&file_handle 
TSRMLS_CC);

-- 
Jakub Vrana

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Case sensitivity of require_once

2004-07-19 Thread Wez Furlong
Did you test require_once under PHP 5 yet?
(without your patch)

--Wez.

On Mon, 19 Jul 2004 10:56:02 +0200, Jakub Vrana <[EMAIL PROTECTED]> wrote:
> File a.php is required twice with this code on Windows:
>  require_once "a.php";
> require_once "A.php";
> ?>
> 
> Should I document this behavior or should patch similar to this be
> applied?
> 
> Index: zend_execute.c
> ===
> RCS file: /repository/Zend/Attic/zend_execute.c,v
> retrieving revision 1.316.2.38
> diff -u -r1.316.2.38 zend_execute.c
> --- zend_execute.c  12 Jul 2004 17:47:32 -  1.316.2.38
> +++ zend_execute.c  19 Jul 2004 08:48:44 -
> @@ -2148,6 +2148,10 @@
> file_handle.opened_path = 
> estrndup(inc_filename->value.str.val, inc_filename->value.str.len);
> }
> 
> +#ifdef ZEND_WIN32
> +   zend_str_tolower(file_handle.opened_path, 
> strlen(file_handle.opened_path));
> +#endif
> +
> if (zend_hash_add(&EG(included_files), 
> file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, 
> sizeof(int), NULL)==SUCCESS) {
> new_op_array = 
> zend_compile_file(&file_handle, 
> (EX(opline)->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) 
> TSRMLS_CC);
> zend_destroy_file_handle(&file_handle 
> TSRMLS_CC);
> 
> --
> Jakub Vrana
> 
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Case sensitivity of require_once

2004-07-19 Thread Antony Dovgal
On Mon, 19 Jul 2004 11:12:58 +0100
Wez Furlong <[EMAIL PROTECTED]> wrote:

> Did you test require_once under PHP 5 yet?
> (without your patch)

Yep.
http://lists.php.net/php.doc/969361918

---
WBR,
Antony Dovgal aka tony2001
[EMAIL PROTECTED] || [EMAIL PROTECTED]

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Case sensitivity of require_once

2004-07-19 Thread Jakub Vrana
Wez Furlong wrote:
> Did you test require_once under PHP 5 yet?
> (without your patch)
This behavior is PHP 4 specific.

Antony Dovgal wrote:
> http://lists.php.net/php.doc/969361918
The problem is not that the file isn't included at all. The problem is
that the file is included twice.

Jakub Vrana

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Case sensitivity of require_once

2004-07-19 Thread Antony Dovgal
On Mon, 19 Jul 2004 14:45:12 +0200
Jakub Vrana <[EMAIL PROTECTED]> wrote:

> Wez Furlong wrote:
> > Did you test require_once under PHP 5 yet?
> > (without your patch)
> This behavior is PHP 4 specific.
> 
> Antony Dovgal wrote:
> > http://lists.php.net/php.doc/969361918
> The problem is not that the file isn't included at all. The problem is
> that the file is included twice.

That's right. I said exactly the same.
Dunno if it's a problem or not, but it does ignore case.

---
WBR,
Antony Dovgal aka tony2001
[EMAIL PROTECTED] || [EMAIL PROTECTED]

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Case sensitivity of require_once

2004-07-19 Thread Michele Locati
There's another thing you should note: under Windows it is possible to specify file 
names in two ways: in the expanded (normal) way, and in a short way (8.3 file naming 
compatible).

For example:
C:\Program Files\SomeFileName.ext

could be specified also as
C:\PROGRA~1\SOMEFI~1.EXT
or even
C:\PROGRA~1\SomeFileName.ext
or
C:\Program Files\SOMEFI~1.EXT

If there exists two files, say "SomeFileNameA.ext" and "SomeFileNameB.ext", they could 
be called also "SOMEFI~1.EXT" and "SOMEFI~2.EXT"

Thank you for the whole great project you're bringing to us!

Ciao
Michele


*** In risposta al seguente messaggio  ***

Il 19/07/2004 alle 11:12 Wez Furlong ha scritto:

>Did you test require_once under PHP 5 yet?
>(without your patch)
>
>--Wez.
>
>On Mon, 19 Jul 2004 10:56:02 +0200, Jakub Vrana <[EMAIL PROTECTED]> wrote:
>> File a.php is required twice with this code on Windows:
>> > require_once "a.php";
>> require_once "A.php";
>> ?>
>>
>> Should I document this behavior or should patch similar to this be
>> applied?
>>
>> Index: zend_execute.c
>> ===
>> RCS file: /repository/Zend/Attic/zend_execute.c,v
>> retrieving revision 1.316.2.38
>> diff -u -r1.316.2.38 zend_execute.c
>> --- zend_execute.c  12 Jul 2004 17:47:32 -  1.316.2.38
>> +++ zend_execute.c  19 Jul 2004 08:48:44 -
>> @@ -2148,6 +2148,10 @@
>> file_handle.opened_path =
>estrndup(inc_filename->value.str.val, inc_filename->value.str.len);
>> }
>>
>> +#ifdef ZEND_WIN32
>> +
>zend_str_tolower(file_handle.opened_path, strlen(file_handle.opened_path));
>> +#endif
>> +
>> if
>(zend_hash_add(&EG(included_files), file_handle.opened_path,
>strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int),
>NULL)==SUCCESS) {
>> new_op_array =
>zend_compile_file(&file_handle,
>(EX(opline)->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) 
>TSRMLS_CC);
>>
>zend_destroy_file_handle(&file_handle TSRMLS_CC);
>>
>> --
>> Jakub Vrana
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Case sensitivity of require_once

2004-07-19 Thread Stanislav Malyshev
ML>>There's another thing you should note: under Windows it is possible to
ML>>specify file names in two ways: in the expanded (normal) way, and in a
ML>>short way (8.3 file naming compatible).

I think there's a function in Win32 API which brings all these forms to 
common base. 

-- 
Stanislav Malyshev, Zend Products Engineer   
[EMAIL PROTECTED]  http://www.zend.com/ +972-3-6139665 ext.115

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Case sensitivity of require_once

2004-07-19 Thread Wez Furlong
I think we're already using it in TSRM in PHP 5, which is why I asked
for someone to confirm it there.

--Wez.

On Mon, 19 Jul 2004 15:55:58 +0300 (IDT), Stanislav Malyshev
<[EMAIL PROTECTED]> wrote:
> ML>>There's another thing you should note: under Windows it is possible to
> ML>>specify file names in two ways: in the expanded (normal) way, and in a
> ML>>short way (8.3 file naming compatible).
> 
> I think there's a function in Win32 API which brings all these forms to
> common base.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Case sensitivity of require_once

2004-07-19 Thread Paul G

- Original Message - 
From: "Stanislav Malyshev" <[EMAIL PROTECTED]>
To: "Michele Locati" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, July 19, 2004 8:55 AM
Subject: Re: [PHP-DEV] Case sensitivity of require_once


> ML>>There's another thing you should note: under Windows it is possible to
> ML>>specify file names in two ways: in the expanded (normal) way, and in a
> ML>>short way (8.3 file naming compatible).
>
> I think there's a function in Win32 API which brings all these forms to
> common base.

you are thinking of GetShortPathName(). not bringing it to the same base per
se, but perfectly usable in this case. GetFileInformationByHandle() and the
nFileIndex{High,Low} elements of the returned struct could possibly be a
more elegant way of doing this. afair, the latter does not require mucking
with nt native api, though an extended version of the same call does. don't
shoot me, this is from memory ;)

paul

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Case sensitivity of require_once

2004-07-19 Thread Andi Gutmans
Very strange. We do a GetLongPathName() in virtual_file_ex() which opens 
the file. Can you see if it's reach that piece of code?
Andi

At 02:55 PM 7/19/2004 +0200, Michele Locati wrote:
There's another thing you should note: under Windows it is possible to 
specify file names in two ways: in the expanded (normal) way, and in a 
short way (8.3 file naming compatible).

For example:
C:\Program Files\SomeFileName.ext
could be specified also as
C:\PROGRA~1\SOMEFI~1.EXT
or even
C:\PROGRA~1\SomeFileName.ext
or
C:\Program Files\SOMEFI~1.EXT
If there exists two files, say "SomeFileNameA.ext" and 
"SomeFileNameB.ext", they could be called also "SOMEFI~1.EXT" and 
"SOMEFI~2.EXT"

Thank you for the whole great project you're bringing to us!
Ciao
Michele
*** In risposta al seguente messaggio  ***
Il 19/07/2004 alle 11:12 Wez Furlong ha scritto:
>Did you test require_once under PHP 5 yet?
>(without your patch)
>
>--Wez.
>
>On Mon, 19 Jul 2004 10:56:02 +0200, Jakub Vrana <[EMAIL PROTECTED]> wrote:
>> File a.php is required twice with this code on Windows:
>> 
>> require_once "a.php";
>> require_once "A.php";
>> ?>
>>
>> Should I document this behavior or should patch similar to this be
>> applied?
>>
>> Index: zend_execute.c
>> ===
>> RCS file: /repository/Zend/Attic/zend_execute.c,v
>> retrieving revision 1.316.2.38
>> diff -u -r1.316.2.38 zend_execute.c
>> --- zend_execute.c  12 Jul 2004 17:47:32 -  1.316.2.38
>> +++ zend_execute.c  19 Jul 2004 08:48:44 -
>> @@ -2148,6 +2148,10 @@
>> file_handle.opened_path =
>estrndup(inc_filename->value.str.val, inc_filename->value.str.len);
>> }
>>
>> +#ifdef ZEND_WIN32
>> +
>zend_str_tolower(file_handle.opened_path, strlen(file_handle.opened_path));
>> +#endif
>> +
>> if
>(zend_hash_add(&EG(included_files), file_handle.opened_path,
>strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int),
>NULL)==SUCCESS) {
>> new_op_array =
>zend_compile_file(&file_handle,
>(EX(opline)->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZE 
ND_REQUIRE) TSRMLS_CC);
>>
>zend_destroy_file_handle(&file_handle TSRMLS_CC);
>>
>> --
>> Jakub Vrana
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php