What is the use of "unicode.semantics" in PHP 6?

php.internals

Jani Taskinen

19 years ago
During Derick's talk about PHP 6 at PHP Vikinger, I started to wonder what exactly was the reasoning behind adding something like "unicode.semantics" option. Derick didn't remember, neither did I. Apparently it's another one of these "register_globals" or "magic_quotes_*" directives we'll remove in PHP 7? :D I mean, if PHP 6 is about unicode, why upgrade to PHP 6 and disable it? Just stay with PHP 5 then.. --Jani

Scott MacVicar

19 years ago
I have to agree, I think giving the ability to toggle Unicode support is going to add more confusion and grief for application developers, especially with it being PHP_INI_SYSTEM. The reason for the option as far I can remember was to do with performance when you were working with binary strings, this may no longer be valid. Scott Jani Taskinen wrote:

Pierre Joye

19 years ago
Hi Jani, On 6/14/07, Jani Taskinen <jani.taskinen@sci.fi> wrote:
> During Derick's talk about PHP 6 at PHP Vikinger, I started to wonder > what exactly was the reasoning behind adding something like > "unicode.semantics" option. Derick didn't remember, neither did I. > > Apparently it's another one of these "register_globals" or > "magic_quotes_*" directives we'll remove in PHP 7? :D > > I mean, if PHP 6 is about unicode, why upgrade to PHP 6 and disable it? > Just stay with PHP 5 then..
Apparently there is a certain amount of users (undefined/undefinable masses) who like to use PHP6 new features (?) without unicode. The arguments were about the incompatibilities (the zend fatal errors are likely to cause more troubles :) and performance. I was one who likes to have a single mode: unicode. --Pierre

Derick Rethans

19 years ago
On Thu, 14 Jun 2007, Pierre wrote:
> Hi Jani, > > On 6/14/07, Jani Taskinen <jani.taskinen@sci.fi> wrote: > > During Derick's talk about PHP 6 at PHP Vikinger, I started to wonder > > what exactly was the reasoning behind adding something like > > "unicode.semantics" option. Derick didn't remember, neither did I. > > > > Apparently it's another one of these "register_globals" or > > "magic_quotes_*" directives we'll remove in PHP 7? :D > > > > I mean, if PHP 6 is about unicode, why upgrade to PHP 6 and disable it? > > Just stay with PHP 5 then.. > > Apparently there is a certain amount of users (undefined/undefinable > masses) who like to use PHP6 new features (?) without unicode.
I guess you're using the "?" to point out that there are no new features (besides Unicode)? :)
> The arguments were about the incompatibilities (the zend fatal errors > are likely to cause more troubles :) and performance. > > I was one who likes to have a single mode: unicode.
Yup, here as well. regards, Derick

Pierre Joye

19 years ago
On 6/14/07, Derick Rethans <derick@php.net> wrote:
> On Thu, 14 Jun 2007, Pierre wrote: > > > Hi Jani, > > > > On 6/14/07, Jani Taskinen <jani.taskinen@sci.fi> wrote: > > > During Derick's talk about PHP 6 at PHP Vikinger, I started to wonder > > > what exactly was the reasoning behind adding something like > > > "unicode.semantics" option. Derick didn't remember, neither did I. > > > > > > Apparently it's another one of these "register_globals" or > > > "magic_quotes_*" directives we'll remove in PHP 7? :D > > > > > > I mean, if PHP 6 is about unicode, why upgrade to PHP 6 and disable it? > > > Just stay with PHP 5 then.. > > > > Apparently there is a certain amount of users (undefined/undefinable > > masses) who like to use PHP6 new features (?) without unicode. > > I guess you're using the "?" to point out that there are no new features > (besides Unicode)? :)
You guessed right :) There will be new features besides unicode (and related, like unicode text mode in stream or unicode FS) but nothing that will not work with php5 as well, as far as I can see (and know for "my" extensions). --Pierre

Tomas Kuliavas

19 years ago
>> During Derick's talk about PHP 6 at PHP Vikinger, I started to wonder >> what exactly was the reasoning behind adding something like >> "unicode.semantics" option. Derick didn't remember, neither did I. >> >> Apparently it's another one of these "register_globals" or >> "magic_quotes_*" directives we'll remove in PHP 7? :D >> >> I mean, if PHP 6 is about unicode, why upgrade to PHP 6 and disable it? >> Just stay with PHP 5 then.. > > Apparently there is a certain amount of users (undefined/undefinable > masses) who like to use PHP6 new features (?) without unicode. The > arguments were about the incompatibilities (the zend fatal errors are > likely to cause more troubles :) and performance. > > I was one who likes to have a single mode: unicode.
Changes made in PHP6 unicode_semantics=on are not backwards compatible with PHP4 and PHP5. Same scripts (for example, reading string in bytes) work in PHP4 and PHP5. They won't work in unicode_semantics=on. PHP6 places very strict checks on string variables. PHP script writers are not used to it. If developers have to maintain compatibility with PHP6 unicode_semantics=on, they will have to do that in separate code branch. PHP6 code will break with E_PARSE errors in older PHP installs. I don't like it, because I can't turn that thing off. Interpreter is trying to outsmart me without knowing my coding environment. If you need multibyte string support, you have mbstring extension. If you want unicode function and variable names, you should remember that they won't work in international coding environment. International developers must use something they all understand. It means ASCII and English function names. Will you understand purpose of the function, when function name is written in Russian, Chinese or Arabic?
-- Tomas

Rasmus Lerdorf

19 years ago
Jani Taskinen wrote:
> During Derick's talk about PHP 6 at PHP Vikinger, I started to wonder > what exactly was the reasoning behind adding something like > "unicode.semantics" option. Derick didn't remember, neither did I. > > Apparently it's another one of these "register_globals" or > "magic_quotes_*" directives we'll remove in PHP 7? :D > > I mean, if PHP 6 is about unicode, why upgrade to PHP 6 and disable it? > Just stay with PHP 5 then..
That's exactly why we need the toggle. We don't want to encourage people to stay with an older version. We have enough trouble getting people from 4 to 5 today, why build in an automatic excuse for people to stay with 5 when all development moves to 6? If all their PHP 5-based code works flawlessly in PHP 6, the adoption of PHP 6 will be quicker. -Rasmus

Pierre Joye

19 years ago
On 6/14/07, Rasmus Lerdorf <rasmus@lerdorf.com> wrote:
> Jani Taskinen wrote: > > During Derick's talk about PHP 6 at PHP Vikinger, I started to wonder > > what exactly was the reasoning behind adding something like > > "unicode.semantics" option. Derick didn't remember, neither did I. > > > > Apparently it's another one of these "register_globals" or > > "magic_quotes_*" directives we'll remove in PHP 7? :D > > > > I mean, if PHP 6 is about unicode, why upgrade to PHP 6 and disable it? > > Just stay with PHP 5 then.. > > That's exactly why we need the toggle. We don't want to encourage > people to stay with an older version. We have enough trouble getting > people from 4 to 5 today, why build in an automatic excuse for people to > stay with 5 when all development moves to 6? If all their PHP 5-based > code works flawlessly in PHP 6, the adoption of PHP 6 will be quicker.
As a side note, we had the same thoughts about php5, it did not work. --Pierre

