- Deprecate ticks

This commit is contained in:
Felipe Pena 2008-07-17 19:29:34 +00:00
parent 10e7231f2a
commit c3453925c5
6 changed files with 14 additions and 2 deletions

View File

@ -6,5 +6,6 @@ declare(ticks=1);
namespace test;
echo "ok\n";
?>
--EXPECT--
--EXPECTF--
Deprecated: Ticks is deprecated and will be removed in PHP 6 in %s on line %d
ok

View File

@ -13,7 +13,8 @@ c:
print "ok!\n";
goto b;
?>
--EXPECT--
--EXPECTF--
Deprecated: Ticks is deprecated and will be removed in PHP 6 in %s on line %d
ok!
ok!
ok!

View File

@ -4592,6 +4592,8 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC)
if (!zend_binary_strcasecmp(var->u.constant.value.str.val, var->u.constant.value.str.len, "ticks", sizeof("ticks")-1)) {
convert_to_long(&val->u.constant);
CG(declarables).ticks = val->u.constant;
zend_error(E_DEPRECATED, "Ticks is deprecated and will be removed in PHP 6");
#ifdef ZEND_MULTIBYTE
} else if (!zend_binary_strcasecmp(var->u.constant.value.str.val, var->u.constant.value.str.len, "encoding", sizeof("encoding")-1)) {
zend_encoding *new_encoding, *old_encoding;

View File

@ -6031,6 +6031,8 @@ PHP_FUNCTION(register_tick_function)
if (tick_fe.arg_count < 1) {
WRONG_PARAM_COUNT;
}
php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "Ticks is deprecated and will be removed in PHP 6");
tick_fe.arguments = (zval **) safe_emalloc(sizeof(zval *), tick_fe.arg_count, 0);

View File

@ -14,6 +14,9 @@ register_tick_function('a');
echo "Done\n";
?>
--EXPECTF--
Deprecated: Ticks is deprecated and will be removed in PHP 6 in %s on line %d
Deprecated: register_tick_function(): Ticks is deprecated and will be removed in PHP 6 in %s on line %d
hello
Warning: unregister_tick_function(): Unable to delete tick function executed at the moment in %s on line %d
Done

View File

@ -17,6 +17,9 @@ echo "Done\n";
?>
--EXPECTF--
Deprecated: Ticks is deprecated and will be removed in PHP 6 in %s on line %d
Deprecated: register_tick_function(): Ticks is deprecated and will be removed in PHP 6 in %s on line %d
Test
%d
%d