Is it possible to use mixins in php

前端 未结 5 2052
猫巷女王i
猫巷女王i 2020-12-08 19:33

I came to know about mixins.So my doubt is, is it possible to use mixins in php?If yes then how?

5条回答
  •  忘掉有多难
    2020-12-08 20:13

    First google result for "php5 mixin": http://www.sitepoint.com/forums/php-application-design-147/ruby-like-mixins-php5-332491.html

    First google result for "php mixin": http://www.advogato.org/article/470.html

    Short answer: yes, but not natively (yet, evidently, as @mchl notes). Check those out.

    Longer answer: if you're using runkit, checkout runkit_method_copy(): "Copies a method from class to another."

提交回复
热议问题