Catchable fatal error: Argument 1 passed to Includer::__construct() must be an instance of string, string given, called in C:\wamp\www\imitizer\includes\classes\settings.php on line 27 and defined in C:\wamp\www\imitizer\includes\classes\includer.php on line 3
erm... "must be an instance of string, string given,"
---
Here is the code; I'm still partially new to constructs, and I need to pass on a parameter through it...
settings.php
function includer(){
$includer = new Includer("index.php");
echo $includer;
}
includer.php
class Includer {
function __construct(string $p){
return $p;
}
}
I have tried experimenting with the string type - without it i get a fancy error saying it couldn't be converted.
Catchable fatal error: Object of class Includer could not be converted to string in C:\wamp\www\imitizer\includes\classes\settings.php on line 29
Thanks


Help




Promote to Article













