非法抵消&其他各种错误 [英] Illegal Offset & Other Assorted Errors

查看:71
本文介绍了非法抵消&其他各种错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试写一个小脚本上有几个错误。错误消息是:

展开 | 选择 | Wrap | 行号

解决方案

嘿。


看起来你传递的函数是第一个参数的无效值。如果您添加 var_dump(


名称)在那里,它打印什么?


在这样的函数中验证输入值总是一个好主意。特别是如果您打算重复使用它们。它为您提供了更好的调试数据,并且使用户不得不查看错误。


第二个错误告诉您什么?在两行中,您提供了一个对象而不是预期的对象字符串。

Got a couple of errors on a little script I''m trying to write. The error messages are:

Expand|Select|Wrap|Line Numbers

解决方案

Hey.

It would appear that you are passing the function an invalid value for the first parameter. If you add a var_dump(


name) in there, what does it print?

It''s always a good idea to verify input values in function like that. Especially if you plan to reuse them. It gives you better debug data, and spares the user having to see the errors.


the second error tells you what?s up, in both lines, you feed an object instead of the expected String.


这篇关于非法抵消&其他各种错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