PHP Warning: invalid line offset

I am new to PHP. Today, PHP was ported from version 5.3.3 to 5.4.4 (Debian Squeeze to Debian Wheezy), and after that I get this error from the Apache log:

PHP Warning: invalid string offset "phptype" in xyz

Line:

self::$conn[$dsn['phptype']] = $mdb2;

I need help with system recovery.

+5
source share
2 answers
<?php
$a = 'Hello';
echo $a['whatever'];
?>

As some of the guys in the comments say, doing something like this is likely to lead to this error. As you can see in the above example $a, this is a string, not an array. This means that you cannot access it with the key (if you want to get the third letter in the string, it would be ok to do $a[2]).

, self::$conn $dsn , . . , , :

var_dump(self::$conn, $dsn)

+4

, . .

0

All Articles