summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2008-02-23 17:06:22 +0000
committerMarcus Boerger <helly@php.net>2008-02-23 17:06:22 +0000
commitd3e50265643fc59c2b5c99ef4ac79e758a6d9839 (patch)
treed8e4f0da41e03fd9e59892e12836ed81130a65fe
parent6c5041979c9b0f9f05ac92427da53b60f6f6e7c3 (diff)
downloadphp-git-d3e50265643fc59c2b5c99ef4ac79e758a6d9839.tar.gz
- MFH Add E_DEPRECATED (Lars Strojny, Felipe Pena, Marcus)
[DOC] Finally added deprecation messages
-rw-r--r--NEWS2
-rw-r--r--Zend/tests/bug33771.phpt6
-rwxr-xr-xZend/tests/bug34767.phpt4
-rw-r--r--Zend/tests/error_reporting01.phpt2
-rw-r--r--Zend/tests/error_reporting02.phpt2
-rw-r--r--Zend/tests/error_reporting03.phpt2
-rw-r--r--Zend/tests/error_reporting04.phpt2
-rw-r--r--Zend/tests/error_reporting05.phpt2
-rw-r--r--Zend/tests/error_reporting06.phpt2
-rw-r--r--Zend/tests/error_reporting07.phpt2
-rw-r--r--Zend/tests/error_reporting08.phpt2
-rw-r--r--Zend/tests/error_reporting09.phpt2
-rw-r--r--Zend/tests/error_reporting10.phpt4
-rwxr-xr-xZend/tests/is_a.phpt10
-rw-r--r--Zend/zend.c3
-rw-r--r--Zend/zend_builtin_functions.c2
-rw-r--r--Zend/zend_compile.c4
-rw-r--r--Zend/zend_constants.c1
-rw-r--r--Zend/zend_errors.h3
-rw-r--r--Zend/zend_execute_API.c2
-rw-r--r--Zend/zend_language_parser.y2
-rw-r--r--Zend/zend_vm_def.h2
-rw-r--r--Zend/zend_vm_execute.h2
-rw-r--r--ext/date/php_date.c2
-rw-r--r--ext/mysql/php_mysql.c4
-rw-r--r--ext/standard/basic_functions.c5
-rw-r--r--ext/standard/dl.c4
-rw-r--r--ext/standard/file.c2
-rw-r--r--ext/standard/string.c2
-rw-r--r--ext/standard/tests/file/magic_quotes.phpt26
-rw-r--r--ext/standard/tests/serialize/bug31402.phpt2
-rw-r--r--ext/standard/tests/strings/setlocale_error.phpt4
-rw-r--r--main/main.c4
-rw-r--r--tests/classes/new_001.phpt4
-rw-r--r--tests/lang/bug20175.phpt4
-rw-r--r--tests/lang/bug22231.phpt4
-rw-r--r--tests/lang/bug22510.phpt4
37 files changed, 92 insertions, 44 deletions
diff --git a/NEWS b/NEWS
index be66d679fd..5b43b55b7d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 20??, PHP 5.3.0
+- Add new error mode E_DEPRECATED that informs about stuff that gets dropped in
+ later PHP versions. (Lars Strojny, Felipe, Marcus)
- Added and improved PHP syntax and semantics:
. Added NOWDOC. (Gwynne Raskind, Stas, Dmitry)
. Added "?:" operator. (Marcus)
diff --git a/Zend/tests/bug33771.phpt b/Zend/tests/bug33771.phpt
index a786e58066..5d6f5ca96d 100644
--- a/Zend/tests/bug33771.phpt
+++ b/Zend/tests/bug33771.phpt
@@ -34,7 +34,7 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
-int(8191)
-int(8191)
-int(6143)
+int(16383)
+int(16383)
+int(14335)
Done
diff --git a/Zend/tests/bug34767.phpt b/Zend/tests/bug34767.phpt
index 45af9f944c..eaede243fc 100755
--- a/Zend/tests/bug34767.phpt
+++ b/Zend/tests/bug34767.phpt
@@ -2,7 +2,7 @@
Bug #34767 (Zend Engine 1 Compatibility not copying objects correctly)
--INI--
zend.ze1_compatibility_mode=1
-error_reporting=4095
+error_reporting=E_ALL | E_DEPRECATED | E_STRICT
--FILE--
<?php
$a->y = &new stdClass();
@@ -13,7 +13,7 @@ print_r($b);
?>
--EXPECTF--
-Strict Standards: Assigning the return value of new by reference is deprecated in %sbug34767.php on line 2
+Deprecated: Assigning the return value of new by reference is deprecated in %sbug34767.php on line 2
stdClass Object
(
[y] => stdClass Object
diff --git a/Zend/tests/error_reporting01.phpt b/Zend/tests/error_reporting01.phpt
index 60be023909..a53628ca28 100644
--- a/Zend/tests/error_reporting01.phpt
+++ b/Zend/tests/error_reporting01.phpt
@@ -22,5 +22,5 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECT--
-int(6143)
+int(14335)
Done
diff --git a/Zend/tests/error_reporting02.phpt b/Zend/tests/error_reporting02.phpt
index 227d8c6f26..252700c098 100644
--- a/Zend/tests/error_reporting02.phpt
+++ b/Zend/tests/error_reporting02.phpt
@@ -23,5 +23,5 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECT--
-int(8191)
+int(16383)
Done
diff --git a/Zend/tests/error_reporting03.phpt b/Zend/tests/error_reporting03.phpt
index ec916048df..21770da15a 100644
--- a/Zend/tests/error_reporting03.phpt
+++ b/Zend/tests/error_reporting03.phpt
@@ -31,5 +31,5 @@ echo "Done\n";
?>
--EXPECTF--
Notice: Undefined variable: undef2 in %s on line %d
-int(8191)
+int(16383)
Done
diff --git a/Zend/tests/error_reporting04.phpt b/Zend/tests/error_reporting04.phpt
index 1d7d678b23..21707d356b 100644
--- a/Zend/tests/error_reporting04.phpt
+++ b/Zend/tests/error_reporting04.phpt
@@ -19,5 +19,5 @@ echo "Done\n";
?>
--EXPECTF--
Notice: Undefined variable: undef in %s on line %d
-int(8191)
+int(16383)
Done
diff --git a/Zend/tests/error_reporting05.phpt b/Zend/tests/error_reporting05.phpt
index 71fee17f4c..2ff03e71f2 100644
--- a/Zend/tests/error_reporting05.phpt
+++ b/Zend/tests/error_reporting05.phpt
@@ -30,5 +30,5 @@ echo "Done\n";
Notice: Undefined variable: undef_value in %s on line %d
Notice: Undefined variable: undef_name in %s on line %d
-int(6143)
+int(14335)
Done
diff --git a/Zend/tests/error_reporting06.phpt b/Zend/tests/error_reporting06.phpt
index f472d34051..8a689d5fc3 100644
--- a/Zend/tests/error_reporting06.phpt
+++ b/Zend/tests/error_reporting06.phpt
@@ -26,5 +26,5 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
-int(6143)
+int(14335)
Done
diff --git a/Zend/tests/error_reporting07.phpt b/Zend/tests/error_reporting07.phpt
index 696a3757ed..cd2449a394 100644
--- a/Zend/tests/error_reporting07.phpt
+++ b/Zend/tests/error_reporting07.phpt
@@ -26,5 +26,5 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
-int(6143)
+int(14335)
Done
diff --git a/Zend/tests/error_reporting08.phpt b/Zend/tests/error_reporting08.phpt
index 362aa37650..9018e7ca1c 100644
--- a/Zend/tests/error_reporting08.phpt
+++ b/Zend/tests/error_reporting08.phpt
@@ -28,5 +28,5 @@ echo "Done\n";
?>
--EXPECTF--
Notice: Undefined variable: undef3 in %s on line %d
-int(8191)
+int(16383)
Done
diff --git a/Zend/tests/error_reporting09.phpt b/Zend/tests/error_reporting09.phpt
index 193758148c..76cff2c1da 100644
--- a/Zend/tests/error_reporting09.phpt
+++ b/Zend/tests/error_reporting09.phpt
@@ -27,5 +27,5 @@ echo "Done\n";
Notice: Undefined variable: blah in %s on line %d
Notice: Undefined variable: undef2 in %s on line %d
-int(8191)
+int(16383)
Done
diff --git a/Zend/tests/error_reporting10.phpt b/Zend/tests/error_reporting10.phpt
index 1d0abb10f3..45fee5849d 100644
--- a/Zend/tests/error_reporting10.phpt
+++ b/Zend/tests/error_reporting10.phpt
@@ -30,6 +30,6 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
-int(6143)
-int(6135)
+int(14335)
+int(14327)
Done
diff --git a/Zend/tests/is_a.phpt b/Zend/tests/is_a.phpt
index f24a6aadb3..fd52b5a65a 100755
--- a/Zend/tests/is_a.phpt
+++ b/Zend/tests/is_a.phpt
@@ -1,7 +1,7 @@
--TEST--
is_a() and is_subclass_of() shouldn't call __autoload
--INI--
-error_reporting=4095
+error_reporting=14335
--FILE--
<?php
function __autoload($name) {
@@ -31,16 +31,16 @@ var_dump(is_subclass_of($a, "INT"));
var_dump(is_subclass_of("X1", "X2"));
?>
--EXPECTF--
-Strict Standards: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 17
+Deprecated: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 17
bool(false)
-Strict Standards: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 18
+Deprecated: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 18
bool(true)
-Strict Standards: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 19
+Deprecated: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 19
bool(true)
-Strict Standards: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 20
+Deprecated: is_a(): Deprecated. Please use the instanceof operator in %sis_a.php on line 20
bool(true)
bool(false)
bool(false)
diff --git a/Zend/zend.c b/Zend/zend.c
index 69764c562a..9f9f496572 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -66,7 +66,7 @@ static int (*zend_get_configuration_directive_p)(char *name, uint name_length, z
static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
{
if (!new_value) {
- EG(error_reporting) = E_ALL & ~E_NOTICE & ~E_STRICT;
+ EG(error_reporting) = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED;
} else {
EG(error_reporting) = atoi(new_value);
}
@@ -974,6 +974,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
case E_ERROR:
case E_NOTICE:
case E_STRICT:
+ case E_DEPRECATED:
case E_WARNING:
case E_USER_ERROR:
case E_USER_WARNING:
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index c30163a0b0..2085435e08 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -744,7 +744,7 @@ ZEND_FUNCTION(is_subclass_of)
Returns true if the object is of this class or has this class as one of its parents */
ZEND_FUNCTION(is_a)
{
- zend_error(E_STRICT, "is_a(): Deprecated. Please use the instanceof operator");
+ zend_error(E_DEPRECATED, "is_a(): Deprecated. Please use the instanceof operator");
is_a_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index b95f8eba47..18082c60bb 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -477,7 +477,7 @@ void fetch_array_dim(znode *result, znode *parent, znode *dim TSRMLS_DC)
void fetch_string_offset(znode *result, znode *parent, znode *offset TSRMLS_DC)
{
#ifdef ilia_0
- zend_error(E_STRICT, "Usage of {} to access string offsets is deprecated and will be removed in PHP 6");
+ zend_error(E_DEPRECATED, "Usage of {} to access string offsets is deprecated and will be removed in PHP 6");
#endif
fetch_array_dim(result, parent, offset TSRMLS_CC);
}
@@ -1853,7 +1853,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
if (original_op==ZEND_SEND_REF
&& !CG(allow_call_time_pass_reference)) {
- zend_error(E_COMPILE_WARNING,
+ zend_error(E_DEPRECATED,
"Call-time pass-by-reference has been deprecated; "
"If you would like to pass it by reference, modify the declaration of %s(). "
"If you would like to enable call-time pass-by-reference, you can set "
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index e4ae38420b..3ca4a29e8c 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -101,6 +101,7 @@ void zend_register_standard_constants(TSRMLS_D)
REGISTER_MAIN_LONG_CONSTANT("E_PARSE", E_PARSE, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_NOTICE", E_NOTICE, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_STRICT", E_STRICT, CONST_PERSISTENT | CONST_CS);
+ REGISTER_MAIN_LONG_CONSTANT("E_DEPRECATED", E_DEPRECATED, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_CORE_ERROR", E_CORE_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_CORE_WARNING", E_CORE_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_COMPILE_ERROR", E_COMPILE_ERROR, CONST_PERSISTENT | CONST_CS);
diff --git a/Zend/zend_errors.h b/Zend/zend_errors.h
index 480078d4d2..1f5d0e74bb 100644
--- a/Zend/zend_errors.h
+++ b/Zend/zend_errors.h
@@ -35,8 +35,9 @@
#define E_USER_NOTICE (1<<10L)
#define E_STRICT (1<<11L)
#define E_RECOVERABLE_ERROR (1<<12L)
+#define E_DEPRECATED (1<<13L)
-#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR)
+#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR | E_DEPRECATED)
#define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
#endif /* ZEND_ERRORS_H */
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 8b5b08be59..d7373d86cd 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -937,7 +937,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
}
if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
- zend_error(E_STRICT, "Function %s%s%s() is deprecated",
+ zend_error(E_DEPRECATED, "Function %v%s%v() is deprecated",
EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
EX(function_state).function->common.scope ? "::" : "",
EX(function_state).function->common.function_name);
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index 9c6baca7ef..db73bf5384 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -565,7 +565,7 @@ expr_without_variable:
T_LIST '(' { zend_do_list_init(TSRMLS_C); } assignment_list ')' '=' expr { zend_do_list_end(&$$, &$7 TSRMLS_CC); }
| variable '=' expr { zend_check_writable_variable(&$1); zend_do_assign(&$$, &$1, &$3 TSRMLS_CC); }
| variable '=' '&' variable { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_W, 1 TSRMLS_CC); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$4 TSRMLS_CC); }
- | variable '=' '&' T_NEW class_name_reference { zend_error(E_STRICT, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4, &$7 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); }
+ | variable '=' '&' T_NEW class_name_reference { zend_error(E_DEPRECATED, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4, &$7 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); }
| T_NEW class_name_reference { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$1, &$2 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$1, &$4 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| T_CLONE expr { zend_do_clone(&$$, &$2 TSRMLS_CC); }
| variable T_PLUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 TSRMLS_CC); }
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index bcc9127e7b..e58dc702db 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2067,7 +2067,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
ZEND_VM_NEXT_OPCODE(); /* Never reached */
}
if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
- zend_error(E_STRICT, "Function %s%s%s() is deprecated",
+ zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated",
EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
EX(function_state).function->common.scope ? "::" : "",
EX(function_state).function->common.function_name);
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index c0d1d043f9..0fb064e130 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -133,7 +133,7 @@ static int zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_NEXT_OPCODE(); /* Never reached */
}
if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
- zend_error(E_STRICT, "Function %s%s%s() is deprecated",
+ zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated",
EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
EX(function_state).function->common.scope ? "::" : "",
EX(function_state).function->common.function_name);
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 4637f35d2d..cc446e8e0a 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1241,7 +1241,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
}
/* Support for the deprecated is_dst parameter */
if (dst != -1) {
- php_error_docref(NULL TSRMLS_CC, E_STRICT, "The is_dst parameter is deprecated");
+ php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "The is_dst parameter is deprecated");
if (gmt) {
/* GMT never uses DST */
if (dst == 1) {
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 0bdefa4f2c..2151e38ee1 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -1462,7 +1462,7 @@ PHP_FUNCTION(mysql_db_query)
}
if (MySG(trace_mode) || !strcasecmp(get_active_function_name(TSRMLS_C), "mysql")) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "This function is deprecated; use mysql_query() instead.");
+ php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use mysql_query() instead.");
}
php_mysql_do_query_general(query, mysql_link, id, db, MYSQL_STORE_RESULT, return_value TSRMLS_CC);
@@ -1762,7 +1762,7 @@ PHP_FUNCTION(mysql_escape_string)
Z_TYPE_P(return_value) = IS_STRING;
if (MySG(trace_mode)){
- php_error_docref("function.mysql-real-escape-string" TSRMLS_CC, E_WARNING, "This function is deprecated; use mysql_real_escape_string() instead.");
+ php_error_docref("function.mysql-real-escape-string" TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use mysql_real_escape_string() instead.");
}
}
/* }}} */
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 6475116e3b..72b2081913 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -4934,6 +4934,9 @@ PHP_FUNCTION(set_magic_quotes_runtime)
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &new_setting) == FAILURE) {
RETURN_FALSE;
}
+
+ php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "This function is deprecated and removed in PHP 6. See http://php.net/{migrate}#set_magic_quotes_runtime for details.");
+
convert_to_boolean_ex(new_setting);
PG(magic_quotes_runtime) = (zend_bool) Z_LVAL_PP(new_setting);
@@ -4945,6 +4948,7 @@ PHP_FUNCTION(set_magic_quotes_runtime)
Get the current active configuration setting of magic_quotes_runtime */
PHP_FUNCTION(get_magic_quotes_runtime)
{
+ php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "This function is deprecated and removed in PHP 6. See http://php.net/{migrate}#get_magic_quotes_runtime for details.");
RETURN_LONG(PG(magic_quotes_runtime));
}
/* }}} */
@@ -4953,6 +4957,7 @@ PHP_FUNCTION(get_magic_quotes_runtime)
Get the current active configuration setting of magic_quotes_gpc */
PHP_FUNCTION(get_magic_quotes_gpc)
{
+ php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "This function is deprecated and removed in PHP 6. See http://php.net/{migrate}#get_magic_quotes_gpc for details.");
RETURN_LONG(PG(magic_quotes_gpc));
}
/* }}} */
diff --git a/ext/standard/dl.c b/ext/standard/dl.c
index 7db75d7a42..e4b668139a 100644
--- a/ext/standard/dl.c
+++ b/ext/standard/dl.c
@@ -80,7 +80,7 @@ PHP_FUNCTION(dl)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported in multithreaded Web servers - use extension=%s in your php.ini", Z_STRVAL_P(filename));
RETURN_FALSE;
#else
- php_error_docref(NULL TSRMLS_CC, E_STRICT, "dl() is deprecated - use extension=%s in your php.ini", Z_STRVAL_P(filename));
+ php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "dl() is deprecated - use extension=%s in your php.ini", Z_STRVAL_P(filename));
#endif
}
@@ -97,6 +97,8 @@ PHP_FUNCTION(dl)
#define USING_ZTS 0
#endif
+/* {{{ php_dl
+ */
PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) /* {{{ */
{
void *handle;
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 0fce31af2f..5e6d06996a 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -1382,6 +1382,8 @@ PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC)
{
int ret;
+ php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use php_stream_mkdir() instead.");
+
if (PG(safe_mode) && (!php_checkuid(dir, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
return -1;
}
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 2cf1f43ebd..51505e413b 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -4071,7 +4071,7 @@ PHP_FUNCTION(setlocale)
cat = Z_LVAL_PP(pcategory);
} else { /* FIXME: The following behaviour should be removed. */
char *category;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passing locale category name as string is deprecated. Use the LC_* -constants instead");
+ php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "Passing locale category name as string is deprecated. Use the LC_* -constants instead");
convert_to_string_ex(pcategory);
category = Z_STRVAL_P(*pcategory);
diff --git a/ext/standard/tests/file/magic_quotes.phpt b/ext/standard/tests/file/magic_quotes.phpt
index 4956f63aa6..4ae6726356 100644
--- a/ext/standard/tests/file/magic_quotes.phpt
+++ b/ext/standard/tests/file/magic_quotes.phpt
@@ -1,5 +1,7 @@
--TEST--
various magic quotes tests
+--INI--
+error_reporting=14335
--FILE--
<?php
@@ -41,21 +43,45 @@ var_dump(file_get_contents($filename));
echo "Done\n";
?>
--EXPECTF--
+
+Deprecated: get_magic_quotes_runtime(): This function is deprecated and will be removed in PHP 6. See http://php.net/%s#get_magic_quotes_runtime for details. in %s on line %d
int(0)
+
+Deprecated: get_magic_quotes_runtime(): This function is deprecated and will be removed in PHP 6. See http://php.net/%s#get_magic_quotes_runtime for details. in %s on line %d
int(0)
+
+Deprecated: set_magic_quotes_runtime(): This function is deprecated and will be removed in PHP 6. See http://php.net/%s#set_magic_quotes_runtime for details. in %s on line %d
bool(true)
+
+Deprecated: get_magic_quotes_runtime(): This function is deprecated and will be removed in PHP 6. See http://php.net/%s#get_magic_quotes_runtime for details. in %s on line %d
int(1)
+
+Deprecated: set_magic_quotes_runtime(): This function is deprecated and will be removed in PHP 6. See http://php.net/%s#set_magic_quotes_runtime for details. in %s on line %d
bool(true)
+
+Deprecated: get_magic_quotes_runtime(): This function is deprecated and will be removed in PHP 6. See http://php.net/%s#get_magic_quotes_runtime for details. in %s on line %d
int(1)
string(30) "some\'content\'here\"and}there"
+
+Deprecated: set_magic_quotes_runtime(): This function is deprecated and will be removed in PHP 6. See http://php.net/%s#set_magic_quotes_runtime for details. in %s on line %d
bool(true)
+
+Deprecated: get_magic_quotes_runtime(): This function is deprecated and will be removed in PHP 6. See http://php.net/%s#get_magic_quotes_runtime for details. in %s on line %d
int(0)
string(27) "some'content'here"and}there"
+
+Deprecated: set_magic_quotes_runtime(): This function is deprecated and will be removed in PHP 6. See http://php.net/%s#set_magic_quotes_runtime for details. in %s on line %d
bool(true)
+
+Deprecated: get_magic_quotes_runtime(): This function is deprecated and will be removed in PHP 6. See http://php.net/%s#get_magic_quotes_runtime for details. in %s on line %d
int(1)
string(30) "some\'content\'here\"and}there"
+
+Deprecated: set_magic_quotes_runtime(): This function is deprecated and will be removed in PHP 6. See http://php.net/%s#set_magic_quotes_runtime for details. in %s on line %d
bool(true)
bool(false)
+
+Deprecated: get_magic_quotes_runtime(): This function is deprecated and will be removed in PHP 6. See http://php.net/%s#get_magic_quotes_runtime for details. in %s on line %d
int(0)
string(27) "some'content'here"and}there"
Done
diff --git a/ext/standard/tests/serialize/bug31402.phpt b/ext/standard/tests/serialize/bug31402.phpt
index 9db838d717..59cc52f5f4 100644
--- a/ext/standard/tests/serialize/bug31402.phpt
+++ b/ext/standard/tests/serialize/bug31402.phpt
@@ -1,7 +1,7 @@
--TEST--
Bug #31402 (unserialize() generates references when it should not)
--INI--
-error_reporting=E_ALL&~E_STRICT
+error_reporting=E_ALL&~E_STRICT&~E_DEPRECATED
--FILE--
<?php
diff --git a/ext/standard/tests/strings/setlocale_error.phpt b/ext/standard/tests/strings/setlocale_error.phpt
index 02010e3eb6..edbffd9387 100644
--- a/ext/standard/tests/strings/setlocale_error.phpt
+++ b/ext/standard/tests/strings/setlocale_error.phpt
@@ -1,5 +1,7 @@
--TEST--
Test setlocale() function : error condition
+--INI--
+error_reporting=14335
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
@@ -60,7 +62,7 @@ bool(false)
-- Testing setlocale() function with invalid category --
-Warning: setlocale(): Passing locale category name as string is deprecated. Use the LC_* -constants instead in %s on line %d
+Deprecated: setlocale(): Passing locale category name as string is deprecated. Use the LC_* -constants instead in %s on line %d
Warning: setlocale(): Invalid locale category name TEST, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME in %s on line %d
bool(false)
diff --git a/main/main.c b/main/main.c
index c2d911dc97..60e488d0d3 100644
--- a/main/main.c
+++ b/main/main.c
@@ -843,6 +843,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
/* fatal errors are real errors and cannot be made exceptions */
break;
case E_STRICT:
+ case E_DEPRECATED:
/* for the sake of BC to old damaged code */
break;
case E_NOTICE:
@@ -892,6 +893,9 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
case E_STRICT:
error_type_str = "Strict Standards";
break;
+ case E_DEPRECATED:
+ error_type_str = "Deprecated";
+ break;
default:
error_type_str = "Unknown error";
break;
diff --git a/tests/classes/new_001.phpt b/tests/classes/new_001.phpt
index 8ef8a71e0f..ee7d3529a3 100644
--- a/tests/classes/new_001.phpt
+++ b/tests/classes/new_001.phpt
@@ -1,5 +1,7 @@
--TEST--
Confirm difference between assigning new directly and by reference.
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
--FILE--
<?php
echo "Compile-time strict error message should precede this.\n";
@@ -27,7 +29,7 @@ Confirm difference between assigning new directly and by reference.
var_dump($f);
?>
--EXPECTF--
-Strict Standards: Assigning the return value of new by reference is deprecated in %s on line 23
+Deprecated: Assigning the return value of new by reference is deprecated in %s on line 23
Compile-time strict error message should precede this.
$f initially points to the first object:
object(Inc)#%d (1) {
diff --git a/tests/lang/bug20175.phpt b/tests/lang/bug20175.phpt
index 86cac271fa..7c6ec780ed 100644
--- a/tests/lang/bug20175.phpt
+++ b/tests/lang/bug20175.phpt
@@ -3,7 +3,7 @@ Bug #20175 (Static vars can't store ref to new instance)
--SKIPIF--
<?php if (version_compare(zend_version(),'2.0.0-dev','<')) die('skip ZE1 does not have static class members'); ?>
--INI--
-error_reporting=4095
+error_reporting=E_ALL | E_STRICT | E_DEPRECATED
--FILE--
<?php
print zend_version()."\n";
@@ -139,7 +139,7 @@ $oop_tester = new oop_test; // repeated.
print $oop_tester->oop_static()."\n";
?>
--EXPECTF--
-Strict Standards: Assigning the return value of new by reference is deprecated in %s.php on line %d
+Deprecated: Assigning the return value of new by reference is deprecated in %s.php on line %d
%s
foo_static()
foo_global()
diff --git a/tests/lang/bug22231.phpt b/tests/lang/bug22231.phpt
index b6842c7cf6..ede6a371e5 100644
--- a/tests/lang/bug22231.phpt
+++ b/tests/lang/bug22231.phpt
@@ -1,7 +1,7 @@
--TEST--
Bug #22231 (segfault when returning a global variable by reference)
--INI--
-error_reporting=4095
+error_reporting=E_ALL | E_DEPRECATED
--FILE--
<?php
class foo {
@@ -27,7 +27,7 @@ $foo = &foo();
var_dump($foo->fubar);
?>
--EXPECTF--
-Strict Standards: Assigning the return value of new by reference is deprecated in %s on line %d
+Deprecated: Assigning the return value of new by reference is deprecated in %s on line %d
object(foo)#%d (1) {
["fubar"]=>
string(5) "fubar"
diff --git a/tests/lang/bug22510.phpt b/tests/lang/bug22510.phpt
index 450bbb577d..fd717147d7 100644
--- a/tests/lang/bug22510.phpt
+++ b/tests/lang/bug22510.phpt
@@ -1,7 +1,7 @@
--TEST--
Bug #22510 (segfault among complex references)
--INI--
-error_reporting=4095
+error_reporting=E_ALL | E_DEPRECATED
--FILE--
<?php
class foo
@@ -91,7 +91,7 @@ $bar->instance->finalize();
print "I'm alive!\n";
?>
--EXPECTF--
-Strict Standards: Assigning the return value of new by reference is deprecated in %s on line %d
+Deprecated: Assigning the return value of new by reference is deprecated in %s on line %d
ok1
bar::run1
foo::method1