php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63295 Missing information about function alias
Submitted: 2012-10-16 23:02 UTC Modified: 2013-01-17 08:11 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: dreen1 at gmail dot com Assigned: philip (profile)
Status: Closed Package: MySQL related
PHP Version: Irrelevant OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dreen1 at gmail dot com
New email:
PHP Version: OS:

 

 [2012-10-16 23:02 UTC] dreen1 at gmail dot com
Description:
------------
mysql() is an alias to mysql_db_query() which itself is deprecated. this fact is 
undocumented and left me wondering for a long time why I can't define mysql(). 
Reading source code revealed the truth.

Test script:
---------------
<?php
function mysql()
{
    return "nope";
}
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-25 09:57 UTC] uw@php.net
I think, we should change all undocumented PHP_FALIAS into PHP_DEP_FALIAS to cause deprecation warnings. This change should then be noted in the docs together with the deprecated functions. 

Ulf



	/* for downwards compatability */
	PHP_FALIAS(mysql,				mysql_db_query,		arginfo_mysql_db_query)

--> undocumented

	PHP_FALIAS(mysql_fieldname,		mysql_field_name,	arginfo_mysql_field_name)

--> undocumented

	PHP_FALIAS(mysql_fieldtable,	mysql_field_table,	arginfo_mysql_field_seek)

--> undocumented

	PHP_FALIAS(mysql_fieldlen,		mysql_field_len,	arginfo_mysql_field_seek)

--> undocumented

	PHP_FALIAS(mysql_fieldtype,		mysql_field_type,	arginfo_mysql_field_seek)

--> undocumented

	PHP_FALIAS(mysql_fieldflags,	mysql_field_flags,	arginfo_mysql_field_seek)

--> undocumented 

	PHP_FALIAS(mysql_selectdb,		mysql_select_db,	arginfo_mysql_select_db)

--> undocumented

#ifndef NETWARE		/* The below two functions not supported on NetWare */
#if MYSQL_VERSION_ID < 40000
	PHP_DEP_FALIAS(mysql_createdb,	mysql_create_db,	arginfo_mysql_select_db)

--> undocumented

	PHP_DEP_FALIAS(mysql_dropdb,	mysql_drop_db,		arginfo_mysql_select_db)

--> undocumented

#endif
#endif	/* NETWARE */
	PHP_FALIAS(mysql_freeresult,	mysql_free_result,	arginfo__result_mysql_arg)

--> undocumented

	PHP_FALIAS(mysql_numfields,		mysql_num_fields,	arginfo__result_mysql_arg)

--> undocumented

	PHP_FALIAS(mysql_numrows,		mysql_num_rows,		arginfo__result_mysql_arg)

--> undocumented

	PHP_FALIAS(mysql_listdbs,		mysql_list_dbs,		arginfo__optional_mysql_link)

--> undocumented

	PHP_DEP_FALIAS(mysql_listtables,mysql_list_tables,	arginfo_mysql_select_db)

--> undocumented

	PHP_FALIAS(mysql_listfields,	mysql_list_fields,	arginfo_mysql_list_fields)


--> undocumented

	PHP_FALIAS(mysql_db_name,		mysql_result,		arginfo_mysql_result)

--> ATTN: documented

	PHP_FALIAS(mysql_dbname,		mysql_result,		arginfo_mysql_result)

--> undocumented

	PHP_FALIAS(mysql_tablename,		mysql_result,		arginfo_mysql_result)

--> ATTN: documented

	PHP_FALIAS(mysql_table_name,	mysql_result,		arginfo_mysql_result)

--> ATTN: undocumented although it seems to follow naming of documented ones
 [2012-10-25 12:00 UTC] uw@php.net
I've deprecated all undocumented functions alias in PHP 5.5, http://news.php.net/php.cvs/70459 . As I do not know how to properly document it (changelog is auto generated and those functions have never been documented, thus auto generation cannot cover them), I leave the documentation task to the experts - the docs team.
 [2012-12-07 08:09 UTC] philip@php.net
-Assigned To: +Assigned To: philip
 [2012-12-07 08:30 UTC] philip@php.net
Automatic comment from SVN on behalf of philip
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=328703
Log: Moved generated changelog to a new changelog.xml, and added deprecated aliases as per PHP Bug #63295.
 [2013-01-17 08:11 UTC] philip@php.net
-Status: Assigned +Status: Closed
 [2013-01-17 08:11 UTC] philip@php.net
Thank you for the bug report, this has been fixed. 

And as this entire extension is now deprecated, we have decided to keep it 
simple by only including the single changelog entry for all of these old 
aliases. It can be seen here:

http://php.net/manual/en/changelog.mysql.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 18:01:31 2024 UTC