Hi Larry,

On Tue, Mar 3, 2015 at 7:22 AM, Larry Garfield <la...@garfieldtech.com>
wrote:

>
>  Sorry, I do not see how a new thread helps. Namespace either. These
>> will only be duplicated APIs for little to no gain. Existing codes
>> won't move as they won't be compatible with 5.x.
>>
>> We should really consider Nikita's experiment instead,as it acutally
>> brings some big plus. Simple aliases for the sake of having _ in the
>> names bring nothing but confusion in my humble opinion.
>>
>> Cheers,
>>
>
> This topic has come up many times, and that is always the answer.  We
> should look at something meaningful (methods on scalars, which eliminates
> the parameter order issue as well) rather than just duplicate function
> names.
>
> This is at least the third time we've had this thread and come to that
> same statement.  I agree with it.
>
> So what's the blocker on discussing Nikita's work for core?


I like scalar objects, but it does not resolve that PHP has non standard
function names.
It does not change old names, therefore it's impossible to resolve issue.
This is the reason why I'm proposing while I like scalar object, use of
namespace, etc.

Many of proposed candidates have nothing to do with scalar object also.

https://wiki.php.net/rfc/consistent_function_names#list_of_functions_to_be_renamed
Functions other than Standard module

http://php.net/manual/en/book.sockets.php
socket_get_peer_name ← socket_getpeername
socket_get_sock_name ← socket_getsockname
socket_recv_from ← socket_recvfrom
socket_recv_msg ← socket_recvmsg
socket_send_msg ← socket_sendmsg
socket_send_to ← socket_sendto
socket_error_str ← socket_strerror (Adjust to accord with other function
names. e.g. bz_error_str())
http://php.net/manual/en/book.bc.php
bc_add ← bcadd
bc_comp ← bccomp
bc_div ← bcdiv
bc_mod ← bcmod
bc_mul ← bcmul
bc_pow ← bcpow
bc_pow_mod ← bcpowmod
bc_scale ← bcscale
bc_sqrt ← bcsqrt
bc_sub ← bcsub
http://php.net/manual/en/book.gettext.php
gettext_bind_text_domain_codeset ← bind_textdomain_codeset
gettext_bind_text_domain ← bindtextdomain
gettext_dc ← dcgettext
gettext_dcn ← dcngettext
gettext_d ← dgettext
gettext_dn ← dngettext
gettext_n ← ngettext
gettext_text_domain ← textdomain
http://php.net/manual/en/book.bzip2.php
bz_close → bzclose
bz_compress → bzcompress
bz_decompress → bzdecompress
bz_errno → bzerrno
bz_error → bzerror
bz_error_str → bzerrstr
bz_flush → bzflush
bz_open → bzopen
bz_read → bzread
bz_write → bzwrite
http://php.net/manual/en/book.zlib.php
gz_close → gzclose
gz_compress → gzcompress
gz_decode → gzdecode
gz_deflate → gzdeflate
gz_encode → gzencode
gz_eof → gzeof
gz_file → gzfile
gz_getc → gzgetc
gz_gets → gzgets
gz_getss → gzgetss
gz_inflate → gzinflate
gz_open → gzopen
gz_passthru → gzpassthru
gz_puts → gzputs
gz_read → gzread
gz_rewind → gzrewind
gz_seek → gzseek
gz_tell → gztell
gz_uncompress → gzuncompress
gz_write → gzwrite
gz_read_file → readgzfile
http://php.net/manual/en/book.image.php
gd_image_size → getimagesize
gd_image_size_from_string → getimagesizefromstring
gd_type_to_extension → image_type_to_extension
gd_type_to_mime_type → image_type_to_mime_type
gd_2wbmp → image2wbmp
gd_affine → imageaffine
gd_affine_matrix_concat → imageaffinematrixconcat
gd_affine_matrix_get → imageaffinematrixget
gd_alpha_blending → imagealphablending
gd_antialias → imageantialias
gd_arc → imagearc
gd_char → imagechar
gd_charup → imagecharup
gd_color_allocate → imagecolorallocate
gd_color_allocate_alpha → imagecolorallocatealpha
gd_color_at → imagecolorat
gd_color_closest → imagecolorclosest
gd_color_closest_alpha → imagecolorclosestalpha
gd_color_closest_hwb → imagecolorclosesthwb
gd_color_deallocate → imagecolordeallocate
gd_color_exact → imagecolorexact
gd_color_exact_alpha → imagecolorexactalpha
gd_color_match → imagecolormatch
gd_color_resolve → imagecolorresolve
gd_color_resolve_alpha → imagecolorresolvealpha
gd_color_set → imagecolorset
gd_colors_for_index → imagecolorsforindex
gd_colors_total → imagecolorstotal
gd_color_transparent → imagecolortransparent
gd_convolution → imageconvolution
gd_copy → imagecopy
gd_copy_merge → imagecopymerge
gd_copy_merge_gray → imagecopymergegray
gd_copy_resampled → imagecopyresampled
gd_copy_resized → imagecopyresized
gd_create → imagecreate
gd_create_from_gd2 → imagecreatefromgd2
gd_create_from_gd2_part → imagecreatefromgd2part
gd_create_from_gd → imagecreatefromgd
gd_create_from_gif → imagecreatefromgif
gd_create_from_jpeg → imagecreatefromjpeg
gd_create_from_png → imagecreatefrompng
gd_create_from_string → imagecreatefromstring
gd_create_from_wbmp → imagecreatefromwbmp
gd_create_from_webp → imagecreatefromwebp
gd_create_from_xbm → imagecreatefromxbm
gd_create_from_xpm → imagecreatefromxpm
gd_create_true_color → imagecreatetruecolor
gd_crop → imagecrop
gd_crop_auto → imagecropauto
gd_dashed_line → imagedashedline
gd_destroy → imagedestroy
gd_ellipse → imageellipse
gd_fill → imagefill
gd_filled_arc → imagefilledarc
gd_filled_ellipse → imagefilledellipse
gd_filled_polygon → imagefilledpolygon
gd_filled_rectangle → imagefilledrectangle
gd_fill_to_border → imagefilltoborder
gd_filter → imagefilter
gd_flip → imageflip
gd_font_height → imagefontheight
gd_font_width → imagefontwidth
gd_ft_bbox → imageftbbox
gd_ft_text → imagefttext
gd_gamma_correct → imagegammacorrect
gd_raw2 → imagegd2
gd_raw → imagegd
gd_gif → imagegif
gd_grab_screen → imagegrabscreen
gd_grab_window → imagegrabwindow
gd_interlace → imageinterlace
gd_is_true_color → imageistruecolor
gd_jpeg → imagejpeg
gd_layer_effect → imagelayereffect
gd_line → imageline
gd_load_font → imageloadfont
gd_palette_copy → imagepalettecopy
gd_palette_to_true_color → imagepalettetotruecolor
gd_png → imagepng
gd_polygon → imagepolygon
gd_ps_bbox → imagepsbbox
gd_ps_encode_font → imagepsencodefont
gd_ps_extend_font → imagepsextendfont
gd_ps_free_font → imagepsfreefont
gd_ps_load_font → imagepsloadfont
gd_ps_slant_font → imagepsslantfont
gd_ps_text → imagepstext
gd_rectangle → imagerectangle
gd_rotate → imagerotate
gd_save_alpha → imagesavealpha
gd_scale → imagescale
gd_set_brush → imagesetbrush
gd_set_interpolation → imagesetinterpolation
gd_set_pixel → imagesetpixel
gd_set_style → imagesetstyle
gd_set_thickness → imagesetthickness
gd_set_tile → imagesettile
gd_string → imagestring
gd_string_up → imagestringup
gd_width → imagesx
gd_height → imagesy
gd_true_color_to_palette → imagetruecolortopalette
gd_ttf_bbox → imagettfbbox
gd_ttf_text → imagettftext
gd_types → imagetypes
gd_wbmp → imagewbmp
gd_webp → imagewebp
gd_xbm → imagexbm
gd_iptc_embed → iptcembed
gd_iptc_parse → iptcparse
gd_jpeg2wbmp → jpeg2wbmp
gd_png2wbmp → png2wbmp
http://php.net/manual/en/book.exif.php
exif_image_type → exif_imagetype
exif_tag_name → exif_tagname
http://php.net/manual/en/book.mbstring.php
mb_decode_mime_header → mb_decode_mimeheader
mb_decode_numeric_entity → mb_decode_numericentity
mb_encode_mime_header → mb_encode_mimeheader
mb_encode_numeric_entity → mb_encode_numericentity
Date/Time related:
http://php.net/manual/en/book.datetime.php
date_format → date (Return formatted date string of timestamp)
date_get → getdate (Return array date)
date_check → checkdate
time_part → idate (Retrieve part of date information as int according to
format)
time → time (The same as it is now. Return int timestamp)
time_make → mktime (Return timestamp from number of int parameters)
time_format → strftime (Return lobal time string according to format/locale)
time_utc → gmdate (Return array GMT/UTC timestamp)
time_utc_make → gmmktime (Return GMT/UTC timestamp from array)
time_utc_format → gmstrftime (Return GMT/UTC time string according to
format/locale)
time_get → gettimeofday (Return array time of day)
time_local → localtime (Return localtime() result array. More info than
time_get/gettimeofday)
time_micro → microtime (Return microtime resolution time)
time_parse → strptime (Parse time string generated by time_format/strftime.
Return timestamp)
time_from_string → strtotime (Parse string time and return timestamp.
Return timestamp)
http://php.net/manual/en/book.apache.php
sapi_request_headers → getallheaders (Categorized as apache function, but
available for CLI and FCGI also)
apache_virtual → virtual
apache_get_env → apache_getenv
apache_set_env → apache_setenv
"String" functions

