> > I compiled 5.2.5 last night and noticed that it effectively breaks all
> > static calls which have no static keyword assigned in the function's
> > definition (sorry, a bit clumsy here).       ....

How about waiting to break people's :: calls to non-static functions
until some number of releases or amount of time after traits are
introduced?  For years, making :: calls to non-static functions has
been the php way to write traits.  (OK, this lacks a lot of the
features of full traits, but it's better than nothing.)  Isn't it 
fair to provide an alternative and some time to switch to the 
alternative before making the old way fatal?

In case it isn't clear how you could write a trait, here's a
silly example:  (A full example would have more interesting code
that would be re-used by a variety of objects, but this example
demonstrates the key abilities of php without the distractions
of doing something useful.)

<?php
class Trait {
   function e() {
      print $this->g()."\n";
   }
   function f() {
      Trait::e();
   }
}

class Obj {
   function g() {
      return 5;
   }
   function h() {
      Trait::f();
   }
}

$o = new Obj;
$o->h();
?>

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

Reply via email to