Shaffanhoon Shaffanhoon - 1 month ago 21
PHP Question

Strict standards: Declaration of DatabaseAccess::get() should be compatible with medoo::get($table, $join = NULL, $column = NULL, $where = NULL)

I am encountering this error when trying to run a site using WAMP.

But it works fine on my LAMP VM.

The parent function has this signature:

public function get($table, $join = null, $column = null, $where = null)
{


And it is extended like so:

class DatabaseAccess extends Medoo
{
public function get($table, $columns, $where = null)
{
return parent::get($table, $columns, $where);
}


Is WAMP more strict with this or am I missing something obvious?

Answer

You are overriding the method with a different signature. This would broke inheritance if was allowed. Why would you extend a database adapter at all? Just use it as is or wrap in a new class instead of inheritance if you want a simpler interface.

Edit: BTW You can probably fix this by disabling strict standards.

error_reporting(E_ALL & ~E_STRICT)