brianhaveri/Underscore.php

list() function causing problems

Closed this issue · 5 comments

It seems the list() function is being used incorrectly:

list($one, $two) = array('one')

While this produces what is usually the desired result in the code ($one is set to 'one' and $two is set to NULL), this isn't technically a correct use of list() and produces an undefined offset notice.

Hey Matt,

Do you have a particular line number that's producing the error?

I see what the issue is now. I'll try patching this later today.

I got your message as I was writing a reply, but for what it's worth I ran into the problem in without(), which goes through the list() on line 250. The PHPUnit tests show problems on other lines too, though.

And I didn't mean to close it yet, sorry about that.

Thanks for reporting this. I accidentally had PHP notices turned off on my machine, so I didn't see these errors until you raised the issue. The notices should be cleaned up now.

73c4ef2ccc1f648b9325