Rasmus Lerdorf

19 years ago
Pierre wrote:
> On 6/14/07, Rasmus Lerdorf <rasmus@lerdorf.com> wrote: >> Jani Taskinen wrote: >> > During Derick's talk about PHP 6 at PHP Vikinger, I started to wonder >> > what exactly was the reasoning behind adding something like >> > "unicode.semantics" option. Derick didn't remember, neither did I. >> > >> > Apparently it's another one of these "register_globals" or >> > "magic_quotes_*" directives we'll remove in PHP 7? :D >> > >> > I mean, if PHP 6 is about unicode, why upgrade to PHP 6 and disable it? >> > Just stay with PHP 5 then.. >> >> That's exactly why we need the toggle. We don't want to encourage >> people to stay with an older version. We have enough trouble getting >> people from 4 to 5 today, why build in an automatic excuse for people to >> stay with 5 when all development moves to 6? If all their PHP 5-based >> code works flawlessly in PHP 6, the adoption of PHP 6 will be quicker. > > As a side note, we had the same thoughts about php5, it did not work.
Not really. Nothing in PHP 5 was designed to break compatibility with PHP 4. However in PHP 6 there are just some things that cannot be made backward compatible in Unicode mode without being completely inconsistent with how Unicode should work. -Rasmus

Pierre Joye

19 years ago
Hi Rasmus, On 6/14/07, Rasmus Lerdorf <rasmus@lerdorf.com> wrote:
> > As a side note, we had the same thoughts about php5, it did not work. > > Not really. Nothing in PHP 5 was designed to break compatibility with > PHP 4.
In theory, I agree with you here, we were very careful about BC. However in practice, there was a few troubles which made a smooth migration (like running php4 code directly in php5) a little pain until 5.1. But then the new fatal errors brought other troubles... However my point was about making design choices to minimize the migration momentum. It did not work for PHP5. It worked (I can be wrong, it is too old) well for php3 to php4 because there was really a huge improvement in the core language (begin of "OO" support, even if it was not perfect) and its features in general (extensions). I fear that Unicode is not that appealing for almost all users, even those who actually need it, they already rely on mb_string and other home made solutions. But I tend to be too much realistic/pessimist. --Pierre

Johannes Schlueter

19 years ago
Hi Jani, On Thu, 2007-06-14 at 16:53 +0300, Jani Taskinen wrote:
> During Derick's talk about PHP 6 at PHP Vikinger, I started to wonder > what exactly was the reasoning behind adding something like > "unicode.semantics" option. Derick didn't remember, neither did I.
The reason was to "keep BC"
> Apparently it's another one of these "register_globals" or > "magic_quotes_*" directives we'll remove in PHP 7? :D > > I mean, if PHP 6 is about unicode, why upgrade to PHP 6 and disable
it?
> Just stay with PHP 5 then..
- The ini Setting changes the behaviour of the code in a quite drastic way. This is even worse then magic_quotes which could be fixed by using some prepending file removing/adding slashes depending on the setting. - The UG(unicode) checks in the code make maintenance way harder. - This feature doesn't bring BC - there will still be enough BC breaks. - I guess we're adding a few thousand UG(unicode) checks during each request which certainly cost a bit performance Conclusion: Let's remove that damn setting. johannes

Rasmus Lerdorf

19 years ago
Johannes Schlüter wrote:
> - This feature doesn't bring BC - there will still be enough BC > breaks.
Name one, please. The idea is that there shouldn't be any, so if you have found one, please file a bug. -Rasmus

Stanislav Malyshev

19 years ago
> I mean, if PHP 6 is about unicode, why upgrade to PHP 6 and disable it?
To get late static binding and namespaces, of course ;)
-- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/

Cristian Rodriguez

19 years ago
On 6/14/07, Jani Taskinen <jani.taskinen@sci.fi> wrote:
> I mean, if PHP 6 is about unicode, why upgrade to PHP 6 and disable it?
I think if unicode.semantics remains PHP_INI_SYSTEM it is useless as most users ( people that runs in shared hosting servers) will simple not be able to turn it on, as well hosting companies will keep it off because turning it on will break applications. So, either make it at least PHP_INI_PER_DIR or remove it all togeteher ( aka.. always behave like unicode.semantics= On)

Rasmus Lerdorf

19 years ago
Cristian Rodriguez wrote:
> On 6/14/07, Jani Taskinen <jani.taskinen@sci.fi> wrote: > >> I mean, if PHP 6 is about unicode, why upgrade to PHP 6 and disable it? > > I think if unicode.semantics remains PHP_INI_SYSTEM it is useless as > most users ( people that runs in shared hosting servers) will simple > not be able to turn it on, as well hosting companies will keep it off > because turning it on will break applications. > > So, either make it at least PHP_INI_PER_DIR or remove it all togeteher > ( aka.. always behave like unicode.semantics= On)
Those same shared hosting companies would never upgrade to PHP 6 if we forced unicode semantics on them breaking legacy apps and that would force us to maintain PHP 5 forever. We recognize that some people are simply not going to make the effort to make their apps unicode aware anytime soon and that fact could easily splinter the project across the unicode line. If that unicode line becomes synonymous with PHP 5 vs. PHP 6 we are in trouble. I would much rather have people on the same codebase so we can move everyone ahead on other features and keep the unicode vs. non-unicode battle to a configuration setting within that one codebase. I really don't want to get into the situation where we are backporting features to PHP 5 a couple of years from now. And we obviously did consider making it PER_DIR, but that is really complicated. The current cries that the unicode.semantics check is complicating code are dull compared to what they would be if we allowed a single process to switch back and forth potentially on the same scripts. -Rasmus

Peter Brodersen

19 years ago
On Fri, 15 Jun 2007 02:55:16 +0100, in php.internals rasmus@lerdorf.com (Rasmus Lerdorf) wrote:
>Those same shared hosting companies would never upgrade to PHP 6 if we >forced unicode semantics on them breaking legacy apps and that would >force us to maintain PHP 5 forever.
On the other hand I feel a bit sad that if I want to write perfectly good portable PHP 6 code that is only intended to work under PHP 6 I still have to check for different configuration settings. I think we were really close to get out of the if(get_magic_quotes_gpc()) "requirement" but now it has been replaced with a new one. Even if a developer would write (portable) PHP 6 only code. Of course, configurations could contain a lot of other obscure settings that might have influence on the script but none as widespread as the difference in magic_quotes settings.
-- - Peter Brodersen

Rasmus Lerdorf

