Community
Participate
Working Groups
The PHP team has released the 5.4 beta #2 http://www.php.net/archive/2011.php#id2011-10-26-1 It's time for us to enable the community to develop applications based on it
some useful links: parser - https://svn.php.net/repository/php/php-src/branches/PHP_5_4/Zend/zend_language_parser.y lexer - https://svn.php.net/repository/php/php-src/branches/PHP_5_4/Zend/zend_language_scanner.l presentation about the new traits - http://www.slideshare.net/paulgao/come-on-php-54
I am really looking forward to using the new PHP 5.4 features like the shortened array syntax, traits, and chaining on the constructor. I know it's early still, but any estimates on when PDT will support the new syntax?
stubs created.
Yep I agree with this it would be great to have an update for 5.4 syntax I would like to see something like this if possible <?php // File 1 Traits.php trait singleton { private static $oInstance = null; public static function getSingleton() { if(!self::$oInstance instanceof self) { self::$oInstance = new self; } return self::$oInstance; } } // File 2 NewClass.php require_once 'Traits.php'; class NewClass { /** * @var NewClass * @return NewClass */ use singleton; public function display() { echo get_class($this); } protected function doSomething() { // Would be nice for the definition of @var NewClass above // to allow Ctrl space to show available instance methods // on self::$oInstance-> self::$oInstance->display(); } } NewClass::singleton()->display(); // It would be great to be able to see available static trait // methods when pressing Ctrl space after typing NewClass:: // Also available instance methods after typing NewClass::singleton()->
fixed
reopened it,since the issue mentioned comment 4 has not been fixed yet ,and lots of php 5.4 new changes are not fixed.
reopen it...
Nice one Zhongwei... glad you reopened this bug report... I tested this last night after I noticed you marked this as fixed but I couldn't get it to work... so I thought I was missing something. I also noticed that I made a copy error with the function name singleton it should have read getSingleton in the function call examples like so. NewClass::getSingleton()->display(); Looking forward to the fix updates Thanks
Sorry Chris, that we didn't added this yet. Let's keep this bug just for updating parser to 5.4 syntax. I opened separate bug for improvements in Content Assist - see bug 385837
marking as fixed
Hey Jacek, Sure that makes sense to create a separate bug for 5.4 syntax. No problem thanks to you all... great stuff guys...
Verified. Closing according to Jacek's comment: "Let's keep this bug just for updating parser to 5.4 syntax." Ilina Stefanova