S
S
Sergey Pugovkin2016-11-27 03:48:28
Yii
Sergey Pugovkin, 2016-11-27 03:48:28

Error: Undefined offset: 1 - well, now how to find the cause of the error?

I run the script in the console, something like this
/console-script controller/action
I get an error:
Error: Undefined offset: 1
Is this a joke? How to find the line and, accordingly, the cause of the error?
There is nothing in the php log.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
index0h, 2016-11-27
@Driver86

The reason for the error is already indicated by you: you are accessing a non-existent array element.
Forget about the existence of errors, and smeared with exceptions.
Validate input in every method, always.
The easiest way to find a bug is with xdebug

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question