Commit Graph

163 Commits

Author SHA1 Message Date
Nikita Popov
e118151139 Clear NEWS, UPGRADING and UPGRADING.INTERNALS 2019-01-28 11:17:30 +01:00
Nikita Popov
e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01:00
Dmitry Stogov
76d8f3923e Revert HASH_FLAG_INITIALIZED into HASH_FLAG_UNINITIALIZED. 2018-12-28 11:22:18 +03:00
Dmitry Stogov
b95cd92b9d Added note about changes in class declaration opcodes 2018-12-24 10:51:48 +03:00
Dmitry Stogov
d356f6d72b Removed add_get_assoc_*() and add_get_index_*() API functions 2018-12-19 16:47:48 +03:00
Christoph M. Becker
3b0f051193 Allow empty $escape to eschew escaping CSV
Albeit CSV is still a widespread data exchange format, it has never been
officially standardized.  There exists, however, the “informational” RFC
4180[1] which has no notion of escape characters, but rather defines
`escaped` as strings enclosed in double-quotes where contained
double-quotes have to be doubled.  While this concept is supported by
PHP's implementation (`$enclosure`), the `$escape` sometimes interferes,
so that `fgetcsv()` is unable to correctly parse externally generated
CSV, and `fputcsv()` is sometimes generating non-compliant CSV.  Since
PHP's `$escape` concept is availble for many years, we cannot drop it
for BC reasons (even though many consider it as bug).  Instead we allow
to pass an empty string as `$escape` parameter to the respective
functions, which results in ignoring/omitting any escaping, and as such
is more inline with RFC 4180.  It is noteworthy that this is almost no
userland BC break, since formerly most functions did not accept an empty
string, and failed in this case.  The only exception was `str_getcsv()`
which did accept an empty string, and used a backslash as escape
character then (which appears to be unintended behavior, anyway).

The changed functions are `fputcsv()`, `fgetcsv()` and `str_getcsv()`,
and also the `::setCsvControl()`, `::getCsvControl()`, `::fputcsv()`,
and `::fgetcsv()` methods of `SplFileObject`.

The implementation also changes the type of the escape parameter of the
PHP_APIs `php_fgetcsv()` and `php_fputcsv()` from `char` to `int`, where
`PHP_CSV_NO_ESCAPE` means to ignore/omit escaping.  The parameter
accepts the same values as `isalpha()` and friends, i.e. “the value of
which shall be representable as an `unsigned char` or shall equal the
value of the macro `EOF`.  If the argument has any other value, the
behavior is undefined.”  This is a subtle BC break, since the character
`chr(128)` has the value `-1` if `char` is signed, and so likely would
be confused with `EOF` when converted to `int`.  We consider this BC
break to be acceptable, since it's rather unlikely that anybody uses
`chr(128)` as escape character, and it easily can be fixed by casting
all `escape` arguments to `unsigned char`.

This patch implements the feature requests 38301[2] and 51496[3].

[1] <https://tools.ietf.org/html/rfc4180>
[2] <https://bugs.php.net/bug.php?id=38301>
[3] <https://bugs.php.net/bug.php?id=51496>
2018-12-15 14:38:15 +01:00
Tyson Andre
78a8b0f0d7 Fix a typo in UPGRADING.INTERNALS 2018-10-17 21:14:46 -04:00
Dmitry Stogov
d57cd36e47 Immutable clases and op_arrays.
Squashed commit of the following:

commit cd0c36c3f9
Merge: 4740dabb84 ad6738e886
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:43:38 2018 +0300

    Merge branch 'master' into immutable

    * master:
      Remove the "auto" encoding
      Fixed bug #77025
      Add vtbls for EUC-TW encoding

commit 4740dabb84
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:12:28 2018 +0300

    Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes.

commit ad7a78b253
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:46:30 2018 +0300

    Added comment

commit 0276ea5187
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:42:43 2018 +0300

    Added type cast

commit c63fc5d5f1
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:36:51 2018 +0300

    Moved static class members initialization into the proper place.

commit b945548e93
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:21:03 2018 +0300

    Removed redundand assertion

commit d5a4108840
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:19:13 2018 +0300

    Removed duplicate code

commit 8dadca8864
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:05:43 2018 +0300

    Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros.

commit 9ef07c88bd
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 10:48:29 2018 +0300

    typo

commit a06f0f3d3a
Merge: 94099586ec 3412345ffe
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 10:47:07 2018 +0300

    Merge branch 'master' into immutable

    * master:
      Remove unused variable makefile_am_files
      Classify object handlers are required/optional
      Add support for getting SKIP_TAGSTART and SKIP_WHITE options
      Remove some obsolete config_vars.mk occurrences
      Remove bsd_converted from .gitignore
      Remove configuration parser and scanners ignores
      Remove obsolete buildconf.stamp from .gitignore
      [ci skip] Add magicdata.patch exception to .gitignore
      Remove outdated ext/spl/examples items from .gitignore
      Remove unused test.inc in ext/iconv/tests

commit 94099586ec
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 15 23:34:01 2018 +0300

    Immutable clases and op_arrays
