Page 1 of 1

List construct causing Invalid Opcode errors?

Posted: Wed Jul 19, 2006 10:14 am
by sunfish62
I recently had to reinstall everything on my machine due to a drive crash, and now that I've reinstalled, the code I was developing started crashing with an Invalid Opcode error at every point where I used the the command:

List($var1, $var2) = "";

I quickly found that if I split it into individual commands, e.g.:

$var1 = "";
$var2 = "";

everything works fine. But I am curious why this error is happening? I am running Win2K with Apache/2.0.55 (Win32) PHP/5.1.2
Can anyone inform me?

Thanks!

David

Posted: Wed Jul 19, 2006 10:48 am
by Ward
I think the correct syntax would be:

Code: Select all

list($var1, $var2) = array("","");

Maybe you had error_reporting set differently on your previous installation?

Posted: Wed Jul 19, 2006 11:35 am
by sunfish62
Yeah, you're right about the syntax. But the error is fatal, so I would imagine that I would have seen it before regardless of my config settings. So, I'm not sure why it would have worked ever...