Does the PHP function use objects or fixed parameters to pass values?

problem description

when you add a layer in the middle of the MVC to pass parameters from the controller to this layer, do you want to pass the value with a fixed parameter, or do you instantiate it and save the value to the property of the object? Is that better?

the environmental background of the problems and what methods you have tried

optimize

related codes

1.
$this- > s-> attributes = "123 all ();;
$this- > s-> all ();
2.
$num =" 123 num;
$this- > s-> all ($num);

what result do you expect? What is the error message actually seen?

which is better and more mainstream? Why?

Php
Mar.29,2021

isn't it written as follows

  

look at your 123 use it only once, or $this- > s there are a lot of places to use

.
Menu