2018-10-17 15:52:50 +03:00
Nikita Popov
1cfbb21790 Classify object handlers are required/optional 2018-10-16 20:53:59 +02:00
Peter Kokot
37c329d715 Trim trailing whitespace in source code files 2018-10-13 14:17:28 +02:00
Nikita Popov
5a679341b8 Add UPGRADING notes
[ci skip]
2018-10-10 12:00:57 +02:00
Kalle Sommer Nielsen
bf34442581 Implemented RFC "Always available hash extension" 2018-10-03 08:47:07 +02:00
Dmitry Stogov
2606566269 Rename ZEND_ACC_NO_RT_ARENA into ZEND_ACC_HEAP_RT_CACHE and use it for pseudo-main op_arrays. 2018-10-02 09:10:04 +03:00
Anatol Belski
a2c843780e [ci skip] Update UPGRADING.INTERNALS 2018-09-22 02:05:28 +02:00
Dmitry Stogov
689c6fb188 Replace ZEND_ACC_ANON_BOUND, ZEND_ACC_UNRESOLVED_PARENT and ZEND_ACC_UNRESOLVED_INTERFACES with single ZEND_ACC_LINKED. 2018-09-18 11:41:40 +03:00
Nikita Popov
ca6caa0cb2 Make ext/xml API private
Also remove dead functions
2018-09-16 11:07:40 +02:00
Dmitry Stogov
49b92446d7 Remove zend_check_private() 2018-09-13 13:47:06 +03:00
Dmitry Stogov
0fbd2e6a16 Renumber ZEND_ACC_... flags 2018-09-11 17:21:17 +03:00
Dmitry Stogov
034b7ff091 Get rid of ZEND_ACC_IMPLICIT_PUBLIC 2018-09-11 12:26:26 +03:00
Dmitry Stogov
3a249e769b Squashed commit of the following:
commit 2d3cac9e00
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 11:54:47 2018 +0300

    Fixed static property access

commit 31786ee272
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 11:05:29 2018 +0300

    Avoid duplicate checks

commit 5ae502b979
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 10:39:17 2018 +0300

    Optimization

commit 82c17f0e8a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 09:26:50 2018 +0300

    Removed unused zend_duplicate_property_info()

commit ba53d1d0dd
Merge: eacc11b8fd c4b14370cf
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 09:24:13 2018 +0300

    Merge branch 'master' into shadow

    * master:
      7.0.33 next
      Sync NEWS [ci skip]
      add NEWS for 76582
      Enforce ordering of property compare in object comparisons
      Fixed wrong assertion
      Skip test on unsuitable env

commit eacc11b8fd
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Sep 10 13:12:39 2018 +0300

    Fixed failure of ext/spl/tests/array_017.phpt

commit 62d1871430
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Sep 10 11:55:07 2018 +0300

    Fixed issues

commit 1d37e3a40e
Merge: d6c3f098b6 1e550e6f7e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Sep 10 10:21:20 2018 +0300

    Merge branch 'master' into shadow

    * master:
      Update NEWS
      Fix for bug #76582
      Fix ssl stream reneg limit test to print only after first renegotiation
      Make a copy unconditionally
      Fix memory leak in pcre cache
      Remove not needed checking for <errno.h>
      Remove HAVE_ASSERT_H
      Add test for bug #76850
      Fixed bug #76850 Exit code mangled by set locale/preg_match
      Remove empty PHP tags from test
      Fix #75273: php_zlib_inflate_filter() may not update bytes_consumed
      Fix PCRE2 exclusion and remove dead libs in Makefile.gcov
      Report mem leaks to stderr if no Win debugger is present
      Use combined assignment contanation operator
      Fixed bug #76796
      Support fixed address mmap without replacement

commit d6c3f098b6
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Sep 7 13:56:30 2018 +0300

    Get rid of ZEND_ACC_SHADOW
2018-09-11 11:56:45 +03:00
Fabien Villepinte
ec110f1ecc Fix typos in UPGRADING.INTERNALS 2018-09-05 17:21:31 +02:00
Dmitry Stogov
8939c4d96b Get rid of ZEND_ACC_CTOR, ZEND_ACC_DTOR and ZEND_ACC_IMPLEMENTED_ABSTRACT 2018-09-05 13:16:10 +03:00
Peter Kokot
29dc0470c8
Remove AC_FUNC_UTIME_NULL
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems, including the AC_FUNC_UTIME_NULL.

This macro checks if `utime(file, NULL)` sets file's timestamp to the
current time and defines the `HAVE_UTIME_NULL` symbol. This check was
relevant on very old systems (for example, 4.3BSD released in 1986) and
today can be omitted for systems with utime since it should be well
supported by now. [2]

