I have a problem with a constructor that I am trying to create in php, I don't understand why I get a syntax error when I write the constructor in this way:
I don't understand is it due to the version of php or what am I doing wrong, now if I remove all the public on screen from the constructor it prints the following error:
Catchable fatal error: Argument 1 passed to Product::__construct() must be an instance of string, string given
I don't understand that error either, my class and my function are being called in this way:
$producto = new Producto('Teclado', 200, true);
$producto->mostrarProducto();
echo "<pre>";
var_dump($producto);
echo "</pre>";