Commit Graph

281 Commits

Author SHA1 Message Date
Máté Kocsis
c37a1cd650
Promote a few remaining errors in ext/standard
Closes GH-6110
2020-09-15 14:26:16 +02:00
Dmitry Stogov
aae50328e2 decbin/decoct/dechex optimization. 2020-09-08 10:34:29 +03:00
Dmitry Stogov
4a2ae84188 Add "const". Move constant strings to read-only memory. 2020-09-07 21:35:48 +03:00
George Peter Banyard
9cb522166c Allow number_format to be only passed 3 arguments
Closes GH-5977
2020-08-13 18:07:17 +02:00
Máté Kocsis
af80d8a14e
Add more argument types to stubs
Closes GH-5943
2020-08-07 12:35:30 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
twosee
88355dd338 Constify char * arguments of APIs
Closes GH-5676.
2020-06-08 10:38:45 +02:00
Máté Kocsis
6111d64cda
Improve a last couple of argument error messages
Closes GH-5404
2020-04-20 13:09:00 +02:00
Máté Kocsis
bb6f374048
Improve argument error messages in ext/standard
Closes GH-5198
2020-03-18 19:56:10 +01:00
Máté Kocsis
7b4a4d2ace
Use RETURN_THROWS() after try_convert_to_string() 2020-01-03 17:04:06 +01:00
Máté Kocsis
01a50778d1
Use RETURN_THROWS() after zend_throw_exception() in most of the extensions 2020-01-02 10:56:18 +01:00
Máté Kocsis
31cf9a7ea9
Use RETURN_THROWS() when an exception is thrown
Closes GH-5036
2019-12-30 17:38:10 +01:00
Máté Kocsis
e34a1f9289
Convert zend_parse_parameters_none() to fast ZPP in standard lib
Closes GH-5037
2019-12-30 15:28:37 +01:00
Máté Kocsis
04deb532f0
Promote warning to exception in log() function 2019-12-05 08:30:47 +01:00
George Peter Banyard
2d0b0d6448 Remove unnecessary C99 checks for maths functions 2019-12-04 12:14:22 +01:00
Nikita Popov
6719d3e718 Add Z_PARAM_STRING/ARRAY_OR_NULL convenience macros 2019-10-29 13:29:52 +01:00
Nikita Popov
c43179fb6b Promote base_convert "invalid base" errors to ValueError 2019-10-29 13:12:37 +01:00
Nikita Popov
8f20b9969f Expect number argument in round() 2019-10-29 12:50:29 +01:00
Tyson Andre
9d48bf5152 Fix miscellaneous typos in docs and error messages
Closes GH-4863.
2019-10-28 11:44:08 +01:00
Nikita Popov
e35bdb4912 Add fdiv() function
The fdiv() function is part of the fmod() / intdiv() family. It
implements a floating-point division with IEEE-754 semantics.
That is, division by zero is considered well-defined and does not
trigger any kind of diagnostic. Instead one of INF, -INF or NAN
will be returned, depending on the case.

This is in preparation for throwing DivisionByZeroError from the
standard division operator.
2019-10-11 16:36:11 +02:00
Gabriel Caruso
95181553c8
Add missing zend_parse_parameters_none() checks
Closes GH-4796.
2019-10-08 23:10:18 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Nikita Popov
78068171dd Merge branch 'PHP-7.4' 2019-07-08 12:53:50 +02:00
Scott Dutton
d90cdbd9df Deprecate passing invalid character to base_convert etc
RFC: https://wiki.php.net/rfc/base_convert_improvements
2019-07-08 12:49:21 +02:00
Nikita Popov
3645292235 Merge branch 'PHP-7.4' 2019-06-19 15:09:39 +02:00
Nikita Popov
8740533ddf Avoid more UB in round() 2019-06-19 15:09:00 +02:00
Nikita Popov
0c0659dc50 Fix _php_math_round UB
php_intlog10abs() is ill-defined for a zero value. Avoid calling it
altogether as there's nothing to round with a zero value.
2019-06-19 15:09:00 +02:00
Nikita Popov
7686b0b889 Merge branch 'PHP-7.4' 2019-06-05 14:53:50 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Nikita Popov
fd911a7124 Expect string argument in hexdec, octdec, bindec
Instead of accepting zval and converting to string. Also rewrite the
functions to make it obvious that they cannot return false.
2019-06-03 11:26:25 +02:00
Nikita Popov
321fe88935 Add Z_PARAM_NUMBER and use it for some functions 2019-06-03 10:14:05 +02:00
Nikita Popov
a1a8d14485 Update more func info information for ext/standard 2019-05-29 15:30:06 +02:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Zeev Suraski
67e0138c0d Future-proof email addresses... 2018-11-01 18:30:28 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Dmitry Stogov
6d736aa400 Replace always true condition with ZEND_ASSERT() 2017-11-30 14:54:11 +03:00
Kalle Sommer Nielsen
4fbff82c10 Kill compiler warnings in ext/standard 2017-08-24 01:36:14 +02:00
Dmitry Stogov
9c2a1f52a5 Avoid useless dereferences and separations during paramter passing. 2017-06-19 12:55:59 +03:00
Craig Duncan
e946d074dd
Ensure number_format() doesn't include sign for zero 2017-05-09 10:17:19 +01:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Sara Golemon
c714152e58 Use new param API in standard/math 2016-12-30 13:02:59 -08:00
Kalle Sommer Nielsen
2104bea5d7 Remove Netware support
If this does not break the Unix system somehow, I'll be amazed. This should get most of it out, apologies for any errors this may cause on non-Windows ends which I cannot test atm.
2016-11-12 11:20:01 +01:00
Stanislav Malyshev
bbdd6a65e2 Merge branch 'PHP-7.1'
* PHP-7.1:
  More int->size_t and string overflow fixes
2016-11-05 13:59:56 -07:00
Stanislav Malyshev
f7f8aae33c Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  More int->size_t and string overflow fixes
2016-11-05 13:59:35 -07:00
Stanislav Malyshev
669763d88a More int->size_t and string overflow fixes 2016-11-05 13:22:17 -07:00
Andrea Faulds
d8f27b2be8 Merge branch 'DedupNANINF' 2016-10-26 16:46:36 +01:00
Anatol Belski
41ed9d1f9f Revert "Fix for #73240 - Write out of bounds at number_format"
This reverts commit 01280f8deb.

The fix is already merged by Stas.

(cherry picked from commit 80eb013a92)
2016-10-14 01:43:23 +02:00