当值为整数时不支持的操作数类型


Unsupported operand types when value is integer

尝试将 2 添加到整数时出现此错误。我正在使用Codeigniter框架。

致命错误:第 180 行的 D:''wamp''www''应用程序''库''Gen_images.php中不支持的操作数类型

这是它的名字:

// Now process the image
var_dump($this->upload->data('image_width'));
$this->gen_login->resize($file_name, $this->upload->data('image_width'), $this->upload->data('image_height'));

我收到line 180错误是:

$config['width'] = $width + 2;

所以我认为$width一定是一个数组或字符串,所以我无法添加到它,但var dump显示了这一点:

array
  'file_name' => string 'genyx_1341414096.jpg' (length=20)
  'file_type' => string 'image/jpeg' (length=10)
  'file_path' => string 'D:/wamp/www/beer/uploads/' (length=25)
  'full_path' => string 'D:/wamp/www/beer/uploads/genyx_1341414096.jpg' (length=45)
  'raw_name' => string 'genyx_1341414096' (length=16)
  'orig_name' => string 'genyx_1341414096.jpg' (length=20)
  'client_name' => string '294207_177080222375077_100002193022560_361510_991268937_s.jpg' (length=61)
  'file_ext' => string '.jpg' (length=4)
  'file_size' => float 55.85
  'is_image' => boolean true
  'image_width' => int 720
  'image_height' => int 479
  'image_type' => string 'jpeg' (length=4)
  'image_size_str' => string 'width="720" height="479"' (length=24)

谁能帮我?

上面

显示的任何代码中都没有名为 $width 的变量...

$width绝对不是字符串。我可以保证。