In the index.php file, there are
echo New Form ("index.php"); A form is a class that has a construction method inside it.
echo New Result ();
What does this mean, new is not creating an object? So the output object can also ah. What's the name of the object you created?
Report:
The form class is constructed in the following way:
function __construct () {
$this->action= $action;
$this->shape=isset ($_get["action"])? $_get["Action"]: "rect";
}
Reply to discussion (solution)
echo New Form ("index.php"); An instantiated object of the output form, which is an object. Use the Echo output will be error, to use Print_r (); Printing is only a line.
Will not be called at the same time, the construction method in the form: Pass the object containing the index.php to the $action
Yes, but do you want to change the constructor to __construct ($action)?
Amount, yes. What is the name of the instantiated object?
echo New Result ();
Equivalent
$p = new Result ();
Echo $p;
The precondition for this notation is that the __tostring method is defined in the class
The __tostring method is to convert an instance of this class into a string, and of course what you decide
Oh... So ... There is a __tostring () method behind it: Doshe