After checking on the internet, php needs to encode its own code to implement the chain, and it seems that it can only be a method and then call the method. However, what I want to implement is a chain like this. After the new entity is added, the method is called: {code ...} it seems that it cannot be implemented, even if return $ this in the constructor,... after checking on the internet, php needs to encode its own code to implement the chain, and it seems that it can only be a method and then call the method.
But what I want to implement is a chain like this. It is the method to call after the new object is created:
New MyClass ()-> setData ('1 ');
It seems that it cannot be implemented, even in the constructorReturn $ this
But the IDE still prompts errors.
Reply content:
After checking on the internet, php needs to encode its own code to implement the chain, and it seems that it can only be a method and then call the method.
But what I want to implement is a chain like this. It is the method to call after the new object is created:
New MyClass ()-> setData ('1 ');
It seems that it cannot be implemented, even in the constructorReturn $ this
But the IDE still prompts errors.
(New MyClass ()-> setData ('1 ');