http://php.net/ref.strings
HTML related:
html_entities → htmlentities
html_escape → htmlspecialchars (Rename it with real meaning)
html_escape_decode → htmlspecialchars_decode
html_nl2br → nl2br
html_strip_tags → strip_tags
Locate related:
locale_conv → localeconv
locale_set → setlocale
“string” function but no “str_” prefix
str_cslashes → addcslashes
str_cslashes_strip → stripcslashes
str_slashes → addslashes
str_slashes_strip → stripslashes
str_count_chars → count_chars
str_explode → explode
str_implode → implode
str_money_format → money_format
str_number_format → number_format
str_levenshtein → levenshtein
str_metaphone → metaphone
str_parse → parse_str
str_quote_meta → quotemeta
str_similar_text → similar_text
str_soundex → soundex
str_sscanf → sscanf
str_rtrim → rtrim
str_trim → trim
str_ltrim → ltrim
str_lc_first → lcfirst
str_uc_first → ucfirst
str_uc_words → ucwords
str_word_wrap → wordwrap
Comparison:
str_cmp → strcmp
str_ncmp → strncmp
str_case_cmp → strcasecmp
str_ncase_cmp → strncasecmp
str_nat_cmp → strnatcmp
str_nat_case_cmp → strnatcasecmp
Conversion:
str_to_lower → strtolower
str_to_upper → strtoupper
Misc:
str_get_csv → str_getcsv
Named after libc:
ord → ord (Keep as it is now)
chr → chr (Keep as it is now. str_chr() is strstr() alias.)
str_chr → strchr
str_cmp → strcmp
str_coll → strcoll
str_cspn → strcspn
str_ipos → stripos
str_istr → stristr
str_len → strlen
str_pbrk → strpbrk
str_pos → strpos
str_rchr → strrchr
str_rev → strrev
str_ripos → strripos
str_rpos → strrpos
str_spn → strspn
str_str → strstr
str_tok → strtok
str_tr → strtr
http://php.net/manual/en/book.mbstring.php
mb_str_cut → mb_strcut
mb_strim_width → mb_strimwidth
mb_str_ipos → mb_stripos
mb_str_istr → mb_stristr
mb_str_len → mb_strlen
mb_str_pos → mb_strpos
mb_str_rchr → mb_strrchr
mb_str_richr → mb_strrichr
mb_str_ripos → mb_strripos
mb_str_rpos → mb_strrpos
mb_str_str → mb_strstr
mb_str_to_lower → mb_strtolower
mb_str_to_upper → mb_strtoupper
mb_str_width → mb_strwidth
http://php.net/manual/en/book.iconv.php
iconv_str_len → iconv_strlen
iconv_str_pos → iconv_strpos
iconv_str_rpos → iconv_strrpos
http://php.net/manual/en/book.intl.php
grapheme_str_ipos → grapheme_stripos
grapheme_str_istr → grapheme_stristr
grapheme_str_len → grapheme_strlen
grapheme_str_pos → grapheme_strpos
grapheme_str_ripos → grapheme_strripos
grapheme_str_rpos → grapheme_strrpos
grapheme_str_str → grapheme_strstr
"Array" functions

