Page 1 of 1

Things that could be dropped from PHP 6

Posted: Sun Sep 24, 2006 4:32 am
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?

Posted: Sun Sep 24, 2006 6:08 am
by Chris Corbyn
I'm still waiting to know what's happening with namespacing. I wonder how a multidimensional foreach will work.

Posted: Sun Sep 24, 2006 8:53 am
by feyd
Where did you hear these claims?

Posted: Sun Sep 24, 2006 9:01 am
by Todd_Z

Posted: Sun Sep 24, 2006 9:30 am
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.

Posted: Sun Sep 24, 2006 11:38 am
by panic!
feyd wrote:Where did you hear these claims?
http://www.php.net/~derick/meeting-notes.html