Refs:
[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-04 12:03:34 +02:00
Peter Kokot
ef12e96215 Remove AC_FUNC_VPRINTF
Autoconf 2.59d (released in 2006) 1 started promoting several macros
as not relevant for newer systems anymore, including the AC_FUNC_VPRINTF.

This macro checks for presence of the vprint function otherwise checks
for presence of the _doprnt function. This check was relevant on very
old systems and today can be omitted since it should be well supported
by now. [2]

Also PHP doesn't use the HAVE_VPRINTF or HAVE_DOPRNT symbols.

Refs:
[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-08-29 21:31:55 +02:00
Peter Kokot
3748d8070f Implement #64517: Add AC_ARG_PROGRAM macro
The AC_ARG_PROGRAM Autoconf macro provides program name transformations
when installing. This patch implements #64517 and prepares the
implementation for the request #60518.

In ./configure --help it additionally outputs --program-prefix=PREFIX,
--program-suffix=SUFFIX and the upcoming --program-transform-name=PROGRAM
option.

Macro AC_ARG_PROGRAM is available since Autoconf 2.0 and needs to be
called after the AC_CANONICAL_TARGET macro.

Refs:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Transforming-Names.html
2018-08-29 02:04:48 +02:00
Dmitry Stogov
92fdf9d629 Change zend_lookup_class_ex() and zend_fetch_class_by_name() prototypes to accept optional lower-case class name as zend_string*, instead of zval*. 2018-08-22 17:07:31 +03:00
Christoph M. Becker
c9861bd7a9 Create and expose php_sys_symlink() and php_sys_link()
These macros are supposed to behave like POSIX's symlink() and link(),
respectively, on POSIX compliant systems and on Windows.

Future scope: merge link.c and link_win32.c
2018-08-02 14:08:30 +02:00
Christoph M. Becker
bccf0dfba1 Prepare UPGRADING(.INTERNALS) for PHP 7.4
We also add this as task to README.RELEASE_PROCESS, so that it's not
overlooked next time.
2018-07-31 15:54:03 +02:00
Peter Kokot
7c1e0930c4 Remove TSRM_CHECK_GCC_ARG and LIBZEND_CPLUSPLUS_CHECKS
This removes two old Autoconf macro definitions since they are not used
anymore.
2018-07-31 05:59:05 +02:00
Peter Kokot
72551dd89e [ci skip] Document RETSIGTYPE 2018-07-29 21:32:35 +02:00
Peter Kokot
209f05a878 [ci skip] Note HAVE_ST_BLKSIZE and HAVE_ST_RDEV 2018-07-29 14:44:56 +02:00
Peter Kokot
d7ad4babe0 [ci skip] Note removal of PHP_PROG_LEX 2018-07-29 13:37:48 +02:00
Dmitry Stogov
ab8094c666 Pack zend_constant.flags and zend_constant.module_number into reserved space inside zend_constant.value. 2018-07-26 12:58:07 +03:00
Dmitry Stogov
57c4ae393c typo 2018-07-25 23:00:33 +03:00
Dmitry Stogov
f950128cd6 Encode parent class name as IS_CONST operand in DECLARE_INHERITED_CLASS and DECLARE_ANON_INHERITED_CLASS opcodes (eliminate FETCH_CLAS
S opcode).
2018-07-25 13:40:47 +03:00
Remi Collet
0c3561892b add info about zend_class_entry.iterator_funcs 2018-07-18 11:17:53 +02:00
Christoph M. Becker
0896a3abd1 [ci skip] Fix typos 2018-07-10 17:03:48 +02:00
Christoph M. Becker
091c0a8a59 [ci skip] Document changes to php_add[c]slashes 2018-07-10 16:04:14 +02:00
Tyson Andre
5bbe6080b4 [ci skip] Fix a typo. RANGE_RANGE should be RAND_RANGE 2018-07-05 12:11:56 +02:00
Christoph M. Becker
d798fd491b [ci skip] Document GC_C() → zend_gc_get_status() 2018-07-04 12:19:29 +02:00
Christoph M. Becker
2ff26bdf73 [ci skip] Document new typedef zif_handler 2018-06-28 12:52:36 +02:00
Markus Staab
a0a4232ae3 [ci skip] fixed typos 2018-06-25 13:14:55 +02:00
Dmitry Stogov
ecce21169e Added note about zend_function.reserved[] fields usage 2018-06-25 13:35:14 +03:00
Remi Collet
3b9ecb2d65 add note about php_url struct changes 2018-06-22 14:58:30 +02:00
Robert Lu
ecc1a7c582 Fix bug #44217: Output after stdout/stderr closed cause immediate exit with status 0
We exit with status 255 instead.
2018-06-19 12:15:33 +02:00
Anatol Belski
acda5e084e Document new configurue options 2018-03-08 12:14:48 +01:00
Xinchen Hui
cf0fae5e97 Optimized base64_encode/decode with SIMD instructions 2018-02-12 20:53:14 +08:00
Dmitry Stogov
1208acfe5f Added note about changed VM instructions 2018-02-02 17:35:23 +03:00
Dmitry Stogov
17a3b48454 Make IS_UNUSED to be zero. 2018-01-31 11:18:41 +03:00
Dmitry Stogov
742d5a01ed Get rid of IS_TYPE_COPYABLE. 2018-01-19 17:47:26 +03:00