LoginSignup
1
1

More than 5 years have passed since last update.

php 5.3 の Cannot use string offset as an array

Last updated at Posted at 2013-01-21

次のコードは php 5.3 と 5.4 で結果が異なります。

<?php
$str = "hoge";
var_dump($str[0][0]);

5.4 の場合

string(1) "h"

5.3 の場合

Fatal error: Cannot use string offset as an array in /home/ng/z.php on line 3

php 5.3 では、文字列のオフセット指定に、さらにオフセット指定することは出来ないようです(普通しないですが)。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1