ZF2-537: 'ProvidesEvents' uses traits which is part of PHP 5.4

Issue Type: Bug Created: 2012-09-10T10:10:12.000+0000 Last Updated: 2012-09-11T05:10:53.000+0000 Status: Resolved Fix version(s): Reporter: Saji Nediyanchath (saji89) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend\EventManager

  • 5.3
  • php

Related issues: Attachments:


Zend Framework 2.0 is said to be based on PHP 5.3. But I found that it is using PHP 5.4 feature 'traits' in the file: zf2/library/Zend/EventManager/ProvidesEvents.php. Is it a mistake or should we expect more such PHP 5.4 related features, which is not usable in PHP version 5.3?


Posted by Ben Scholzen (dasprid) on 2012-09-10T10:20:56.000+0000

This is not an issue, as this one is not using traits, but is a trait itself to be used within your PHP 5.4 application. It does not break anything when you don't use it.

Posted by Matthew Weier O'Phinney (matthew) on 2012-09-10T14:11:59.000+0000

Saji -- we're providing some forwards-compatible features for 5.4. However, internally, we are not using them within the framework; they are merely there for the convenience of those who are using 5.4 for their applications. We will be providing a number of traits going forward, but, as noted, not consuming them directly within the framework.

Posted by Saji Nediyanchath (saji89) on 2012-09-11T04:52:26.000+0000

Ben, and Matthew, Thanks for the clarifications.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.