Scope Resolution Operator (::)

The Scope Resolution Operator (also called Paamayim Nekudotayim) or in simpler terms, the double colon, is a token that allows access to static, constant, and overridden members or methods of a class.

When referencing these items from outside the class definition, use the name of the class.

Paamayim Nekudotayim would, at first, seem like a strange choice for naming a double-colon. However, while writing the Zend Engine 0.5 (which powers PHP 3), that’s what the Zend team decided to call it. It actually does mean double-colon – in Hebrew! :)

class MyClass {
const CONST_VALUE = 'A constant value';
}

echo MyClass::CONST_VALUE;
?>

Two special keywords self and parent are used to access members or methods from inside the class definition. :o Calling a parent’s method

class MyClass
{
protected function myFunc() {
echo "MyClass::myFunc()n";
}
}

class OtherClass extends MyClass
{
// Override parent's definition
public function myFunc()
{
// But still call the parent function
parent::myFunc();
echo "OtherClass::myFunc()n";
}
}

$class = new OtherClass();
$class->myFunc();
?>

Visibility in PHP

The visibility of a property or method can be defined by prefixing the declaration with the keywords: public, protected or private. Public declared items can be accessed everywhere. Protected limits access to inherited and parent classes (and to the class that defines the item). Private limits visibility only to the class that defines the item.

A note about private members, the doc says “Private limits visibility only to the class that defines the item” this says that the following code works as espected:

class A {
private $_myPrivate="private";

public function showPrivate()
{
echo $this->_myPrivate.”n”;
}
}

class B extends A {
public function show()
{
$this->showPrivate();
}
}

$obj=new B();
$obj->show(); // shows “privaten”;
?>

this works cause A::showPrivate() is defined in the same class as $_myPrivate and has access to it.

You may define grouped variables separated by commas if they have the same visibility. This works for both initialized and uninitialized variables.

class Window
{
public $x = 0, $y = 100, $width = 1024, $height = 768;
}
?>

Handy if no comments are required or you’re inside a DocBlock.

Why PHP Hacks?

The term hacking has a bad reputation in the press. They use it to refer to someone who breaks into systems or wreaks havoc with computers as their weapon. :o

Among people who write code, though, the term hack refers to a “quick-and-dirty” solution to a problem, or a clever way to get something done.

And the term hacker is taken very much as a compliment, referring to someone as being creative, having the technical chops to get things done.

The Hacks series is an attempt to reclaim the word, document the good ways people are hacking, and pass the hacker ethic of creative participation on to the uninitiated.

Seeing how others approach systems and problems is often the quickest way to learn about a new technology. :)

Source Insight

Source Insight has been continuously improved for over ten years. I believe that Source Insight will improve your productivity and increase your enjoyment of programming.

There is a pit for PHP programming, That is do not support PHP color programming ,and  chinese  support is not very good!

you can import custom file setting  Source Insight support PHP

And now I tell how to do

To import a custom language file into Source Insight:

1. Select Options > Preferences. Click the Languages tab.

2. Click the Import button. Select and load the custom language file (.CLF)

3. You should now see the new language in the list of languages.

4. Click the Document Types button to open the Document Options dialog box.

5. If you don’t have a document type already created for the type of language file, you will need to create one now. If you already have a document type created, select it in the list and go to step 7.

6. Click the Add Type button to create a new document type.  Give it a name that describes the type of file. For example, “Ant File”. Click OK and then fill in the file filter text box with a wildcard.  For example, “*.ant”.

7. In the Parsing section of the Document Options dialog box, select the newly imported language in the language drop-down list. This is what associates your document type with the custom language.

8. Click the Close button to close Document Options. Then click OK to close the Preferences dialog box.

Custom file Download 

Windows server 2008 价格

刚才去微软的网站找点资料,不小心瞄到了 Windows server 2008的价格,倒吸了一口凉气,奶奶的,这么贵!

英文的看得贼不顺眼,翻译一下,英文不好,请原谅 :)

微软公布了Windows Server 2008操作系统八个版本的价格,并表示全球正式发布时间已经定在2008年2月27日。

首先看看八个版本Windows Server 2008的价格:

·Windows Server 2008 Standard(标准版):999美元(含5个客户端访问许可)
·Windows Server 2008 Enterprise(企业版):3999美元(含25个客户端访问许可)
·Windows Server 2008 Datacenter(数据中心版):2999美元/处理器
·Windows Server 2008 for Itanium-based Systems(Itanium系统版):2999美元/处理器
·Windows Web Server 2008: 469美元
·Windows Server 2008 Standard without Hyper-V(标准版无Hyper-V):971美元(含5个客户端访问许可)
·Windows Server 2008 Enterprise without Hyper-V(企业版无Hyper-V):3971美元(含25个客户端访问许可)
·Windows Server 2008 Datacenter without Hyper-V(数据中心版无Hyper-V):2971美元/处理器

除了Windows Server 2008 for Itanium-based Systems只有64-bit版本外,其余七个Windows Server 2008都分32-bit和64-bit。另外,微软还特意准备了无Hyer-V的标准版、企业版、数据中心版,这样用户就可以节省28美元。Hyper-V是微软的服务器虚拟化技术,并只能在64-bit软件上使用,所以微软还会单独出售Hyper-V Server虚拟化服务,售价也是28美元。

俺穷人是用不起了,就算是vista home 版本的也买不起,等中国哪天也出现一个因为下了一千首MP3做了18个月牢的例子时,俺就继续使用ubuntu去,呵呵