Project

General

Profile

Actions

Task #72785

closed

Task #72292: PHP7 >= only

Add declare(strict_types=1); on every PHP file

Added by Alexander Opitz about 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2016-01-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Sprint Focus:

Actions #1

Updated by Mathias Brodala about 8 years ago

Do we really need this in every file or in the access points (currently /index.php, typo3/index.php and typo3/cli_dispatch.phpsh) only?

Actions #2

Updated by Alexander Opitz about 8 years ago

As documented in every file.

Actions #3

Updated by Mathias Brodala about 8 years ago

Ah thanks, didn't know that the declaration of included files was respected in addition to the calling file.

Actions #4

Updated by Markus Klein about 8 years ago

There seems to be a contradiction in the docs.

http://php.net/manual/en/control-structures.declare.php
says:

The declare construct can also be used in the global scope, affecting all code following it (however if the file with declare was included then it does not affect the parent file)

So setting the declare() once in the entry script should actually force this for all included files as well.

Actions #5

Updated by Mathias Brodala about 8 years ago

Markus Klein wrote:

So setting the declare() once in the entry script should actually force this for all included files as well.

Thanks for confirming. :-)

Actions #6

Updated by Alexander Opitz almost 8 years ago

  • Status changed from On Hold to Resolved

New classes will get the declare statement.

Actions #7

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF