The non-static mysqli :: init () method cannot be called static

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

$ConnectionResource = mysqli::init(); 

The above code does not work:

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

How did it happen?

+4
source share
1 answer

this is just the silly notation used in the manual, obviously they use class->property and class::method without taking into account the actual language and its difference between access to the instance and class ( -> vs. :: :). see example 1 at http://www.php.net/manual/en/mysqli.real-connect.php

+6
source

Source: https://habr.com/ru/post/1303427/


All Articles