# PHP 5.6.x 版本遷移至 PHP 7.0.x 版本
## 7.0.x版本開始停用的特性
### PHP4風格的構造函數
在PHP4中類中的函數可以與類名同名,這一特性在PHP7中被廢棄,同時會發出一個 E_DEPRECATED 錯誤。當方法名與類名相同,且類不在命名空間中,同時PHP5的構造函數(__construct)不存在時,會產生一個E_DEPRECATED錯誤。
```PHP
<?php
class foo {
function foo() {
echo 'I am the constructor';
}
}
?>
```
上述代碼輸出:
```PHP
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; foo has a deprecated constructor in example.php on line 3
```
### password_hash() 隨機因子選項
函數原salt量不再需要由開發者提供了。函數內部默認帶有salt能力,無需開發者提供salt值。
## 用戶貢獻記錄
暫無