Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] Traits and Conflicts: Collisions as Warnings or Fatal? [RSS Feed]

#1 Dec. 5, 2010 14:54:15

Benjamin E.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Traits and Conflicts: Collisions as Warnings or Fatal?


I wondered before why this only triggers a warning. A fatal error sounds good
at that point in my opinion.

It is comparable to interfaces/Abstract classes being implemented wrong and
this also leads to a fatal error. Additionally there is no way this "just"
happens to your code. You have to make changes to a trait explicitly to trigger
this problem, so this is only happening in development.

greetings,
Benjamin

On Sun, 5 Dec 2010 15:03:55 +0100
Stefan Marr <p...@stefan-marr.de> wrote:

> Hi:
>
> While preparing some explanations on how to use traits, I stumbled over an
> inconsistency in the current implementation.
>
> Currently collisions, if they are explicit in the code, lead to a warning and
> are resolved by explicit exclusion of the two methods that collide.
> However, there are other ways to provoke a collision, for instance by
> introducing a new alias during composition.
>
>
>http://svn.php.net/viewvc/php/php-src/trunk/Zend/tests/traits/error_015.phpt?revision=305512&view=markup>
>http://svn.php.net/viewvc/php/php-src/trunk/Zend/tests/traits/language010.phpt?revision=305512&view=markup>
>
> Collisions usually point to implementations that changed unexpectedly, and
> the implicit resolution might be problematic since it could hide the real
> cause for a bug.
>
> So, should that warning be changed to a fatal error, or should the other
> fatals be warnings, too?
>
> Best regards
> Stefan
>
> --
> Stefan Marr
> Software Languages Lab
> Vrije Universiteit Brussel
> Pleinlaan 2 / B-1050 Brussels / Belgium
>http://soft.vub.ac.be/~smarr> Phone: +32 2 629 2974
> Fax: +32 2 629 3525
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit:http://www.php.net/unsub.php>

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#2 Dec. 7, 2010 12:05:02

Derick R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Traits and Conflicts: Collisions as Warnings or Fatal?


On Sun, 5 Dec 2010, Stefan Marr wrote:

> While preparing some explanations on how to use traits, I stumbled
> over an inconsistency in the current implementation.
>
> Currently collisions, if they are explicit in the code, lead to a
> warning and are resolved by explicit exclusion of the two methods that
> collide. However, there are other ways to provoke a collision, for
> instance by introducing a new alias during composition.
>
>
>http://svn.php.net/viewvc/php/php-src/trunk/Zend/tests/traits/error_015.phpt?revision=305512&view=markup>
>http://svn.php.net/viewvc/php/php-src/trunk/Zend/tests/traits/language010.phpt?revision=305512&view=markup>
>
> Collisions usually point to implementations that changed unexpectedly,
> and the implicit resolution might be problematic since it could hide
> the real cause for a bug.
>
> So, should that warning be changed to a fatal error, or should the
> other fatals be warnings, too?

IMO they should be fatal because your code is "broken".

Derick

--http://derickrethans.nl|http://xdebug.orgLike Xdebug? Consider a donation:http://xdebug.org/donate.phptwitter: @derickr and @xdebug

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

  • Root
  • » PHP
  • » [PHP-DEV] Traits and Conflicts: Collisions as Warnings or Fatal? [RSS Feed]

Board footer

Moderator control

Enjoy the 18th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support