Swift has nothing similar to PHP 7. Typing in PHP 7 is ridiculous - you can set &quot;Array&quot; as a &quot;strict&quot; type of return value, but inside that array you can have whole universe. And any optional type system is not a type system at all. I learned it when tried Dart.
PHP 7 is too primitive in comparison with Swift.