http://php.net/manual/en/ref.array.php
array_sort → sort (Sort values)
array_sort_reverse → rsort (Reverse sort values)
array_sort_user → usort (User sort values)
array_sort_assoc → asort (Keep key and sort)
array_sort_assoc_reverse → arsort (Keep key and reverse sort)
array_sort_assoc_user → uasort (Keep key and user sort)
array_sort_key → ksort (Sort keys)
array_sort_key_reverse → krsort (Reverse sort keys)
array_sort_key_user → uksort (User key sort)
array_sort_natual → natsort (Natural sort)
array_sort_natual_case → natcasesort (Natural sort without case)
array_in → in_array
array_range → range (Create array of range)
array_shuffle → shuffle (Randomize values)
Other than "string" and "array" standard module functions

http://php.net/manual/en/book.misc.php
time_sleep ← sleep
time_nano_sleep ← time_nanosleep
time_micro_sleep ← usleep
time_unique_id ← uniqid (uniqid() is microtime() based)
sys_get_load_avg ← sys_getloadavg
php_strip_white_space ← php_strip_whitespace
http://php.net/manual/en/book.url.php
url_decode ← urldecode
url_encode ← urlencode
url_raw_decode ← rawurldecode
url_raw_encode ← rawurlencode
url_parse ← parse_url
url_build_query ← http_build_query (Make it URL function)
http://php.net/manual/en/ref.info.php
php_credits ← phpcredits
php_info ← phpinfo
php_version ← phpversion
get_last_mod ← getlastmod (Return main script timestamp.)
get_my_gid ← getmygid (“my_” prefix used because they return info about
current script.)
get_my_inode ← getmyinode
get_my_pid ← getmypid
get_my_uid ← getmyuid
get_rusage ← getrusage
get_opt ← getopt
get_env ← getenv
put_env ← putenv
http://php.net/manual/en/book.var.php
bool_val ← boolval
double_val ← doubleval
float_val ← floatval
int_val ← intval
str_val ← strval
get_type ← gettype
set_type ← settype
is_set ← isset (There are number of is_*(). e.g.is_int()/is_string()/etc)
http://php.net/manual/en/ref.exec.php
exec ← exec (exec() remains as it is)
exec_passthru ← passthru (Named after exec())
exec_shell ← shell_exec
exec_system ← system
exec_escape_arg ← escapeshellarg
exec_escape_cmd ← escapeshellcmd
http://php.net/manual/en/ref.filesystem.php
disk_free_space ← diskfreespace
link ← link (The same as now)
link_info ← linkinfo
link_stat ← lstat
link_chown ← lchown
link_chgrp ← lchgrp
link_read ← readlink
link_symbolic ← symlink
path_base_name ← basename
path_info ← pathinfo
read_file ← readfile (This could be file_read() or file_passthru(), but
file_read() conflict with fread(), file_passthru() conflict with
fpassthru(). Any good name?)
pipe_close ← pclose
pipe_open ← popen
realpath related : Could be as it is now?
realpath ← realpath
realpath_cache_get ← realpath_cache_get
realpath_cache_size ← realpath_cache_size
file_atime ← fileatime
file_ctime ← filectime
file_group ← filegroup
file_inode ← fileinode
file_mtime ← filemtime
file_owner ← fileowner
file_perms ← fileperms
file_size ← filesize
file_type ← filetype
file_name_match ← fnmatch
file_temp_name ← tempnam
file_copy ← copy
file_stat() ← stat()
file_stat_clear_cache ← clearstatcache
f*() : Prefixed by file_? - It's supposed to be named as “file module”. If
“f” prefix is kept, there should be “ftmp(tmpfile)”,“frewind(rewind)”
because these operates with file handle.
file_open ← fopen
file_close ← fclose
file_eof ← feof
file_flush ← fflush
file_getc ← fgetc
file_get_csv ← fgetcsv
file_gets ← fgets
file_getss ← fgetss
file_passthru ← fpassthru
file_put_csv ← fputcsv
file_puts ← fputs
file_read ← fread
file_scanf ← fscanf
file_seek ← fseek
file_stat ← fstat
file_tell ← ftell
file_truncate ← ftruncate
file_write ← fwrite
file_rewind ← rewind (This one is exception that does not have “f” prefix,
but returns file handle)
file_temp ← tmpfile (This one is exception that does not have “f” prefix,
but operates with file handle)
file_delete ← unlink (There is dummy “delete()” function entry for
unlink(). Unlink is a directory operation in fact, but made it as
file_delete(). There will be dir_delete())
Directory related : Prefixed by dir_? It's supposed to be named as “dir
module”
dir_name ← dirname
dir_glob ← glob
dir_rename ← rename (Rename is actually a directory operation. e.g File
deletion/rename is controlled by current dir permission)
dir_delete ← rmdir
dir_create ← mkdir
dir_chown ← chown
dir_chmod ← chmod
dir_chgrp ← chgrp
Methods

StdClass::__setState() ← StdClass::__set_state() →
SessionIdInterface::createSid() ← SessionIdInterface::create_sid()


--
Yasuo Ohgaki
yohg...@ohgaki.net

Reply via email to