tags:

views:

195

answers:

2

http://php.net/manual/en/mysqli.init.php

$ConnectionResource = mysqli::init();

The above code fails with:

Fatal error: Non-static method mysqli::init() cannot be called statically

How come?

A: 

Because it needs to be called on a mysqli instance.

Ignacio Vazquez-Abrams
+1  A: 

that's just stupid notation used in the manual, obviously they use class->property and class::method without regard for the actual language and its distinction between instance- and class-member access (-> vs. ::). see example 1 at http://www.php.net/manual/en/mysqli.real-connect.php

just somebody