19 years ago
Peter Brodersen wrote:
> On Fri, 15 Jun 2007 02:55:16 +0100, in php.internals > rasmus@lerdorf.com (Rasmus Lerdorf) wrote: > >> Those same shared hosting companies would never upgrade to PHP 6 if we >> forced unicode semantics on them breaking legacy apps and that would >> force us to maintain PHP 5 forever. > > On the other hand I feel a bit sad that if I want to write perfectly > good portable PHP 6 code that is only intended to work under PHP 6 I > still have to check for different configuration settings. > > I think we were really close to get out of the > if(get_magic_quotes_gpc()) "requirement" but now it has been replaced > with a new one. Even if a developer would write (portable) PHP 6 only > code. > > > Of course, configurations could contain a lot of other obscure > settings that might have influence on the script but none as > widespread as the difference in magic_quotes settings.
But this is no different from writing code that will work on both PHP 5 and PHP 6. The only difference is that instead of checking for PHP 5 you will be checking for Unicode. Like I said, we don't want the Unicode decision to be synonymous with PHP 5 vs. PHP 6 because then the non-Unicode folks will never get the benefits of the non-Unicode improvements in PHP 6 and we would be forced to support PHP 5 for a lot longer. We really stretch our already thing resources in order to support multiple branches, so anything we can do to get as many people as possible onto the same codebase helps us a lot. -Rasmus

Peter Brodersen

19 years ago
On Tue, 19 Jun 2007 07:26:57 -0700, in php.internals rasmus@lerdorf.com (Rasmus Lerdorf) wrote:
>> I think we were really close to get out of the >> if(get_magic_quotes_gpc()) "requirement" but now it has been replaced >> with a new one. Even if a developer would write (portable) PHP 6 only >> code. > >But this is no different from writing code that will work on both PHP 5 >and PHP 6. The only difference is that instead of checking for PHP 5 >you will be checking for Unicode.
Yeah, but that's pretty much the problem :) If I want to create code that has to work under different versions of PHP then it's a no-brainer that I have to check for different settings (and maybe even create userland functions to emulate native functions in later versions of PHP). The more BC the code has to maintain the more settings does one have to check for. But if I want to code to one specific version of PHP it bothers me that I even here has to take in consideration that PHP still comes in different flavors, even under one version. If the unicode setting would be on for most of the installments I might just create assumptions on this setting - pretty much the same way that I have dared to assume that magic_quotes_runtime and magic_quotes_sybase is off (as I have never encountered them on in generel setups such as webhosting companies). But my fear is that exactly the webhosting companies would end up with different settings and might even have to create two products for their customer: "Do you want the PHP 6 with unicode setting on or off?". I'm just worried that PHP 6 is the new NULL: PHP6 != PHP6 :-)
-- - Peter Brodersen

Pierre Joye

19 years ago
On 6/19/07, Rasmus Lerdorf <rasmus@lerdorf.com> wrote:
> But this is no different from writing code that will work on both PHP 5 > and PHP 6. The only difference is that instead of checking for PHP 5 > you will be checking for Unicode. Like I said, we don't want the > Unicode decision to be synonymous with PHP 5 vs. PHP 6 because then the > non-Unicode folks will never get the benefits of the non-Unicode > improvements in PHP 6 and we would be forced to support PHP 5 for a lot > longer. We really stretch our already thing resources in order to > support multiple branches, so anything we can do to get as many people > as possible onto the same codebase helps us a lot.
Just as a last (hopefully) comment, even if nothing seemed to have an influence, no matter how many we are to prefer a unicode only mode (so far only you are in favour of it, maybe Andree too but I don't remember his opinion on this topic :). The gain we hope to have by keeping a non unicode mode is about having more users moving to PHP6. I would like to know why it will work better than with php5, any thoughts? And let forget that maintaining (and develop/implement) these two modes will obviously take more time. Cheers, --Pierre

Lukas Kahwe Smith

19 years ago
Pierre wrote:
> On 6/19/07, Rasmus Lerdorf <rasmus@lerdorf.com> wrote: > >> But this is no different from writing code that will work on both PHP 5 >> and PHP 6. The only difference is that instead of checking for PHP 5 >> you will be checking for Unicode. Like I said, we don't want the >> Unicode decision to be synonymous with PHP 5 vs. PHP 6 because then the >> non-Unicode folks will never get the benefits of the non-Unicode >> improvements in PHP 6 and we would be forced to support PHP 5 for a lot >> longer. We really stretch our already thing resources in order to >> support multiple branches, so anything we can do to get as many people >> as possible onto the same codebase helps us a lot. > > Just as a last (hopefully) comment, even if nothing seemed to have an > influence, no matter how many we are to prefer a unicode only mode (so > far only you are in favour of it, maybe Andree too but I don't > remember his opinion on this topic :). > > The gain we hope to have by keeping a non unicode mode is about having > more users moving to PHP6. I would like to know why it will work > better than with php5, any thoughts? > > And let forget that maintaining (and develop/implement) these two > modes will obviously take more time.
I agree, we tried out best in PHP5 to provide support for PHP4 and it seems this has not been overly successful. Why will this be any easier for PHP6? Maybe we should try a different approach. Lets not hold ourselves back. Lets break BC where it makes sense. Projects like PEAR etc. could always claim that its also PHP5 compatible without truly moving over. If we make a clean cut, this will not work anymore and instead we have an opportunity to clean up, improve performance a bit by removing unicode off hacks and let users migrate or stay. Sooner or later they will be attracted by new shiny stuff and then they will make a true effort to migrate over instead of these half migrations that happened with PHP5 "adoption". regards, Lukas

Tomas Kuliavas

19 years ago
> Pierre wrote: >> On 6/19/07, Rasmus Lerdorf <rasmus@lerdorf.com> wrote: >> >>> But this is no different from writing code that will work on both PHP 5 >>> and PHP 6. The only difference is that instead of checking for PHP 5 >>> you will be checking for Unicode. Like I said, we don't want the >>> Unicode decision to be synonymous with PHP 5 vs. PHP 6 because then the >>> non-Unicode folks will never get the benefits of the non-Unicode >>> improvements in PHP 6 and we would be forced to support PHP 5 for a lot >>> longer. We really stretch our already thing resources in order to >>> support multiple branches, so anything we can do to get as many people >>> as possible onto the same codebase helps us a lot. >> >> Just as a last (hopefully) comment, even if nothing seemed to have an >> influence, no matter how many we are to prefer a unicode only mode (so >> far only you are in favour of it, maybe Andree too but I don't >> remember his opinion on this topic :). >> >> The gain we hope to have by keeping a non unicode mode is about having >> more users moving to PHP6. I would like to know why it will work >> better than with php5, any thoughts? >> >> And let forget that maintaining (and develop/implement) these two >> modes will obviously take more time. > > I agree, we tried out best in PHP5 to provide support for PHP4 and it > seems this has not been overly successful. Why will this be any easier > for PHP6? Maybe we should try a different approach. Lets not hold > ourselves back. Lets break BC where it makes sense. Projects like PEAR > etc. could always claim that its also PHP5 compatible without truly > moving over. If we make a clean cut, this will not work anymore and > instead we have an opportunity to clean up, improve performance a bit by > removing unicode off hacks and let users migrate or stay. Sooner or > later they will be attracted by new shiny stuff and then they will make > a true effort to migrate over instead of these half migrations that > happened with PHP5 "adoption".
Nope. If I can't turn off unicode_semantics, I will ask end users to use PHP5 or write manual about running two PHP versions on one host. I can't update code to work on PHP6 unicode_semantics=on, because it affects lots of functions and updates will break backwards compatibility with PHP4 and some PHP5 versions. I suspect that I won't be able to set stream encoding, because I will have to read the stream in order to know encoding of 8bit data. In some cases data is provided by third party and character set information can be incorrect. In some cases same stream can output data in different character sets. In some cases automatic charset conversions performed by PHP libraries might break verification of received data. I won't be attracted with new shiny stuff. Last shiny stuff that I can use is available in PHP 5.1.0. I don't care about Unicode support, because it breaks things. I suspect that PHP6 Unicode extension won't give me controls that I have in PHP5 and PHP4 strings. PHP6 Unicode support is not designed for international environment. It is designed for nationalized environments and allows PHP script developers to code in their native language. Code written in French, Russian, Arabic, Japanese or Chinese is not international. Only some people can read it. Only some people can see difference between ァ() and ィ(). If I have to debug code written in Japanese or Arabic, language is the main barrier in understanding the code.
-- Tomas

