Does PHP have an answer to Java style class generics?

前端 未结 8 1508
天命终不由人
天命终不由人 2020-12-24 01:09

Upon building an MVC framework in PHP I ran into a problem which could be solved easily using Java style generics. An abstract Controller class might look something like thi

8条回答
  •  清酒与你
    2020-12-24 02:05

    You can consider to switch to Hack and HHVM. It is developed by Facebook and full compatible to PHP. You can decide to use or

    It support that what you want:

    http://docs.hhvm.com/manual/en/hack.generics.php

    I know this is not PHP. But it is compatible with it, and also improves your performance dramatically.

提交回复
热议问题