diff --git a/NEWS b/NEWS index 78b1e53fbdf..cfacdb35247 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,7 @@ PHP NEWS respect scientific notation in numeric strings. (Andrea) . Implemented the RFC `Catching multiple exception types`. (Bronislaw Bialek, Pierrick) + . Raise a compile-time warning on octal escape sequence overflow. (Sara) - FTP: . Implemented FR #55651 (Option to ignore the returned FTP PASV address). diff --git a/Zend/tests/oct_overflow_char.phpt b/Zend/tests/oct_overflow_char.phpt new file mode 100644 index 00000000000..14a9bb4aeb5 --- /dev/null +++ b/Zend/tests/oct_overflow_char.phpt @@ -0,0 +1,10 @@ +--TEST-- +Octal overflow in string interpolation +--FILE-- + '3')) { + /* 3 octit values must not overflow 0xFF (\377) */ + zend_error(E_COMPILE_WARNING, "Octal escape sequence overflow \\%s is greater than \\377", octal_buf); + } + *t++ = (char) ZEND_STRTOL(octal_buf, NULL, 8); } else { *t++ = '\\';