Stefan Walk

19 years ago
On 19/06/07, Tomas Kuliavas <tokul@users.sourceforge.net> wrote:
> I don't care about Unicode support, because it breaks things. I suspect > that PHP6 Unicode extension won't give me controls that I have in PHP5 and > PHP4 strings. PHP6 Unicode support is not designed for international > environment. It is designed for nationalized environments and allows PHP > script developers to code in their native language. Code written in > French, Russian, Arabic, Japanese or Chinese is not international. Only > some people can read it. Only some people can see difference between ァ() > and ィ(). If I have to debug code written in Japanese or Arabic, language > is the main barrier in understanding the code.
You're spreading FUD about PHP6s unicode support. Writing code in your own native language has nothing to do with the unicode support in PHP6. You can already do that in PHP4 if you use utf-8, since any sequence of codepoints > 127 translates to a byte-sequence that is a valid identifier for php. Have a look at http://www.icu-project.org/ to see what the unicode features in php6 are really about. Regards, Stefan (who also thinks that the switch is of no use, unicode_semantics should be on all the time. And at least it shouldn't be off in php.ini-dist and php.ini-recommended)

Tomas Kuliavas

19 years ago
> On 19/06/07, Tomas Kuliavas <tokul@users.sourceforge.net> wrote: >> I don't care about Unicode support, because it breaks things. I suspect >> that PHP6 Unicode extension won't give me controls that I have in PHP5 >> and >> PHP4 strings. PHP6 Unicode support is not designed for international >> environment. It is designed for nationalized environments and allows PHP >> script developers to code in their native language. Code written in >> French, Russian, Arabic, Japanese or Chinese is not international. Only >> some people can read it. Only some people can see difference between ァ() >> and ィ(). If I have to debug code written in Japanese or Arabic, language >> is the main barrier in understanding the code. > > You're spreading FUD about PHP6s unicode support. Writing code in your > own native language has nothing to do with the unicode support in > PHP6. You can already do that in PHP4 if you use utf-8, since any > sequence of codepoints > 127 translates to a byte-sequence that is a > valid identifier for php. > Have a look at http://www.icu-project.org/ to see what the unicode > features in php6 are really about. > > Regards, > Stefan (who also thinks that the switch is of no use, > unicode_semantics should be on all the time. And at least it shouldn't > be off in php.ini-dist and php.ini-recommended)
And you are trying to make sure that new features that you like are turned on by default even when they break things for others. Some people are proposing changes that will enforce your preferred options without leaving any options to others. If I don't complain, PHP developers might do what you are proposing just like they switched unicode_semantics to PHP_INI_SYSTEM. I can't understand performance reasons without numbers that prove that, but I can see when somebody is trying to break things in my code and leaves me without any good options for fixing the code. It is possible that I am not correct. Writing functions in native language is one of key points in Andrei's presentation. http://www.gravitonic.com/talks/, "Unicoding With PHP 6" php|tek 2007 Chicago. Slides 49, 50 Other key points are about evaluating string length (slide 25) and offsets (slide 47), collation (slide 60,61) and strtoupper/strtolower/strcasecmp (slide 66). String length and offsets can be implemented with PHP5 mbstring extension. If I use PHP5 strtolower/strtoupper/strcasecmp, I must assume that they are locale aware. These functions don't follow LC_CTYPE=C rules, when locale is not C. It is possible that I am not correct and I will be able to update code and make it work in PHP6, but in order to do that I will have to use language constructs that are not backwards compatible with older PHP versions (slide 26, 30). I won't be able to mix PHP6 code with PHP5 code and will have to maintain two different library versions for lots of string functions and lots of stream operations. I will have to spend my time in order to make sure that code works, when I am not the one who broke it. I have other bugs to fix and they have higher priority than fixing code broken by others. I have already tested code in PHP6 unicode_semantics=on. Thing broke on password encryption and fix was to do something with binary typecasting. I need more than information currently available in http://www.php.net/manual in order to fix it. Then fputs calls freak out with notices about downcoded buffers and I can't leave those notices unfixed due to error_reporting = 2047 + display_errors = on coding requirements. And I still haven't reached the point when code does 8bit string decoding. We are working on different code. You have code with some specific character set and you can control all strings. My code works with different character sets, different sources of 8bit data and I don't controls those 8bit strings. My experience with PHP4/5 shows that I can work with 8bit strings better than PHP interpreter. Interpreter wins only when I have to work with large mapping tables and even then it is not stable (iconv), not enabled by default (recode), limited (mbstring) or very limited (utf8_decode). Some day I will take some standalone library and will try to make it work in PHP6 unicode_semantics=on. Maybe then I'll stop spreading the FUD. But for now don't expect that I will remain silent, if you propose changes that break things in PHP5 - PHP6 backwards compatibility. I know that unicode_semantics=on breaks things in drastic ways or my experience is based only on unstable PHP6 development code and RC versions will be better.
-- Tomas

Stanislav Malyshev

19 years ago
> PHP4 strings. PHP6 Unicode support is not designed for international > environment. It is designed for nationalized environments and allows PHP > script developers to code in their native language. Code written in
The goal of PHP 6 unicode support is definitely to allow internationalized development. Japanese function names are of much less importance than global support for unicode data and i18n/l10n functions - such as collation, localized formats etc.
-- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

Andrei Zmievski

19 years ago
No one is going to write code in their own native language and distribute it worldwide. How can you say that "PHP6 Unicode support is not designed for international environment"? Have you even tried it? -Andrei On Jun 19, 2007, at 9:27 AM, Tomas Kuliavas wrote:

Tomas Kuliavas

