PHP const and static variables

In addition to that const variables can’t be changed, another difference between const and static is that some variables like arrays are not allowed in class constants, so

class mytest
{
public static $c = array(1=> 'hello', 2=>'world');
}

works, but

class mytest
{
const c = array(1=> 'hello', 2=>'world');
}

won’t.

Strange Hadoop error caused by the CDPATH environment variable

When I tried to run hadoop in my Linux box, I got a strange error:

bin/hadoop: line 53: /home/hzhang/tools/hadoop-0.20.203/bin
/home/hzhang/tools/hadoop-0.20.203/bin/hadoop-config.sh: No such file or directory

It said the hadoop-config.sh is missing, but clearly it’s there in my machine. After hair-scratching for quite a bit, I found out that it’s the line before 53 that caused error

bin=`dirname "$0"`
bin=`cd "$bin"; pwd`

The reason is that I activated CDPATH in my shell, and the $bin variable therefore contains the same path repeated twice. All I have to do is turn it off by the following command:
$ unset CDPATH