What does $shipping_modules = new shipping($shipping); mean?
What does the following code mean?
开发者_高级运维$shipping_modules = new shipping($shipping);
...
$shipping_modules = new shipping($shipping);
The new instance of class shipping is assigned to variable $shipping_modules there by allowing you to access class methods/properties. Finally, $shipping variable is passed to the constructor of shipping class.
$shipping_modules = new shipping($shipping);
1 2 3 4
where:
- assigns new instance of
shippingclass to$shipping_modulesvariable newoperator to create instance of the class- The class name eg
shipping - The variable
$shippingpassed to constructor of the class.
See PHP OOP Tutorial
It means:
- Create a new shipping object
- In doing so, pass the $shipping variable to the __construct function of the shipping object
- Then assign this new object to the $shipping_modules variable
加载中,请稍侯......
精彩评论