19 years ago
> No one is going to write code in their own native language and > distribute it worldwide. > > How can you say that "PHP6 Unicode support is not designed for > international environment"? Have you even tried it?
Ok. International environment. Do you have strtoupper|strtolower|strcasecmp functions operating in LC_CTYPE=C without switching locale? If I remember correctly, PHP does not use those even internally and developers are constantly triggering same Turkish|Kurdish|Azerbaijani bug in different functions. If I want case conversion or case insensitive comparison functions to follow C rules and not LC_CTYPE=some_translation, I am forced to use own functions, because strtoupper|strtolower are definitely locale aware in PHP. PHP6 unicode.semantics=on reduces my options and forces me to recode all 8bit string operations. After recoding functions are not backwards compatible with anything lower than 5.2.1. Your slides show that unicode characters are defined with \u, yet you mess with octals (\300) and hexadecimals (\xC0). It is possible that I am not right and I will be able to do everything more efficiently in PHP6. But for now I have broken password encryption handling, broken work with binary strings and over noisy stream functions. And I still haven't checked how it will handle streams with data encoded in different character sets. I will be forced to recode the code if PHP6 forces me to work in unicode.semantics=on. Don't expect that I will praise PHP6 for that. You are helping same people, who ask others to turn on mbstring.func_overload in php.ini in order to get unicode support. You are not helping people who already have code working with 8bit strings in different character sets.
-- Tomas

Rasmus Lerdorf

19 years ago
Pierre wrote:
> On 6/19/07, Rasmus Lerdorf <rasmus@lerdorf.com> wrote: > >> But this is no different from writing code that will work on both PHP 5 >> and PHP 6. The only difference is that instead of checking for PHP 5 >> you will be checking for Unicode. Like I said, we don't want the >> Unicode decision to be synonymous with PHP 5 vs. PHP 6 because then the >> non-Unicode folks will never get the benefits of the non-Unicode >> improvements in PHP 6 and we would be forced to support PHP 5 for a lot >> longer. We really stretch our already thing resources in order to >> support multiple branches, so anything we can do to get as many people >> as possible onto the same codebase helps us a lot. > > Just as a last (hopefully) comment, even if nothing seemed to have an > influence, no matter how many we are to prefer a unicode only mode (so > far only you are in favour of it, maybe Andree too but I don't > remember his opinion on this topic :).
Uh, this was agreed upon by everyone involved in the design of the Unicode support. So saying I am the only one is extremely misleading. I may be the only one explaining why the decision was reached, but I am certainly not the only one in favour of it.
> The gain we hope to have by keeping a non unicode mode is about having > more users moving to PHP6. I would like to know why it will work > better than with php5, any thoughts?
By not providing it, we ensure that a large number of people will not move to PHP 6. At least by providing it we give ourselves a chance. I think if we drop it we are basically giving up and we will be maintaining 2 code bases for the next 10 years. Do we really want that?
> And let forget that maintaining (and develop/implement) these two > modes will obviously take more time.
More time than maintaining separate Unicode and non-Unicode code bases in difference branches? -Rasmus

Pierre Joye

19 years ago
On 6/19/07, Rasmus Lerdorf <rasmus@lerdorf.com> wrote:
> Pierre wrote: > > On 6/19/07, Rasmus Lerdorf <rasmus@lerdorf.com> wrote: > > > >> But this is no different from writing code that will work on both PHP 5 > >> and PHP 6. The only difference is that instead of checking for PHP 5 > >> you will be checking for Unicode. Like I said, we don't want the > >> Unicode decision to be synonymous with PHP 5 vs. PHP 6 because then the > >> non-Unicode folks will never get the benefits of the non-Unicode > >> improvements in PHP 6 and we would be forced to support PHP 5 for a lot > >> longer. We really stretch our already thing resources in order to > >> support multiple branches, so anything we can do to get as many people > >> as possible onto the same codebase helps us a lot. > > > > Just as a last (hopefully) comment, even if nothing seemed to have an > > influence, no matter how many we are to prefer a unicode only mode (so > > far only you are in favour of it, maybe Andree too but I don't > > remember his opinion on this topic :). > > Uh, this was agreed upon by everyone involved in the design of the > Unicode support. So saying I am the only one is extremely misleading. > I may be the only one explaining why the decision was reached, but I am > certainly not the only one in favour of it.
Sorry, I did not know that there was many "externals" people involved in the unicode design Who was involved? Almost all "core" developers I asked are against (anyone having a different view, please step in).
> > The gain we hope to have by keeping a non unicode mode is about having > > more users moving to PHP6. I would like to know why it will work > > better than with php5, any thoughts? > > By not providing it, we ensure that a large number of people will not > move to PHP 6. At least by providing it we give ourselves a chance. I > think if we drop it we are basically giving up and we will be > maintaining 2 code bases for the next 10 years. Do we really want that?
We maintain three branches since a couple of years, having only two is a real progress. PHP4's one is dying, it was about time. I can live with two branches and code base for php-src, I have to maintain three or more branches in many pecl extensions anyway :)
> > And let forget that maintaining (and develop/implement) these two > > modes will obviously take more time. > > More time than maintaining separate Unicode and non-Unicode code bases > in difference branches?
Yes, code base is cleaner when the two are in two separate branches, it is easier to merge too. That's a feeling only, I never timed each merge or change :) --Pierre

Jani Taskinen

19 years ago
Rasmus Lerdorf wrote:
> Uh, this was agreed upon by everyone involved in the design of the > Unicode support. So saying I am the only one is extremely misleading. > I may be the only one explaining why the decision was reached, but I am > certainly not the only one in favour of it.
Yesterday's decisions don't necessarily apply today. ;) (to be "agile")
> By not providing it, we ensure that a large number of people will not > move to PHP 6. At least by providing it we give ourselves a chance. I
Yes, you assume that this happens. I've got a hunch too that there will be more PHP 6 user's than there ever where with PHP 5 by just thinking how many asian, arabic, etc. people there are in the world..lot more than western anyway.
> think if we drop it we are basically giving up and we will be > maintaining 2 code bases for the next 10 years. Do we really want that?
Yes, if it assures we can actually drop the other one at some point.
> More time than maintaining separate Unicode and non-Unicode code bases > in difference branches?
Having 2 versions in same branch sounds very bad idea. For a simple change, you might have to do it 2 different ways in 2 places. And also run 'make test' and 'make utest' (or whatever it was called again..). Also having 2 sets of tests for same stuff is gonna be huge PITA. By having 2 branches of code, you change in two branches and merge the change, with any luck, the patch applies cleanly in both. :) I think these issues weren't topmost in the people's minds when the decision of "unicode.semantics" setting was made. --Jani

Rasmus Lerdorf

19 years ago
Jani Taskinen wrote:
> Rasmus Lerdorf wrote: >> Uh, this was agreed upon by everyone involved in the design of the >> Unicode support. So saying I am the only one is extremely misleading. >> I may be the only one explaining why the decision was reached, but I am >> certainly not the only one in favour of it. > > Yesterday's decisions don't necessarily apply today. ;) > (to be "agile")
Fair enough, but it would be nice if the folks involved in the decision, including yourself would then clearly state their reasoning for making, or at least supporting, the decision in the first place and then explain what has changed to make you change your mind.
>> By not providing it, we ensure that a large number of people will not >> move to PHP 6. At least by providing it we give ourselves a chance. I > > Yes, you assume that this happens. I've got a hunch too that there will > be more PHP 6 user's than there ever where with PHP 5 by just thinking > how many asian, arabic, etc. people there are in the world..lot more > than western anyway.
It comes down to predicting the future. Whichever way we go, the decision is going to be second-guessed. If we have critical mass for a clean BC break, then I am ok with it. For me personally it would make things a bit easier, but I think it would be a long long time before we saw any large hosts out there switch to a PHP 6 that can't run common PHP 5 apps. -Rasmus

