Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
function myLog(string $message): string
function myLog($message: string): string // тип всегда через двоеточие после объявления
function string myLog(string $message) // тип всегда перед объявлением через пробел
не контекстно зависимый
public static static foo() {}
// vs
public static foo() : static {}
function myLog($message: string): string
function string myLog(string $message)
The strict_types directive only affects the specific file it is used in, and does not affect either other files which include the file, nor other files that are included by the file.
<?php
declare(strict_types=1) {
require "file.php";
}
Сравнение систем типов PHP7 и Hack