최신 그누보드 php 문법 에러?
본문
답변 3
문법 오류 아닙니다.
+ Instruction separation (명령 구분)
- https://www.php.net/manual/en/language.basic-syntax.instruction-separation.php
Note:
The closing tag of a PHP block at the end of a file is optional, and in some cases omitting it is helpful when using include or require, so unwanted whitespace will not occur at the end of files, and you will still be able to add headers to the response later. It is also handy if you use output buffering, and would not like to see added unwanted whitespace at the end of the parts generated by the included files.
- http://docs.php.net/manual/kr/language.basic-syntax.instruction-separation.php
Note:
파일의 마지막에서 PHP 블록의 닫기 태그를 생략할 수 있으며, 때로는 유용합니다. include나 require를 사용할 경우, 원하지 않은 공백이 파일 마지막에 들어가지 않게 함으로써, 나중에 추가 응답 헤더를 추가할 수 있습니다. 또한 출력 버퍼링을 사용할 경우에도 포함한 파일들에 의해서 각 파트의 마지막에 원하지 않은 공백을 피할 수 있으므로 도움이 됩니다.
최근에 업데이트하면서 제거했어요.
파일 마지막은 제거한 게 오히려 좋데요.
php 제작자가 권고한 내용입니다.