Ilia A.

19 years ago
Sorry to interject, but just a quick slightly off topic note. In your earlier e-mail you've said that ----------------- I actually don't have a problem with 95% of PHP 6 installations turning off Unicode support and this being the default setting for ISP's. Full Unicode support in an application is a big commitment and it will take quite a bit of work. I just don't think that many people will invest the time and effort into doing this, but at the same time there will be large applications and services that have full control over their server settings that will make use of it. Think Flickr, Yahoo, Facebook, etc. ----------------- Since 95% of installations will not be using PHP6 (php6 without unicode is pretty much a slower version php5) for whatever reason, we need a common version for the other 95%. I think it is inevitable that there will be 2 continually developed versions of PHP out there, one for people who need unicode support in the way that is envisioned by PHP6 and one for people who don't need it. On 19-Jun-07, at 3:44 PM, Rasmus Lerdorf wrote:
> Jani Taskinen wrote: >> Rasmus Lerdorf wrote: >>> Uh, this was agreed upon by everyone involved in the design of the >>> Unicode support. So saying I am the only one is extremely >>> misleading. >>> I may be the only one explaining why the decision was reached, >>> but I am >>> certainly not the only one in favour of it. >> >> Yesterday's decisions don't necessarily apply today. ;) >> (to be "agile") > > Fair enough, but it would be nice if the folks involved in the > decision, > including yourself would then clearly state their reasoning for > making, > or at least supporting, the decision in the first place and then > explain > what has changed to make you change your mind. > >>> By not providing it, we ensure that a large number of people will >>> not >>> move to PHP 6. At least by providing it we give ourselves a >>> chance. I >> >> Yes, you assume that this happens. I've got a hunch too that there >> will >> be more PHP 6 user's than there ever where with PHP 5 by just >> thinking >> how many asian, arabic, etc. people there are in the world..lot more >> than western anyway. > > It comes down to predicting the future. Whichever way we go, the > decision is going to be second-guessed. If we have critical mass > for a > clean BC break, then I am ok with it. For me personally it would make > things a bit easier, but I think it would be a long long time > before we > saw any large hosts out there switch to a PHP 6 that can't run common > PHP 5 apps. > > -Rasmus > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >
Ilia Alshanetsky

Jani Taskinen

19 years ago
Rasmus Lerdorf wrote:
> Jani Taskinen wrote: >> Yesterday's decisions don't necessarily apply today. ;) >> (to be "agile") > > Fair enough, but it would be nice if the folks involved in the decision, > including yourself would then clearly state their reasoning for making,
I think I've pretty clearly stated why I don't like the idea (anymore).
> or at least supporting, the decision in the first place and then explain > what has changed to make you change your mind.
What has changed is the fact that HEAD is becoming a mess (or already is). Separate tests for different modes, code duplication, etc. Maintaining all this is gonna be hell..and I'm not gonna volunteer doing it especially if it's totally unnecessary (IMO).
> It comes down to predicting the future. Whichever way we go, the > decision is going to be second-guessed. If we have critical mass for a > clean BC break, then I am ok with it. For me personally it would make > things a bit easier, but I think it would be a long long time before we > saw any large hosts out there switch to a PHP 6 that can't run common > PHP 5 apps.
To be totally honest, as long as nobody pays us to do something the way they want, we should do it exactly how WE want. After all, the group doing most of the work is Y! (or former Y!) people? (not to forget 1 or 2 Zend folks) The rest of us are not getting paid for this, like for example Ilia. We have an oportunity to finally get rid of the burden of past "mistakes" but lets not add any replacements for them. ;) --Jani

Richard Lynch

19 years ago
On Tue, June 19, 2007 2:44 pm, Rasmus Lerdorf wrote:
> It comes down to predicting the future. Whichever way we go, the > decision is going to be second-guessed. If we have critical mass for > a > clean BC break, then I am ok with it. For me personally it would make > things a bit easier, but I think it would be a long long time before > we > saw any large hosts out there switch to a PHP 6 that can't run common > PHP 5 apps.
If they switch to 6 with unicode off, and never ever get around to turning unicode on, will it really be any better? They'll just be running some weird-o setup that causes all kinds of bugs and issues and you'll have users with php 6 apps that won't work in php 6 and who submit bogus bug reports about it, because of the setting. A clean break is probably better, especially if it makes php 6 much more maintainable. Large-scale hosts won't switch to 6 any faster than they switched to 5, unless there are ZERO BC breaks. And nobody can guarantee zero breaks, because there are always buglets. The effort to have unicode off in 6 is probably larger than the effort to document what needs to be done to a PHP 5 app to make it be 6-friendly, or even write tools to auto-convert the buik of a script. If unicode semantics are "on" what exactly is borked in PHP 5? Can that be fixed to be BC without resorting to this toggle?
-- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

Jeremy Privett

