Results 1 to 25 of 59
Dec 6, 2009, 18:20 #1
- Join Date
- Jan 2008
- Knoxville TN
- 66 Post(s)
- 1 Thread(s)
What I want for PHP 6 Christmas...
When PHP 6 comes out I really only want one thing. Admittedly it's a major thing, but I believe it would help the language out a hell of a lot. That one thing - place all existing functions in a legacy namespace and then rebuild the function library with consistently named functions in an object oriented fashion.
The existing functions would still be around - they just would have to be imported and for backwards compatibility a flag would be placed in the php.ini file that would do this automatically. It could even ship with the value set to true.
But if it's set to false the scatterbrained php function library goes away replaced with one planned out from the start and itself divided into namespaces.
So this weird situation of string functions sometimes having underscores and sometimes not -- strpos, strchr, str_replace, str_split; or not even referencing strings in the name; explode and implode; goes away. Instead.
$a = "The quickbrown fox jumped over the lazy dog";
$a->position('dog'); // Find the position of dog in $a
$b = $a->explode(' '); // Explode $a into an array and return it to $b.
$a->explode(' '); // As above, but since there is no var to assign it to $a will become an array and hold the result of the explode.
$a->shuffle(); // Shuffle the order of the elements..