PHP: How to instantiate a class with arguments from within another class

后端 未结 6 570
死守一世寂寞
死守一世寂寞 2021-02-07 13:48

I am in a situations where i need to instantiate a class with arguments from within an instance of another class. Here is the prototype:

//test.php

class test
{         


        
6条回答
  •  执笔经年
    2021-02-07 14:18

    We're in 2019 now and we have php7 now... and we have the spread-operator (...) . We can now simply call

提交回复
热议问题