Hi all, i saw some cvs commits (recently didou's) and some bug-reports that were about incorrectly documented return values of functions. I thought it would be usefull to write a script that would run through the php-src as well as the phpdoc tree and grab the relevant sections to compare the defined return values. The script is really alpha, and thus i would like to show you the results before posting the script-source (if it's appreciated).
Attached to this e-mail you see the file which is generated by the script. For now it cotains 259 non matching return values. I checked some and saw that e.g in abs() the return value was documented as 'number' and in the source it was defined as an 'int'. So as i said, this list may not be entirely correct, but i looked at a few functions such as syslog() which seem to need an update. The file attached is in following format (let's take syslog as an example): syslog (x: int | c: bool) The sourcefile (c) says a bool should be returned and the docs (x) say its an int. If anyone would like to have a look ... ali
abs (x: mixed | c: int) apache_getenv (x: string | c: bool) apache_setenv (x: int | c: bool) closelog (x: int | c: bool) copy (x: object | c: bool) cpdf_add_annotation (x: void | c: bool) cpdf_import_jpeg (x: int | c: bool) crc32 (x: int | c: string) curl_exec (x: mixed | c: bool) curl_getinfo (x: string | c: mixed) curl_init (x: int | c: resource) curl_version (x: string | c: array) dbase_create (x: int | c: bool) dbase_create (x: int | c: bool) dbx_close (x: bool | c: int) dbx_close (x: bool | c: int) dbx_sort (x: bool | c: int) dio_tcsetattr (x: void | c: mixed) dns_get_mx (x: int | c: bool) ereg (x: bool | c: int) eregi (x: bool | c: int) error_log (x: int | c: bool) error_log (x: int | c: bool) fam_pending (x: bool | c: int) fbsql_change_user (x: resource | c: int) fbsql_drop_db (x: bool | c: int) fbsql_fetch_assoc (x: array | c: object) fbsql_field_len (x: int | c: mixed) fdf_close (x: bool | c: void) fdf_header (x: bool | c: void) fdf_open (x: int | c: resource) fdf_set_version (x: string | c: bool) fstat (x: array | c: int) get_browser (x: object | c: mixed) getcwd (x: string | c: mixed) header (x: int | c: void) headers_list (x: array | c: string) highlight_file (x: mixed | c: bool) highlight_string (x: mixed | c: bool) ibase_blob_close (x: mixed | c: string) ibase_connect (x: int | c: resource) ibase_execute (x: resource | c: mixed) ibase_query (x: resource | c: mixed) iconv_strrpos (x: string | c: int) image2wbmp (x: int | c: bool) imagearc (x: int | c: bool) imagechar (x: int | c: bool) imagecharup (x: int | c: bool) imagecolordeallocate (x: int | c: bool) imagecolorset (x: bool | c: void) imagecopy (x: int | c: bool) imagecopymerge (x: int | c: bool) imagecopymergegray (x: int | c: bool) imagecopyresized (x: int | c: bool) imagedashedline (x: int | c: bool) imageellipse (x: int | c: bool) imagefill (x: int | c: bool) imagefilledpolygon (x: int | c: bool) imagefilledrectangle (x: int | c: bool) imagefilltoborder (x: int | c: bool) imagegammacorrect (x: int | c: bool) imageline (x: int | c: bool) imagepalettecopy (x: int | c: void) imagepolygon (x: int | c: bool) imagepsencodefont (x: int | c: bool) imagepsfreefont (x: void | c: bool) imagepsloadfont (x: int | c: resource) imagerectangle (x: int | c: bool) imagesetbrush (x: int | c: bool) imagesetpixel (x: int | c: bool) imagesettile (x: int | c: bool) imagestring (x: int | c: bool) imagestringup (x: int | c: bool) imagexbm (x: bool | c: int) ingres_fetch_object (x: object | c: array) ingres_field_length (x: int | c: string) ingres_field_nullable (x: bool | c: string) ingres_field_precision (x: int | c: string) ingres_field_scale (x: int | c: string) ircg_html_encode (x: bool | c: string) ircg_pconnect (x: resource | c: int) ircg_pconnect (x: resource | c: int) key (x: string | c: mixed) link (x: object | c: int) link (x: bool | c: int) mail (x: bool | c: int) mail (x: bool | c: int) mb_ereg_search_getpos (x: array | c: int) mb_ereg_search_init (x: array | c: bool) mb_ereg_search_setpos (x: array | c: bool) mb_http_input (x: string | c: mixed) mb_internal_encoding (x: mixed | c: string) mb_send_mail (x: bool | c: int) mb_strlen (x: string | c: int) mcrypt_enc_self_test (x: bool | c: int) mkdir (x: bool | c: int) msg_receive (x: bool | c: mixed) msql_close (x: int | c: bool) msql_drop_db (x: int | c: bool) msql_fetch_array (x: int | c: array) msql_fetch_object (x: int | c: object) msql_field_seek (x: int | c: bool) msql_field_table (x: int | c: string) msql_free_result (x: int | c: bool) mssql_close (x: int | c: bool) mysql_field_seek (x: int | c: bool) mysqli_init (x: object | c: resource) mysqli_select_db (x: bool | c: string) mysqli_stmt_data_seek (x: bool | c: void) mysqli_stmt_init (x: object | c: mixed) ncurses_def_prog_mode (x: bool | c: int) ncurses_def_shell_mode (x: bool | c: int) ncurses_del_panel (x: int | c: bool) ncurses_delch (x: bool | c: int) ncurses_deleteln (x: bool | c: int) ncurses_doupdate (x: bool | c: int) ncurses_echo (x: bool | c: int) ncurses_erase (x: bool | c: int) ncurses_filter (x: int | c: void) ncurses_flash (x: bool | c: int) ncurses_flushinp (x: bool | c: int) ncurses_has_ic (x: bool | c: int) ncurses_has_il (x: bool | c: int) ncurses_insertln (x: bool | c: int) ncurses_isendwin (x: bool | c: int) ncurses_killchar (x: bool | c: string) ncurses_newwin (x: resource | c: int) ncurses_nl (x: bool | c: int) ncurses_nocbreak (x: bool | c: int) ncurses_noecho (x: bool | c: int) ncurses_nonl (x: bool | c: int) ncurses_panel_above (x: int | c: resource) ncurses_panel_below (x: int | c: resource) ncurses_panel_window (x: int | c: resource) ncurses_qiflush (x: int | c: void) ncurses_raw (x: bool | c: int) ncurses_resetty (x: bool | c: int) ncurses_savetty (x: bool | c: int) ncurses_slk_attr (x: bool | c: int) ncurses_slk_clear (x: bool | c: int) ncurses_slk_init (x: bool | c: int) ncurses_slk_noutrefresh (x: bool | c: int) ncurses_slk_refresh (x: bool | c: int) ncurses_slk_restore (x: bool | c: int) ncurses_slk_touch (x: bool | c: int) ncurses_termattrs (x: bool | c: int) ncurses_ungetmouse (x: bool | c: int) ncurses_use_default_colors (x: bool | c: int) nsapi_virtual (x: int | c: bool) ob_clean (x: void | c: bool) ob_flush (x: void | c: bool) ob_get_clean (x: string | c: bool) ob_get_flush (x: string | c: bool) ob_iconv_handler (x: array | c: string) oci_result (x: mixed | c: string) odbc_autocommit (x: bool | c: mixed) odbc_autocommit (x: bool | c: mixed) odbc_binmode (x: int | c: bool) odbc_columnprivileges (x: int | c: resource) odbc_data_source (x: resource | c: array) odbc_fetch_into (x: bool | c: int) odbc_field_scale (x: string | c: int) odbc_gettypeinfo (x: int | c: resource) odbc_longreadlen (x: int | c: bool) odbc_result (x: string | c: mixed) odbc_rollback (x: int | c: bool) odbc_setoption (x: int | c: bool) odbc_tableprivileges (x: int | c: resource) odbc_tables (x: int | c: resource) opendir (x: resource | c: mixed) openlog (x: int | c: bool) openssl_pkey_get_public (x: resource | c: int) openssl_x509_checkpurpose (x: bool | c: int) ora_bind (x: int | c: bool) pcntl_wifexited (x: int | c: bool) pcntl_wifsignaled (x: int | c: bool) pcntl_wifstopped (x: int | c: bool) pfpro_cleanup (x: void | c: bool) pfpro_init (x: void | c: bool) pfpro_init (x: void | c: bool) pg_insert (x: bool | c: mixed) pg_last_oid (x: int | c: string) pg_result_seek (x: array | c: bool) pg_result_status (x: int | c: mixed) pg_select (x: array | c: mixed) phpinfo (x: int | c: void) posix_setpgid (x: int | c: bool) preg_match (x: mixed | c: int) preg_replace (x: mixed | c: string) preg_replace_callback (x: mixed | c: string) print_r (x: bool | c: mixed) pspell_add_to_personal (x: int | c: bool) pspell_add_to_personal (x: int | c: bool) pspell_add_to_session (x: int | c: bool) pspell_clear_session (x: int | c: bool) pspell_config_ignore (x: int | c: bool) pspell_config_mode (x: int | c: bool) pspell_config_personal (x: int | c: bool) pspell_config_repl (x: int | c: bool) pspell_config_runtogether (x: int | c: bool) pspell_config_save_repl (x: int | c: bool) pspell_save_wordlist (x: int | c: bool) pspell_store_replacement (x: int | c: bool) putenv (x: void | c: bool) readline_add_history (x: void | c: bool) register_tick_function (x: void | c: bool) sem_get (x: int | c: resource) session_set_save_handler (x: bool | c: void) set_error_handler (x: mixed | c: string) set_time_limit (x: void | c: bool) shm_remove (x: int | c: bool) shm_remove_var (x: int | c: bool) snmpset (x: bool | c: int) socket_accept (x: int | c: resource) sqlite_single_query (x: mixed | c: array) str_shuffle (x: string | c: void) stream_get_meta_data (x: array | c: resource) stream_socket_enable_crypto (x: resource | c: bool) strpbrk (x: string | c: array) substr_replace (x: string | c: mixed) sybase_connect (x: resource | c: int) sybase_pconnect (x: resource | c: int) sybase_query (x: resource | c: int) sybase_unbuffered_query (x: resource | c: int) symlink (x: bool | c: int) syslog (x: int | c: bool) system (x: string | c: int) tidy_parse_string (x: resource | c: bool) trigger_error (x: bool | c: void) udm_add_search_limit (x: bool | c: int) udm_alloc_agent (x: resource | c: int) udm_alloc_agent_array (x: resource | c: int) udm_check_charset (x: bool | c: int) udm_clear_search_limits (x: bool | c: int) udm_find (x: resource | c: int) udm_free_ispell_data (x: bool | c: int) udm_free_res (x: bool | c: int) udm_load_ispell_data (x: bool | c: int) udm_set_agent_param (x: bool | c: int) virtual (x: int | c: bool) wddx_add_vars (x: bool | c: int) xml_parse (x: bool | c: int) xml_parser_create (x: int | c: resource) xml_parser_free (x: bool | c: int) xml_parser_get_option (x: mixed | c: int) xml_parser_set_option (x: bool | c: int) xml_set_character_data_handler (x: bool | c: int) xml_set_default_handler (x: bool | c: int) xml_set_element_handler (x: bool | c: int) xml_set_end_namespace_decl_handler (x: bool | c: int) xml_set_external_entity_ref_handler (x: bool | c: int) xml_set_notation_decl_handler (x: bool | c: int) xml_set_object (x: void | c: int) xml_set_processing_instruction_handler (x: bool | c: int) xml_set_start_namespace_decl_handler (x: bool | c: int) xml_set_unparsed_entity_decl_handler (x: bool | c: int) yp_all (x: void | c: bool) yp_get_default_domain (x: int | c: string) yp_get_default_domain (x: int | c: string)