- 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; namespace test;
echo "ok\n"; echo "ok\n";
?> ?>
--EXPECT-- --EXPECTF--
Deprecated: Ticks is deprecated and will be removed in PHP 6 in %s on line %d
ok ok

View file

@ -13,7 +13,8 @@ c:
print "ok!\n"; print "ok!\n";
goto b; goto b;
?> ?>
--EXPECT-- --EXPECTF--
Deprecated: Ticks is deprecated and will be removed in PHP 6 in %s on line %d
ok! ok!
ok! 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)) { 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); convert_to_long(&val->u.constant);
CG(declarables).ticks = 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 #ifdef ZEND_MULTIBYTE
} else if (!zend_binary_strcasecmp(var->u.constant.value.str.val, var->u.constant.value.str.len, "encoding", sizeof("encoding")-1)) { } 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; zend_encoding *new_encoding, *old_encoding;

View file

@ -6031,6 +6031,8 @@ PHP_FUNCTION(register_tick_function)
if (tick_fe.arg_count < 1) { if (tick_fe.arg_count < 1) {
WRONG_PARAM_COUNT; 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); 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"; echo "Done\n";
?> ?>
--EXPECTF-- --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 hello
Warning: unregister_tick_function(): Unable to delete tick function executed at the moment in %s on line %d Warning: unregister_tick_function(): Unable to delete tick function executed at the moment in %s on line %d
Done Done

View file

@ -17,6 +17,9 @@ echo "Done\n";
?> ?>
--EXPECTF-- --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 Test
%d %d
%d %d