[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Edlug Archive Mar 2004 ]

[edlug] PHP Problem



Hi folks,

I'm using apache 2 and PHP 4.3.4  and I'm getting some unexpected
behaviour.  The following code:

	$v1 = "val 1";
	$v2 = "val 2";
	$v3 = "val 3";

	$val = $v1 ? $v1 : $v2 ? $v2 : $v3;

	echo $val;

yields "val 2",  I would have expected it to yield "val 1", as does

	$val = $v1 ? $v1 : ($v2 ? $v2 : $v3);

Can anyone confirm this?


-
----------------------------------------------------------------------
You can find the EdLUG mailing list FAQ list at:
http://www.edlug.org.uk/list_faq.html



This archive is kept by wibble@morpheux.org.DONTSPAMME
homepage