Things that could be dropped from PHP 6

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Things that could be dropped from PHP 6

Post by panic! »

There were a few things that were to be added to PHP 6 that hear have been dropped, that I'm quite dissapointed about..


ifsetor instead of $hello = isset($hello)? $hello :123456;

optional params for functions.

But glad they've dropped register_globals

and glad they're adding foreach for multi-dimentional arrays.

Anything you would have liked to seen added?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I'm still waiting to know what's happening with namespacing. I wonder how a multidimensional foreach will work.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Where did you hear these claims?
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Cool :) The namespace stuff looks like I imagined it would work in terms of "using" it but not in terms of declaring it. Pretty neat anyway so this should now work without errors if I read it correctly.

Code: Select all

<?php

namespace myPackage
{
    class myClass {
        public function __construct() {
            echo "myClass Called from namespace\n";
        }
    }
    function myFunction() {
        echo "myFunction called from namespace\n";
    }
}

function myFunction() {
    echo "myFunction called globally\n";
}

class myClass {
    public function __construct() {
        echo "myClass called globally\n";
    }
}

Code: Select all

<?php

$o = new myClass(); //myClass called globally
myFunction(); //myFunction called globally

import myPackage;

$o = new myClass(); //myClass called from namespace
myFunction(); //myFunction called from namespace
The ability to require the constructor be run when part of an inheritance hierarchy is a great idea too.
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Post by panic! »

feyd wrote:Where did you hear these claims?
http://www.php.net/~derick/meeting-notes.html
Post Reply