> > you have to change existing code (if I understand your syntax > correctly)
I think the idea here is to put functions likes floor and round in a legacy namespace of sorts, so they are not accessible in the global namespace. Then you have an .ini directive that imports the legacy namespace into the global namespace. Disable the .ini directive for 100% PHP6 mode, leave it in for legacy support. If it's enabled, you could mix round( $int ) and $int->round() in the same file. That's my understanding at least. On Tue, Jul 17, 2012 at 6:07 AM, Thomas Nunninger <tho...@nunninger.info>wrote: > Hi, > > > On 07/17/2012 05:40 AM, Nicholas Curtis wrote: > > Great Idea, would love to see current standard library in a legacy > > namespace and a new standard library implemented as methods of > > primitive types. > > The idea to separate old and new behaviour has some charm. > > > > $string = "Hello, World"; > > echo $strong->toUpper(); // HELLO, WORLD > > > > $int = 3; > > echo $int->round(2); // 3.0 > > > > While still preserving $legacy.strTopUpper($string) and > $legacy.round($int) > > I wouldn't do that because it implies two things: > > - you have to change existing code (if I understand your syntax > correctly) > > - you could mix old and new style in one file > > > Somebody proposed (in some other thread some weeks ago) to introduce some > code versioning. IIRC he proposed the "<?php6" opening tag instead of > "<?php". (I'd prefer something like "<?php+" - but that's just a naming > thing. And of course: You could still mix different styles in one file - > but not in one php block. And that's easier to handle by coding conventions > in the team.) > > Versioning could be a chance to evolve the language and not to mess with > existing code. BUT: I don't know if that's doable internally. And it's > probably a lot of work... > > Regards > Thomas > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- *Brandon Wamboldt* Programmer / Web Developer StackOverflow Careers Profile<http://careers.stackoverflow.com/brandonwamboldt>- GitHub Profile <https://github.com/brandonwamboldt> - LinkedIn<https://github.com/brandonwamboldt> - My Blog <http://brandonwamboldt.ca/>