What won’t be in PHP 6

Pierre-Alain Joye picked this one up last week, and it needs repeating. For PHP6 the following are already gone from CVS:

  • Register globals
  • Magic quotes
  • Safe mode

As blogged a while back, you’ll find these changes discussed here. Nice use of carrot and stick in fact – for the pain on fixing your apps to run under PHP6, you get Unicode.

Update: just noticed a new ini setting here;

allow_url_include “0″ PHP_INI_SYSTEM Available since PHP 6.0.0.

Excellent! That eliminates another major source of exploits (perhaps the biggest) – have moaned about that before here and here

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • fgraph

    Good riddance to safe mode. The entire idea behind safe mode is sort of an acknowledgement of php’s shortcomings which need to be addressed (and evidently are in version 6).

  • http://www.lowter.com charmedlover

    I want to see namespaces as well. :)

    I don’t use any of these anyways, so it doesn’t matter I guess.

  • http://www.phppatterns.com HarryF

    I want to see namespaces as well. :)

    I’m not up to date on the latest there but I got the impression namespaces could happen in PHP6 – see here.

  • http://blog.phpdoc.info/ scoates

    for the pain on fixing your apps to run under PHP6, you get Unicode

    I’d go as far as to say that if your code depends on these things now, you need to fix your apps.

    S

  • Dr Livingston

    > for the pain on fixing your apps to run under PHP6, you get Unicode

    for unicode support, to get that finally in php anything is just about worth it i suppose…

  • zonked

    Harry, whoever hasn’t already modified their app to not depend on register_globals and magic quotes should be beat with a professional stick, no doubt. It’s been a while since PHP 4.2.x.

  • http://www.lopsica.com BerislavLopac

    Interesting. This means that they’re trowing away backward compatibility, which is a bold move; however, they still lack the courage — or wisdom — to finally divorce the two facets that is PHP: the Web development engine and the programming language. Instead, we’re getting their bastard child — the Zend Development framework — which reminds me of that story of a guy who lost his keys somewhere in the dark but searched for them under a lamp because there was more light.

  • jayboots

    What web development engine? Divorce how? AFAIK, PHP comprises two things: the Zend execution engine and the PHP language which includes all of the bundled core functions. What else can you be refering to? The fact that PHP is embeddable in documents (making it a “template” language)? I suppose not but essentially I don’t understand your comment, Berislav.

  • http://www.tonymarston.net Tony Marston

    While I am in favour with most of the proposed changes, I totally disagree with the idea of making PHP more case-sensitive. My reasons are documented in

  • http://www.tonymarston.net Tony Marston
  • Pingback: Scriptorama » Please check your not-included URLs at the door

  • andrewtayloruk

    I see a large flood of other peoples remedial work coming my way soon, bring on the clients, daddy needs new shoes.

  • http://www.manisharma.s4u.org phpsharma

    My vote is for Tony marston. All your points are valid.

  • ajking

    What worries me is that if the transition to PHP 6 on inexpensive web hosts (which the majority of the millions of websites that use PHP happen to be running on) happens as slowly as the transition to PHP 5 (which is to say: not at all) then the advances in 6 will be practically futile. How do we get those web hosts and the makers of the web hosting software that they use (such as cPanel and Ensim and Plesk etc) to accelerate their updating of PHP?

  • ajking

    In fact, I think it is such a serious issue that I will add this comment: I think the php community should immediately stop supporting version 4 altogether and move it to archival status. We’ll never get widespread movement to 5 or 6 otherwise. I worked for a few months last year for a fairly succssful web dev/hosting company that not only was still hosting customers on 4, it had left register_globals turned on because of a legacy shopping cart that one customer didn’t want to upgrade. Unbelievable! It shows what we’re up against in moving PHP forward in the wider world.

  • Kailash Badu

    When will be PHP6 out

  • Ryan Wray

    Offtopic: I think case-sensitivity is a good thing in PHP. While we could argue till we a black and blue about why case-sensitivity is a bad thing in computers, it is standard practice in programming languages and PHP needs it to keep desired consitency. PHP should not be so brave to break the chains of cash-sensitive applications as it will only isolate itself from the programming community. It will not be respected as a programming langauge and ultimately will decline in popularity (from the people who we want to use it, anyhow). In a business sense it is important that PHP is case-senstive.

  • codeninja

    for all of you folks who are rubbing your hands waiting on the flood of clients… just sit tight.

    The majority of web hosts don’t even offer PHP5 yet, and are all stuck on 4.3 (or even 4.23 with some hosts)…

    Web hosts wont be doing anything that is going to cost their clients money or force them to another host…

    so just sit tight.

  • http://diigital.com cranial-bore

    Wow, it is going to be a seriously long time before we see PHP6 on shared web hosts.

  • Tim

    As an owner/operator of a shared hosting server, I empathise with the php4/5/6 debate. The main (only?) reason the likes of CPanel (cant speak for Ensim or Plesk) do not move to php5 is because the software they bundle like guestbooks, shopping carts, etc do not run under php5. Just to get our systems up to php5, I’m actually pushing for our servers to drop support for those bundled scripts. Due to the relatively low numbers of clients on some of the sytems, I’m even willing to donate my time (within reason) to those clients that have problems upgrading, just I can personally use the “new” features in my own projects.

  • Pingback: The mass amateurisation of everything, in code at Suttree, Elixir for Immortal Baboon

  • http://www.lopsica.com BerislavLopac

    What else can you be refering to? The fact that PHP is embeddable in documents (making it a “template” language)?

    Well, yes, that’s one thing, but I’m also referring to all the bits and pieces that make sense only in Web development environment: register_globals, sessions, cookies, various Web-related enviroment values (e.g. $_SERVER) etc. For PHP to be a “fully-fledged” language it needs to be employable without them; also, although it can be a CLI-only scripting language, I would like to see an implementation of PHP5 that could persist objects in memory, perhaps an extension-based GUI library etc…

    On a related note, since we talk about breaking backward compatibility, here’s an idea that seems so natural to me, and I’ve seen no language employing it — it would be a perfect fit for PHP. Instead of using a ‘.’ for string concatenation, it would be interesting to use whitespace for that purpose. E.g., any variables or literals following each other would be converted into string:$my_string = $my 'new' ' ' $variableName 225 334 'goes here' isntit();

    A nice side-effect of that would be that it would free ‘.’ for other uses — for example namespaces.

  • http://www.tonymarston.net Tony Marston

    I think case-sensitivity is a good thing in PHP. While we could argue till we a black and blue about why case-sensitivity is a bad thing in computers, it is standard practice in programming languages and PHP needs it to keep desired consitency.

    Introducing more case-sensitivity just to be consistent with other languages is a pathetic argument. Case sensitivity causes more problems than it solves, so it should be removed in the name of comon sense.

    It will not be respected as a programming langauge and ultimately will decline in popularity

    The millons of existing PHP programmers do NOT see the lack of case sensitivity as a problem, and those non-PHP programmers who refuse to touch it because of this are, quite frankly, people whom the PHP community would be better off without.

    In a business sense it is important that PHP is case-senstive.

    Absolute rubbish! People who use applications do not care whether the language it was written in is case sensitive or not. It is a matter only for programmers, not business users.

  • mx2k

    well tony, when making a case sensitivity arguement, next time, use C# not vb, vb is generally not case sensitive. (in fact my employer programs in vb for this reason, because its generally not case sensitive). http://www.tonymarston.net/php-mysql/case-sensitive-software-is-evil.html

    however case sensitivity does has it uses for those of us who program a certain way and would like functions, methods and such to be typed consistently through out the code base. I think code consistency helps with readability and is extremely important as readability helps code to be somewhat self documenting.

    i know that in c# i generally use hungarian notation for fields and and then Uppercase the first letter of properties. while this currently does not apply to php, it may in the future should they php group/ zend provide property accessors and perhaps do away with $ for fields/vars in the class scope.

    however i sympathize if you want to be lazy and not worry about case sensitivity ;)

  • mx2k

    oh yeah if you’re making long variables like this …avariablelikethisisveryhardtounderstand….tisk tisk, bad example

  • Curtis

    …register_globals, sessions, cookies, various Web-related enviroment values (e.g. $_SERVER) etc. For PHP to be a “fully-fledged” language it needs to be employable without them…

    PHP was intentionally designed for use on the Web, that’s what’s unique about it. The fact that it streamlines such tasks as grabbing the query string key/value pairs is not a hindrance as a language. If we follow your prerequisites, then we should all just use Perl (a great language, btw).

    …perhaps an extension-based GUI library etc…

    Aren’t you referring to PHP-GTK?

  • http://www.jhauser.com datune

    Oh my god, I can not believe the arguments people are trying to make against the article written by Tony regarding the case sensitivity.

    oh yeah if you’re making long variables like this …avariablelikethisisveryhardtounderstand….tisk tisk, bad example

    How can this be a bad example? You should think first, then write. Just because a language is case insensitive doesn’t mean you can not use camelcaps (btw. I personally disagree with Tony’s statement that camelcaps are stupid, but that’s just a matter of preference, and if you know that Tony is in the business for so long it doesn’t come as a suprise that he favours _ over camelcaps).

    Enforcing a language to be case sensitive JUST to ensure the code is readable is a very pathetic argument indeed, and don’t even get me started about the person who said it’s important for business (omg!!!)

    While most of the time I disagree with Tony’s oppinion on a lot of matters, I have to agree with him on this one issue.

    I would really like to know why the PHP dev’s are even considering this.

    I’d rather like them to put all that energy into making sure UTF-8 will work flawless ;)

  • http://www.dreamscapevisionery.com Vanish

    Any way you slice it, case-sensitivity is a matter of personal preference. Having case-sensitivity provides a more versatile language, and the consistency IS important. Most RDBMS’ are built case-sensitive, and with good reasons. Most PHP apps connect to an RDBMS. It makes good sense to maintain structure and standards across the two. Just my two cents. Feel free to flame me as lame as you have the others. Frankly I haven’t read any contrary responses I didn’t feel the same way about. As I said to begin with, it’s all a matter of preference.

    As for PHP 6, good riddance to the lot of the dropped “features”.

  • http://www.tonymarston.net Tony Marston

    Any way you slice it, case-sensitivity is a matter of personal preference.

    If it is a matter of personal preference then why should should anybody’s personal preferences be forced upon others?

    Having case-sensitivity provides a more versatile language

    How so? All I see is the potential to create confusing code where variables such as $account and $Account point to different things, and functions such as dostuff() and DoStuff() mean different things. If the IDE/compiler of the language can detect differences in case and automatically synchronise them to compensate then case-sensitivity becomes transparent, but PHP does not have this capability, so the potential for writing bad code is only increased by introducing case-sensitivity.

    and the consistency IS important.

    Introducing something “to be consistent” is a totally dumb idea if what you are perpetuating is a mechanism for creating confusing code.

    Most RDBMS’ are built case-sensitive

    Rubbish! I have never come across ay RDBMS which is case-sensitive! When you write an SQL query you can use any mixture of case for database names, table names, column names and function names. This makes them insensitive to case.

  • Anonymous

    @datune i was talking about the length of the variable.

    first off not everyone uses an IDE with php, so yes the variables should be readable, but not overly long, because some people code by hand without any kind of intellisence and the longer the variable, the more of a chance there is to copy only a part or mistype the variable.

    please lay off the “omg”, it could be considered insulting.

    if $firstName or $first_name or $firstname is how you want to type it, then go ahead, however it should be the same throughout the code base.

    i’m sure when php6 comes out, the Eclipse IDE plugin or whatever they are making in conjuction with Eclipse for the new zend framework will handle the case sensitivity issue.

    besides if you coded consistenly in the first place, this wouldn’t be that big of an issue.

  • spVince

    I’m not a programmer, but I get the feeling that PHP is adopting case sensitivity just so it can comply with other languages, rather than if it makes programming sense per say?

  • Kias

    PHP is an interpreted laguage.
    For computers “thisstring” != “ThisString”, ‘a’ != ‘A’.

    You would need to lowercase (or uppercase) all calls to methods/functions/variables in a case-insensitive system.

    That would be slower. Slower is bad.