PDA

View Full Version : [PHP] Facciamo una lista di funzioni & Co deprecate?


Matrixbob
01-07-2010, 19:50
Io per ora ho trovato queste, ma non so se sono omnicomprensive o incrementali.

The list of functions that are deprecated in PHP 5.3.0:

call_user_method() (use call_user_func() instead)
call_user_method_array() (use call_user_func_array() instead)
define_syslog_variables()
dl()
ereg() (use preg_match() instead)
ereg_replace() (use preg_replace() instead)
eregi() (use preg_match() with the 'i' modifier instead)
eregi_replace() (use preg_replace() with the 'i' modifier instead)
set_magic_quotes_runtime() and its alias, magic_quotes_runtime()
session_register() (use the $_SESSION superglobal instead)
session_unregister() (use the $_SESSION superglobal instead)
session_is_registered() (use the $_SESSION superglobal instead)
set_socket_blocking() (use stream_set_blocking() instead)
split() (use preg_split() instead)
spliti() (use preg_split() with the 'i' modifier instead)
sql_regcase()
mysql_db_query() (use mysql_select_db() and mysql_query() instead)
mysql_escape_string() (use mysql_real_escape_string() instead)
Passing locale category names as strings is now deprecated. Use the LC_* family of constants instead.
The is_dst parameter to mktime(). Use the new timezone handling functions instead.

Matrixbob
01-07-2010, 19:51
The following is a list of deprecated INI directives. Use of any of these INI directives will cause an E_DEPRECATED error to be thrown at startup.

define_syslog_variables
register_globals
register_long_arrays
safe_mode
magic_quotes_gpc
magic_quotes_runtime
magic_quotes_sybase
Comments starting with '#' are now deprecated in .INI files.


Deprecated features:

Assigning the return value of new by reference is now deprecated.
Call-time pass-by-reference is now deprecated.
The use of {} to access string offsets is deprecated. Use [] instead.

ally
02-07-2010, 12:54
...non conosco php ma non esiste una documentazione che specifica cio' che è deprecato?...

...ciao Andrea...

Matrixbob
02-07-2010, 12:59
...non conosco php ma non esiste una documentazione che specifica cio' che è deprecato?...

...ciao Andrea...
L'unica cos che ho trovato è appunto questa.
Anzi il manuale su ereg mi diceva solo che era deprecata, ma a favore di cosa no :boh:

wingman87
02-07-2010, 13:13
L'unica cos che ho trovato è appunto questa.
Anzi il manuale su ereg mi diceva solo che era deprecata, ma a favore di cosa no :boh:
Era scritto nelle note:
Notes

Note: As of PHP 5.3.0, the regex extension is deprecated in favor of the PCRE extension. Calling this function will issue an E_DEPRECATED notice. See the list of differences for help on converting to PCRE.

Note: preg_match(), which uses a Perl-compatible regular expression syntax, is often a faster alternative to ereg().

Aragorn79x
02-07-2010, 13:16
L'unica cos che ho trovato è appunto questa.
Anzi il manuale su ereg mi diceva solo che era deprecata, ma a favore di cosa no :boh:

ereg() (use preg_match() instead)
http://php.net/manual/en/migration53.deprecated.php

quindi preg_match().

Matrixbob
02-07-2010, 14:07
ereg() (use preg_match() instead)
http://php.net/manual/en/migration53.deprecated.php

quindi preg_match().

Certo se andavi a cercarle come ho fatto io, altrimenti il manuale:
This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged. (http://it.php.net/manual/en/function.ereg.php)
e tanti saluti.

Aragorn79x
02-07-2010, 14:53
Certo se andavi a cercarle come ho fatto io, altrimenti il manuale:
This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged. (http://it.php.net/manual/en/function.ereg.php)
e tanti saluti.

se guardi appena sotto c'è scritto... :D


Note: As of PHP 5.3.0, the regex extension is deprecated in favor of the PCRE extension. Calling this function will issue an E_DEPRECATED notice. See the list of differences for help on converting to PCRE.

Note: preg_match(), which uses a Perl-compatible regular expression syntax, is often a faster alternative to ereg().

Matrixbob
02-07-2010, 15:04
se guardi appena sotto c'è scritto... :D

Se non si speva il nome corretto della sostituta poteva sfuggire quella nota, non potevano metterlo subito "use ..." invece di rimandare a una nota?

CMQ grazie della osservazione, sai mica darmi una mano nache qui:
[WAMP] Ultime versioni: problema a installare PHP come modulo di Apache (http://www.hwupgrade.it/forum/showthread.php?p=32496238)

TNX!