19 years ago
> -----Original Message----- > From: Pierre [mailto:pierre.php@gmail.com] > Sent: Tuesday, June 19, 2007 9:09 AM > To: Rasmus Lerdorf > Cc: Peter Brodersen; internals@lists.php.net > Subject: Re: [PHP-DEV] What is the use of "unicode.semantics" in PHP
6?
> > On 6/19/07, Rasmus Lerdorf <rasmus@lerdorf.com> wrote: > > > But this is no different from writing code that will work on both
PHP 5
> > and PHP 6. The only difference is that instead of checking for PHP
5
> > you will be checking for Unicode. Like I said, we don't want the > > Unicode decision to be synonymous with PHP 5 vs. PHP 6 because then
the
> > non-Unicode folks will never get the benefits of the non-Unicode > > improvements in PHP 6 and we would be forced to support PHP 5 for a
lot
> > longer. We really stretch our already thing resources in order to > > support multiple branches, so anything we can do to get as many
people
> > as possible onto the same codebase helps us a lot. > > Just as a last (hopefully) comment, even if nothing seemed to have an > influence, no matter how many we are to prefer a unicode only mode (so > far only you are in favour of it, maybe Andree too but I don't > remember his opinion on this topic :). > > The gain we hope to have by keeping a non unicode mode is about having > more users moving to PHP6. I would like to know why it will work > better than with php5, any thoughts? > > And let forget that maintaining (and develop/implement) these two > modes will obviously take more time. > > Cheers, > --Pierre
I remember when PHP 5 came out. All the apps I worked on and any I saw that was worth its salt took very little effort to get working in the new PHP version. The BC breaks weren't that bad. With that said, PHP 5 adoption was ... slow, at best. unicode.semantics is not the way to solve this problem in PHP 6. The big push for PHP 6 is UNICODE SUPPORT. And you're making this a switch that you can simply turn on and off? That's not how you move people onto the new version, that's how you keep people AWAY from it. Vendors are not going to be bothered to update their products to support PHP 6 with unicode on and off. And if they only write it one way or the other, they'll lose sales because it won't work on Customer A, B, and C's hosts. So, what will they do? Stay in stable waters for as long as they can. Which means, nobody's leaving PHP 4 or 5. PHP can afford a BC break, trust me. If you want people to adopt PHP 6, don't make it harder for them to do so. unicode.semantics does NOT make it easier for the vendors (who control PHP adoption, by the way -- it's all about who's programming the products for the versions) to adopt PHP 6. It makes it harder. You say you want to move people onto PHP 6 as seamlessly as possible by making it easy to port code written in PHP 5 onto it, and that's great. But, it's not the correct solution. Because, these people will have to live with the knowledge that their code "works on PHP 5, and on SOME distributions of PHP 6". You want people off of PHP 4 and PHP 5? Put together a plan to drop ALL support for these versions and PUBLICIZE the heck out of it. You let people KNOW that after PHP 6 is out, you have a steady plan to drop support for PHP 4 in x number of months and PHP 5 in x number of years(?). That way, if they want to continue getting security updates, they know where to go. And vendors will be more inclined to get their butts in gear to support updates in technology. In this situation, BC is going to be the bane of PHP's existence. By enabling unicode.semantics, you are polluting what PHP 6 was supposed to be and giving an excuse to people who are lazy and don't want to do the extra work necessary to support the changes. And those people will not do them, if you don't force them to. Meaning, their apps will work on PHP 5 and a subset of PHP 6 installations. But, let's look at this situation from another angle. What if unicode.semantics becomes the next magic_quotes or safe_mode, and is ALWAYS OFF in 95%+ of PHP installations? All of the work you did to add unicode support was WASTED on this presumption that if you don't have BC, no one's going to use it. Whereas the opposite is clearly true, in this case. If you have BC, it'll get used simply because it works with old code, but the main thing that changed about the language will never be touched.
-- Jeremy Privett PHP Developer Zend Certified Engineer Peak8 Solutions

Rasmus Lerdorf

19 years ago
Jeremy Privett wrote:
> But, let's look at this situation from another angle. What if > unicode.semantics becomes the next magic_quotes or safe_mode, and is > ALWAYS OFF in 95%+ of PHP installations? All of the work you did to add > unicode support was WASTED on this presumption that if you don't have > BC, no one's going to use it. Whereas the opposite is clearly true, in > this case. If you have BC, it'll get used simply because it works with > old code, but the main thing that changed about the language will never > be touched.
I actually don't have a problem with 95% of PHP 6 installations turning off Unicode support and this being the default setting for ISP's. Full Unicode support in an application is a big commitment and it will take quite a bit of work. I just don't think that many people will invest the time and effort into doing this, but at the same time there will be large applications and services that have full control over their server settings that will make use of it. Think Flickr, Yahoo, Facebook, etc. If enough people think it is a good idea to remove the switch we can do it, but we have to realize that everything we improve in PHP 6 will mostly be for the benefit of these large dedicated applications and the regular Joe User on a shared server will never see these them. -Rasmus

Derick Rethans

19 years ago
On Tue, 19 Jun 2007, Rasmus Lerdorf wrote:
> Jeremy Privett wrote: > > But, let's look at this situation from another angle. What if > > unicode.semantics becomes the next magic_quotes or safe_mode, and is > > ALWAYS OFF in 95%+ of PHP installations? All of the work you did to add > > unicode support was WASTED on this presumption that if you don't have > > BC, no one's going to use it. Whereas the opposite is clearly true, in > > this case. If you have BC, it'll get used simply because it works with > > old code, but the main thing that changed about the language will never > > be touched. > > I actually don't have a problem with 95% of PHP 6 installations turning > off Unicode support and this being the default setting for ISP's.
I do, because that will end up in less hosts running with real unicode support. They can always tell their clients "we have php 6" - while it is in fact just the crippled non-unicode version of it. regards, Derick
-- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org

Mike Robinson

19 years ago
Derick Rethans wrote:
> > > Jeremy Privett wrote:
> > I actually don't have a problem with 95% of PHP 6 installations > > turning off Unicode support and this being the default > setting for ISP's. > > I do, because that will end up in less hosts running with > real unicode support. They can always tell their clients "we > have php 6" - while it is in fact just the crippled > non-unicode version of it.
IMHO, how many hosts that run PHP6 with unicode support is moot - as long as those who need it get it and those that don't aren't penalized by having their PHP6 install "crippled" turning off unicode. Just the notion that disabling unicode somehow "cripples" PHP6 is quite startling. That aside, it seems to me that PHP5 support will be around for a while. People can take that time to learn. Some of the energy saved supporting this setting and it's underlying needs can be better devoted to some documentation for teaching people how to migrate to a unicode-aware programming world. FWIW then, do it now. Cut the cord. Remove the setting and be done with it. Frankly, I think the PHP team has done far too much hand-holding and coddling in the last few years (an admirable, very under-appreciated job I might add). I think the core team will have its hands full getting PHP6 out the door and keeping PHP5 reasonably maintained. Humbly, I believe adding unicode.semantics to the equation may be a heavy, heavy piece of straw that breaks a lot of backs. Joe User included. Best Regards Mike Robinson

Andi Gutmans

19 years ago
I very much agree with Rasmus that giving our users the option is extremely valuable. Unicode support is useful to some people but I think it's a mistake to force it down everyone's throat. Forget the fact that it will be considerably slower and eat up more memory than PHP 5 & 4, but there will also be some serious BC issues and idiosyncrasies which a huge part of our community (arguably over 90%) just don't care about. Some people here said that we weren't successful in keeping BC between PHP 5 and PHP 4. Whoever said that must not have migrated applications between the versions. It took very little effort to do so. Most people I know did it in a matter of hours for sizeable code bases and in fact most time was spent on regression testing which would need to be done anyway. I also think that the fact that we *do* still support PHP 4 is a strength and not a weakness of the PHP project (as much as I'd like everyone to migrate to PHP 5). Sure maybe that gave less incentive to upgrade which is a bit of a PITA for the PHP eco-system. On the other hand look at technologies who didn't do that. Microsoft with VB, DNA, DCOM and some of their other technologies are good examples. Every version their users would suffer time and time again, often having to completely migrate their investment because they were not officially supported anymore. Look at how Microsoft are looking to ditch XP early in the process. I don't think we want to follow that path. The fact that we do our best not to break BC and are very careful when doing it is a HUGE plus for us. Not to mention still doing security and critical fixes for PHP 4. Btw, on the "if (UG(unicode)" issue. That's really a bunch of BS. There'll be no problems once we get into optimizing Unicode mode to make sure we take good advantage of CPU branch predicition (with compilers help). We are intentionally not trying to do premature optimizations right now but rather make sure we get the end result that we want from a functionality point of view, and the optimize according to what the real bottlenecks are. I have always been against premature optimizations and I can pretty much promise that the "if (UG(unicode))" is not going to be an issue. It's a bit more code yes. But I think it's worth it. We had a lot of discussions on this issue within the core development team and I think there was a strong enough case to keep things this way. If we are proven wrong down the road then there's always PHP 6.5 or 7 where we can nuke the 8bit mode. But my guess is that at least 80%+ of PHP 6 users will not run in Unicode mode. For many there's just not sufficient reason to do so. Andi

Lukas Kahwe Smith

19 years ago
Andi Gutmans wrote:
> Some people here said that we weren't successful in keeping BC between > PHP 5 and PHP 4. Whoever said that must not have migrated applications > between the versions. It took very little effort to do so. Most people I > know did it in a matter of hours for sizeable code bases and in fact > most time was spent on regression testing which would need to be done > anyway.
I think the arguement was rather that we put so much effort into maintaining BC, yet still there were some minor issues, but more importantly users were still reluctant to jump to PHP5. Partly because they could indeed attain PHP4/PHP5 compatibility with the same code. Therefore they could hold out longer before making the jump. regards, Lukas

Pierre Joye

19 years ago
Hi Andi, On 6/21/07, Andi Gutmans <andi@zend.com> wrote:
> I very much agree with Rasmus that giving our users the option is > extremely valuable. > > Unicode support is useful to some people but I think it's a mistake to > force it down everyone's throat. Forget the fact that it will be > considerably slower and eat up more memory than PHP 5 & 4, but there > will also be some serious BC issues and idiosyncrasies which a huge part > of our community (arguably over 90%) just don't care about.
That's true, and this 90% doesn't care either about php6.
> Some people here said that we weren't successful in keeping BC between > PHP 5 and PHP 4. Whoever said that must not have migrated applications > between the versions. It took very little effort to do so. Most people I > know did it in a matter of hours for sizeable code bases and in fact > most time was spent on regression testing which would need to be done > anyway.
I was one who said it and I will said it again. I made many migrations. I confirmed it was not 100% BC and it required work. The problem (even worst after 5.x than between 4.x and 5.x) was all changes after 5.x. The new pedantic errors added in minor versions and other warnings, it was actually more painfull after 5.x than between two 5.x. For a simple reason, 4.x to 5.x issues were mostly known, it was wisely planed and decided.
> I also think that the fact that we *do* still support PHP 4 is a > strength and not a weakness of the PHP project (as much as I'd like > everyone to migrate to PHP 5).
I agree but we don't have enough resources (as far as I understand.) As you know, I don't consider maintaining 4.x is a lot of work. By maintaining I mean only security fixes. It can be done independently from any other releases and by completely different people.
> Sure maybe that gave less incentive to > upgrade which is a bit of a PITA for the PHP eco-system. On the other > hand look at technologies who didn't do that. Microsoft with VB, DNA, > DCOM and some of their other technologies are good examples. Every > version their users would suffer time and time again, often having to > completely migrate their investment because they were not officially > supported anymore. Look at how Microsoft are looking to ditch XP early > in the process. I don't think we want to follow that path. The fact that > we do our best not to break BC and are very careful when doing it is a > HUGE plus for us. Not to mention still doing security and critical fixes > for PHP 4.
It was not well done. A 3 commits release required months to be released, that's simply unreliable. If we like to keep every releases active for years, we have to change a couple of things in our model (see the archives to get some tips).
> Btw, on the "if (UG(unicode)" issue. That's really a bunch of BS.
With all respects, how many extensions do you maintain? How many commits do you actually do? Please don't tell me that what I said about the extra work required about the two modes is BS. Well, you don't say directly but you include every argument in the BS :)
> I have always been against premature optimizations and > I can pretty much promise that the "if (UG(unicode))" is not going to be > an issue. It's a bit more code yes. But I think it's worth it.
Most of us are against it for two reasons: - php6 without unicode makes no sense. The impact will be much more damageable than magic gpc on/off or any other flags we had until now - the extra work required I think we all agree than the slowness is not yet an argument. Even if it was, it is a non issue (as you well explained).
> We had a lot of discussions on this issue within the core development > team and I think there was a strong enough case to keep things this way. > If we are proven wrong down the road then there's always PHP 6.5 or 7 > where we can nuke the 8bit mode. But my guess is that at least 80%+ of > PHP 6 users will not run in Unicode mode. For many there's just not > sufficient reason to do so.
That's the worst thing to do. Breaking things between 6.0 and 6.x is a no-no here. In the same manner, if we keep the flag, we will have to keep it. Or why php7 will be a better moment than php6? That simply makes no sense. --Pierre

Jani Taskinen

19 years ago
I agree totally on giving options. The users have the option to either use PHP 5 (non-unicode) or PHP 6 (PHP 5 + unicode).. So essentially we're just forking here, nothing special about that. (just that it happens inside the project, between two major versions) --Jani p.s. Andi, the outsiders like myself value people on what they actually commit, everything you do behind the curtains means nothing to us. On Wed, 2007-06-20 at 20:52 -0700, Andi Gutmans wrote:

Johannes Schlueter

19 years ago
Hi Jani, On Thu, 2007-06-14 at 16:53 +0300, Jani Taskinen wrote:
> During Derick's talk about PHP 6 at PHP Vikinger, I started to wonder > what exactly was the reasoning behind adding something like > "unicode.semantics" option. Derick didn't remember, neither did I.
The reason was to "keep BC"
> Apparently it's another one of these "register_globals" or > "magic_quotes_*" directives we'll remove in PHP 7? :D > > I mean, if PHP 6 is about unicode, why upgrade to PHP 6 and disable it? > Just stay with PHP 5 then..
- The ini Setting changes the behaviour of the code in a quite drastic way. This is even worse then magic_quotes which could be fixed by using some prepending file removing/adding slashes depending on the setting. - The UG(unicode) checks in the code make maintenance way harder. - This feature doesn't bring BC - there will still be enough BC breaks. - I guess we're adding a few thousand UG(unicode) checks during each request which certainly cost a bit performance Conclusion: Let's remove that damn setting. johannes

Derick Rethans

19 years ago
On Thu, 14 Jun 2007, Johannes Schlüter wrote:
> Hi Jani, > > On Thu, 2007-06-14 at 16:53 +0300, Jani Taskinen wrote: > > During Derick's talk about PHP 6 at PHP Vikinger, I started to wonder > > what exactly was the reasoning behind adding something like > > "unicode.semantics" option. Derick didn't remember, neither did I. > > The reason was to "keep BC" > > > Apparently it's another one of these "register_globals" or > > "magic_quotes_*" directives we'll remove in PHP 7? :D > > > > I mean, if PHP 6 is about unicode, why upgrade to PHP 6 and disable it? > > Just stay with PHP 5 then.. > > - The ini Setting changes the behaviour of the code in a quite > drastic way. This is even worse then magic_quotes which could > be fixed by using some prepending file removing/adding slashes > depending on the setting. > > - The UG(unicode) checks in the code make maintenance way harder. > > - This feature doesn't bring BC - there will still be enough BC > breaks. > > - I guess we're adding a few thousand UG(unicode) checks during > each request which certainly cost a bit performance > > Conclusion: Let's remove that damn setting.
Just to state the obvious... I agree here. Derick