Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Session
- JavaScript
- 경영
- composer-php
- Apache
- Forms
- 무료다운로드쿠폰
- OOP
- UTF-8
- php
- HTML
- MySQL
- JSON
- jquery
- curl
- date
- 웹하드순위
- function
- Regex
- file-upload
- Arrays
- Linux
- 웹하드추천
- variables
- 전략
- Laravel
- Ajax
- post
- string
Archives
- Today
- Total
개발! 딱 깔끔하고 센스있게!
구문 분석 오류 : 유효하지 않은 숫자 리터럴 본문
다음 코드를 실행할 때 다음 오류가 발생합니다:
코드:
오류:
Parse error: Invalid numeric literal.
왜 이 문제가 생겼는지 어떻게 해결해야 합니까?
대답
php7 에서 정수 처리 (특히 팔진수) 방식의 변경 (opsoed to php5) 에서 나온 것이다.
문서 (php7 이전)
Invalid octal literals
Previously, octal literals that contained invalid numbers were silently truncated (0128 was taken as 012). Now, an invalid octal literal will cause a parse error.
전체 문서에서
Prior to PHP 7, if an invalid digit was given in an octal integer (i.e. 8 or 9), the rest of the number was ignored. Since PHP 7, a parse error is emitted.
혹은 문자열 또는 실제 정수
$a = array(1, 8, 9, 12); // Integers $a = array("00001", "00008", "00009", "00012"); // Strings
- Example of PHP7 vs PHP5: https://3v4l.org/GRZF2
- http://php.net/manual/en/language.types.integer.php
- Manual: http://php.net/manual/en/migration70.incompatible.php
'개발 스크랩 메모 > PHP' 카테고리의 다른 글
PHP 인 코딩 모드 되 돌리 기; switch / case 에서 (0) | 2020.11.20 |
---|---|
PHP 폼 토큰 사용 및 처리 (0) | 2020.11.20 |
확인란 상태가 항상 PHP 스크립트로 전달되는 것은 아닙니다. (0) | 2020.11.20 |
POST 안드로이드로 PHP 배열 보내기 (0) | 2020.11.20 |
HTTP 쿼리 문자열 변수로 PHP 리디렉션 (0) | 2020.11.20 |
Comments