Commit Graph

1210 Commits

Author SHA1 Message Date
Máté Kocsis
3709e74b5e
Store default parameter values of internal functions in arg info
Closes GH-5353. From now on, PHP will have reflection information
about default values of parameters of internal functions.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-04-08 18:37:51 +02:00
Remi Collet
319c21b1f6 news / UPGRADING for zip 1.19.0 2020-04-02 14:58:13 +02:00
Nikita Popov
5a09b9fb0f Add PhpToken class
RFC: https://wiki.php.net/rfc/token_as_object

Relative to the RFC, this also adds a __toString() method,
as discussed on list.

Closes GH-5176.
2020-03-26 11:09:18 +01:00
Nikita Popov
f74e30c07c Check abstract method signatures coming from traits
RFC: https://wiki.php.net/rfc/abstract_trait_method_validation

Closes GH-5068.
2020-03-26 10:07:22 +01:00
Máté Kocsis
782f7e2ad8
Fix #75958 Return void instead of true 2020-03-25 15:04:33 +01:00
Remi Collet
d12b4c3c24 bump zip version 2020-03-20 14:08:57 +01:00
Remi Collet
a4d12f46d1 ZipArchive::open(): Using empty file as ZipArchive is deprecated 2020-03-20 11:27:42 +01:00
Nikita Popov
df79277de3 Revert "Fetch for read in nested property assignments"
This reverts commit bb43a3822e.

After thinking about this a bit more, this is now going to be
a complete solution for the "readonly properties" case, for example:

    unset($foo->readOnly->bar);

should also be legal and

    $foo->readOnly['bar'] = 42;

should also be legal if $foo->readOnly is not an array but an
ArrayAccess object.

I think it may be better to distinguish better on the BP_VAR flag
level. Reverting for now.
2020-03-18 14:54:43 +01:00
Remi Collet
a5f136b855 bump zp to 1.18.1 + doc 2020-03-18 14:09:50 +01:00
Nikita Popov
bb43a3822e Fetch for read in nested property assignments
$a->b->c = 'd';

is now compiled the same way as

    $b = $a->b;
    $b->c = 'd';

That is, we perform a read fetch on $a->b, rather than a write
fetch.

This is possible, because PHP 8 removed auto-vivification support
for objects, so $a->b->c = 'd' may no longer modify $a->b proper
(i.e. not counting interior mutability of the object).

Closes GH-5250.
2020-03-18 12:08:06 +01:00
Christoph M. Becker
66d8d0c7d7 Drop support for iconv without proper errno setting
It is hard to impossible to work around iconv() implementations which
do not properly set errno according to POSIX.  We therefore do no
longer allow to build against such iconv() implementations.

Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
2020-03-17 14:02:29 +01:00
Philipp Tanlak
1668ad7cb1 Add str_contains() function
RFC: https://wiki.php.net/rfc/str_contains

Closes GH-5179.
2020-03-16 11:05:26 +01:00
Nikita Popov
0fdffc1807 Update Unicode tables to 13.0.0 2020-03-12 11:29:51 +01:00
Nikita Popov
fff5771ccc Require non-absolute trait method refs to be unambiguous
Currently, when writing something like

class X {
    use T1, T2 {
       func as otherFunc;
    }
    function func() {}
}

where both T1::func() and T2::func() exist, we will simply assume
that func refers to T1::func(). This is surprising, and it doesn't
really make sense that this particular method gets picked.

This commit validates that non-absolute method references are
unambiguous, i.e. refer to exactly one method. If there is
ambiguity, it is required to write T1::func as otherFunc or
similar.

Closes GH-5232.
2020-03-10 16:01:13 +01:00
Remi Collet
ed998f8a0d Fix #50678 files extracted by ZipArchive class lost their original modified time 2020-03-09 07:09:50 +01:00
Remi Collet
125724cf58 [ci skip] fix for #72374 is no more a BC break 2020-03-06 10:29:16 +01:00
Remi Collet
e786e9c83c upgrade information about changs in Zip 2020-03-05 14:03:20 +01:00
Nikita Popov
336eb48c36 Automatically implement Stringable interface 2020-03-02 15:25:33 +01:00
Benjamin Eberlei
531ea6d340 Add upgrading note regarding merge of RFC for new DOMParentNode/DOMChildNode APIs. 2020-02-28 17:35:54 +01:00
Nicolas Oelgart
aa79a22d32 Add preg_last_error_msg() function
Provides the last PCRE error as a human-readable message, similar
to functionality existing in other extensions, such as
json_last_error_msg().

Closes GH-5185.
2020-02-25 10:26:03 +01:00
Nikita Popov
a939805641 Use serialize_precision for var_dump()
var_dump() is debugging functionality, so it should print
floating-point numbers accurately. We do this by switching
to serialize_precision, which (by default) will print with
as much precision as necessary to preserve the exact value
of the float.

This also affects debug_zval_dump().

Closes GH-5172.
2020-02-25 09:51:32 +01:00
Máté Kocsis
f031735489
Update UPGRADING
[skip ci]
2020-02-20 11:13:24 +01:00
Nikita Popov
3b08f53c97 Deprecate required param after optional
As an exception, we allow "Type $foo = null" to occur before a
required parameter, because this pattern was used as a replacement
for nullable types in PHP versions older than 7.1.

Closes GH-5067.
2020-02-18 14:35:58 +01:00
Christoph M. Becker
9ca449e0a8 Make quoting of cmd execution functions consistent
While the `$command` passed to `proc_open()` had to be wrapped in
double-quotes manually, that was implicitly done for all other
program execution functions.  This could easily introduce bugs and
even security issues when switching from one to another program
execution function.

Furthermore we ensure that the additional quotes are always
unwrapped regardless of what is passed as `$command` by passing
the `/s` flag to cmd.exe.  As it was, `shell_exec('path with
spaces/program.exe')` did execute program.exe, but adding an
argument (`shell_exec('path with spaces/program.exe -h)`) failed
to execute program.exe, because cmd.exe stripped the additional
quotes.

While these changes obviously can cause BC breaks, we feel that in
the long run the benefits of having consistent behavior for all
program execution functions outweighs the drawbacks of potentially
breaking some code now.
2020-02-17 23:17:17 +01:00
Nikita Popov
72bd55902d Improve generated names for anonymous classes
In order of preference, the generated name will be:

    new class extends ParentClass {};
    // -> ParentClass@anonymous
    new class implements FirstInterface, SecondInterface {};
    // -> FirstInterface@anonymous
    new class {};
    // -> class@anonymous

This is intended to display a more useful class name in error messages
and stack traces, and thus make debugging easier.

Closes GH-5153.
2020-02-17 12:21:33 +01:00
Nikita Popov
43443857b7 Add static return type
RFC: https://wiki.php.net/rfc/static_return_type

The "static" type is represented as MAY_BE_STATIC, rather than
a class type like "self" and "parent", as it has special
resolution semantics, and cannot be cached in the runtime cache.

Closes GH-5062.
2020-02-17 11:51:09 +01:00
Tyson Andre
d9b80efb57 [skip ci] Fix typos in UPGRADING
Closes GH-5183
2020-02-16 10:28:39 -05:00
Nikita Popov
ae2e4b5953 Add UPGRADING notes
Not listing the details here, I think the RFC is a better reference
for the precise technical details.

[ci skip]
2020-02-11 12:44:43 +01:00
Nikita Popov
d933591674 Add support for $obj::class
This allows $obj::class, which gives the same result as get_class($obj).
Anything other than an object results in TypeError.

RFC: https://wiki.php.net/rfc/class_name_literal_on_object

Closes GH-5065.
2020-02-11 12:16:30 +01:00
Dmitry Stogov
64b40f69dc Make ASSIGN, ASSIGN_OP, INC and DEC opcodes to return IS_TMP_VAR instead of IS_VAR.
This helps to avoid unnecessary IS_REFERENCE checks.
This changes some notices "Only variables should be passed by reference" to exception "Cannot pass parameter %d by reference".

Also, for consistency, compile-time fatal error "Only variables can be passed by reference" was converted to exception "Cannot pass parameter %d by reference"
2020-02-07 13:36:52 +03:00
Markus Staab
9f4d1b9936 Fix typo [ci skip] 2020-01-26 16:08:46 +01:00
George Peter Banyard
300d4df654 Add mention about empty needles for strrch() functions in UPGRADING [ci skip] 2020-01-25 12:34:42 +01:00
wbender
98bfad738a Fix bug #64865: Use CONTEXT_DOCUMENT_ROOT for scanning dir tree
If CONTEXT_DOCUMENT_ROOT is set use that rather than DOCUMENT_ROOT to
scan up the dir tree looking for .user.ini files.

Closes GH-5051.
2020-01-24 15:33:55 +01:00
Nikita Popov
e72bf63691 Allow variadic arguments to replace non-variadic ones
Any number of arguments can be replaced by a variadic one, so
long as the variadic argument is compatible (in the sense of
contravariance) with the subsumed arguments.

In particular this means that function(...$args) becomes a
near-universal signature: It is compatible with any function
signature that does not accept parameters by-reference.

This also fixes bug #70839, which describes a special case.

Closes GH-5059.
2020-01-23 15:23:31 +01:00
Máté Kocsis
4281c2a989
Add UPGRADING notes [skip ci] 2020-01-22 23:24:50 +01:00
Christoph M. Becker
7426e3b6a1 Bump required libcurl version to 7.29.0
libcurl 7.29.0 has been released almost eight years ago, so this
version is supposed to be available practically everywhere.  This bump
also allows us to get rid of quite some conditional code and tests
catering to very old libcurl versions.
2020-01-19 14:10:46 +01:00
Christoph M. Becker
f6fbe13717 Rename run-test.php to run-tests.php in the test packs
In the php-src repository, the test runner is named run-tests.php, but
when it is copied to the tests packs, it is renamed to run-test.php.
This renaming does not make sense, and is actually somewhat confusing.
Although changing the name back to run-tests.php constitutes a BC
break, we think the benefit of having a single name outweights the
disadvantages in the long run.
2020-01-14 18:31:25 +01:00
Christoph M. Becker
03bd4333f6 Add imagegetinterpolation()
While `imagesetinterpolation()` is available as of PHP 5.5.0,
there is no according getter function, so users would have to track the
current interpolation method manually.

To remedy this, we introduce `imagegetinterpolation()` as thin wrapper
for `gdImageGetInterpolationMethod()` (which has been introduced with
libgd 2.1.1), and use `im->interpolation_id` as fallback for older
libgd.  Since our bundled libgd does not yet have this function, we add
it.

We also simplify the recently introduced bug79068.phpt, where it is
sufficient to check that the interpolation method has not been changed.
2020-01-14 18:25:27 +01:00
Islam Israfilov
f553e676ec Fixed #78385: Distinguish absent/empty query/fragment
http://example.com/foo   => query = null, fragment = null
http://example.com/foo?  => query = "",   fragment = null
http://example.com/foo#  => query = null, fragment = ""
http://example.com/foo?# => query = "",   fragment = ""

Closes GH-5078.
2020-01-13 10:18:23 +01:00
George Peter Banyard
66659d6cf6 [ci skip] Update UPGRADING 2020-01-09 00:38:47 +01:00
mike
1658b5babc Adding DateTime(Immutable)::createFromInterface()
These are like

    DateTime::createFromImmutable()
    DateTimeImmutable::createFromMutable()

but accept any DateTimeInterface instead.

Closes GH-5016.
2020-01-03 16:55:12 +01:00
Nikita Popov
d8c9902567 Implement WeakMap
RFC: https://wiki.php.net/rfc/weak_maps
2020-01-03 10:43:24 +01:00
Wouter Wijsman
f13d0a72d5 Add FILTER_VALIDATE_BOOL as alias for FILTER_VALIDATE_BOOLEAN
Both filters are equivalent, but FILTER_VALIDATE_BOOL uses our
canonical name for the type (the only one permitted in type
declarations for example), so the new name is preferred long
term.

The old name may be deprecated in the future, but no specific
timeline is planned.
2019-12-30 14:18:03 +01:00
BohwaZ
3958592487 Add setAuthorizer method to SQLite3
This adds the possibility to define a userland callback that will be
used to authorize or not an action on the database.
2019-12-20 11:33:23 +01:00
Máté Kocsis
bc231f017b
Add upgrading note about implode() [ci skip] 2019-12-19 22:58:26 +01:00
George Peter Banyard
fdf45debdf Remove deprecated behaviour of passing encoding as third parameter in mb_strrpos()
Merged GH-5011
2019-12-13 22:03:27 +01:00
Máté Kocsis
73730eebca
Add upgrading notes about removed functionality that were deprecated in PHP 7.4 2019-12-05 13:15:55 +01:00
Christoph M. Becker
2de79f0855 Make the $num_points parameter of php_imagepolygon optional
That parameter is mostly useless in practise, and likely has been
directly ported from the underlying `gdImagePolygon()` and friends,
which require that parameter since the number of elements of the point
array would otherwise be unknown.  Typical usages of `imagepolygon()`,
`imageopenpolygon()` and `imagefilledpolygon()` pass `count($points)/2`
or hard-code this value as literal.  Since explicitly specifying this
parameter is annoying and error-prone, we offer the possibility to omit
it, in which case the `$points` array must have an even number of
elements, and the number of points is calculated as `count($points)/2`.
2019-11-15 09:41:10 +01:00
Nikita Popov
999e32b65a Implement union types
According to RFC: https://wiki.php.net/rfc/union_types_v2

The type representation now makes use of both the pointer payload
and the type mask at the same time. Additionall, zend_type_list is
introduced as a new kind of pointer payload, which is used to store
multiple class types. Each of the class types is a tagged pointer,
which may be either a class name or class entry. The latter is only
used for typed properties, while arguments/returns will instead use
cache slots. A type list can contain a mix of both names and CEs at
the same time, as not all classes may be resolvable.

One thing this is missing is support for union types in arginfo
and stubs, which I want to handle separately.

I've also dropped the special object code from the JIT implementation
for now -- I plan to add this back in a different form at a later time.
For now I did not want to include non-trivial JIT changes together
with large functional changes.

Another possible piece of follow-up work is to implement "iterable"
as an internal alias for "array|Traversable". I believe this will
eliminate quite a few special-cases that had to be implemented.

Closes GH-4838.
2019-11-08 15:15:48 +01:00
Nikita Popov
c46b2ed677 Remove support for array_key_exists() with objects 2019-11-04 13:10:03 +01:00
Tyson Andre
96f361dca0 Update documentation/comment for GH-4860
Fix folding for the new helper method.

Clarify comment in UPGRADING:
The performance on associative arrays would also improve,
as long as no offsets were unset (no gaps).
Packed arrays can have gaps.

Closes GH-4873.
[ci skip]
2019-10-30 10:26:56 +01:00
Nikita Popov
87fefd165a Remove ability to unbind $this of closures if used
This was deprecated in PHP 7.4, removing it for PHP 8.0.
2019-10-28 13:24:07 +01:00
Tyson Andre
9d48bf5152 Fix miscellaneous typos in docs and error messages
Closes GH-4863.
2019-10-28 11:44:08 +01:00
Tyson Andre
e7ff590d0d Optimize array_slice for packed arrays with large offsets
If the offset is 100000, and there are no gaps in the packed/unpacked array,
then advance the pointer once by 100000,
instead of looping and skipping 100000 times.

Add a new test of array_slice handling unset offsets.

Closes GH-4860.
2019-10-28 11:30:59 +01:00
Colin O'Dell
e7335eb420 Allow array_splice() length to be null 2019-10-23 11:22:12 +02:00
Colin O'Dell
80103bdb78 Document the changes to substr functions 2019-10-23 11:22:12 +02:00
Nikita Popov
530a8a3854 Fix and undeprecate ReflectionType::__toString()
Add deprecated _ZendTestClass::__toString() method to preserve
an existing test.

ReflectionType::__toString() will now return a complete
representation of the type, as it should have originally. Users
that relied on nullability being absent should have been pushed
to ReflectionNamedType::getName() by the deprecation of
ReflectionType::__toString() in PHP 7.1 / PHP 7.4.
2019-10-22 11:26:02 +02:00
Nikita Popov
5c24f8042d Promote "Cannot use parent" to fatal error 2019-10-15 11:46:48 +02: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
Nikita Popov
db233501ff Use clean shutdown on uncaught exception 2019-10-11 12:41:15 +02:00
Nikita Popov
d44cf9b539 Replace "unexpected character" warning with ParseError
Closes GH-4767.
2019-10-04 11:28:58 +02:00
tyage
4d6f88e215 Fix #72374: remove_path strips first char of filename 2019-10-02 15:33:28 +02:00
Nikita Popov
2f92957fd3 Convert some notices to warnings
Part of https://wiki.php.net/rfc/engine_warnings.
2019-10-02 10:34:08 +02:00
Mark
8aad466c42 Convert GD Resources to objects 2019-09-30 15:14:02 +02:00
Nikita Popov
38b19d47e0 Convert "Only arrays and Traversables can be unpacked" into Error 2019-09-27 15:50:34 +02:00
Nikita Popov
e8b0163e0b Promote write "use scalar as array" warning to Error 2019-09-27 15:49:18 +02:00
Nikita Popov
0ebf2bdba0 Convert "Illegal offset type" warnings to exceptions 2019-09-27 13:00:07 +02:00
Nikita Popov
f2b09969db Convert "cannot add element" warning to exception 2019-09-27 13:00:07 +02:00
Nikita Popov
a66c60cce3 Throw Error when writing property of non-object
This removes object auto-vivification support.

This also means that we can remove the corresponding special
handling for typed properites: We no longer need to check that a
property is convertible to stdClass if such a conversion might
take place indirectly due to a nested property write.

Additionally OBJ_W style operations now no longer modify the
object operand, and as such we no longer need to treat op1 as a
def in SSA form.

The next step would be to actually compile the whole LHS of OBJ_W
operations in R rather than W mode, but that causes issues with
SimpleXML, whose object handlers depend on the current compilation
structure.

Part of https://wiki.php.net/rfc/engine_warnings.
2019-09-27 10:11:47 +02:00
Christoph M. Becker
5356bad8c6 Remove unused parameter
The `$use_include_path` parameter doesn't make sense for
`tidy_repair_string()`, and actually unused, so we remove it.
2019-09-22 16:28:42 +02:00
Christoph M. Becker
48892e6d24 Remove unused parameter
Cf. <https://bugs.php.net/78579>.
2019-09-21 16:30:17 +02:00
Nikita Popov
cdd4e591a4 Don't make argument nullable based on AST null initializer
Closes GH-4720.
2019-09-19 11:27:00 +02:00
Christoph M. Becker
d61bc63c4d Change XMLWriter resources to objects
While we generally prefer objects over resources for quite a while, the
procedural XMLWriter API still uses resources, although there is
already an object-oriented API which uses objects.  This dichotomy
makes no sense, slightly complicates the implementation, and doesn't
allow a stepwise migration to the object-oriented API, which might be
desired.  Thus we completely drop the XMLWriter resources in favor of
XMLWriter objects.

We consider the minor BC break acceptable for a major version, since
only explicit type checks (`is_resource()`, `gettype()` etc.) need to
be adapted.
2019-09-18 08:52:14 +02:00
Benjamin Eberlei
873b54840f Upgrading notes for removed ext/dom classes. 2019-09-17 23:52:08 +02:00
Peter Cowburn
4253811c42 upgrading notes for ValueError/zend_value_error() 2019-09-10 13:19:24 +01:00
Nikita Popov
790ed7d540 Enable display_startup_errors by default 2019-09-06 14:33:03 +02:00
Nikita Popov
ea5854ca8c Make error_reporting=E_ALL the default 2019-09-02 10:03:26 +02:00
George Peter Banyard
6d578482a9 Improve strpos and strstr function family implementation 2019-08-26 17:11:37 +02:00
viest
48040cf345 Remove deprecated getaddrinfo flags
The AI_IDN_ALLOW_UNASSIGNED and AI_IDN_USE_STD3_ASCII_RULES have
been deprecated by glibcs, and PHP 7.4 follows this deprecation.

This removes the offending flags for PHP 8.0.
2019-08-26 11:45:31 +02:00
Sjon Hortensius
05752d3acf Ref #77388: Don't pass BAD_ESCAPE_IS_LITERAL
This option is considered dangerous and unwanted. To allow for more
graceful migration don't error on now ignored X modifier.

Closes GH-4430.
2019-07-18 10:52:27 +02:00
Nikita Popov
0904dd3dc2 Remove INPUT_SESSION and INPUT_REQUEST
These were never supported and always generated a warning. Remove
them entirely for PHP 8.
2019-07-08 10:50:34 +02:00
Tyson Andre
435384127c Fix a typo in UPGRADING 2019-06-16 11:24:44 +02:00
Bob Weinand
af12aa8124 Merge branch 'concatenation_precedence' 2019-05-16 18:39:48 +02:00
Nikita Popov
fd2db11929 Always generate fatal error for LSP failures
RFC: https://wiki.php.net/rfc/lsp_errors
2019-05-07 13:45:28 +02:00
Kalle Sommer Nielsen
4218466111 Okay, too quick to merge, these are only relevant to 7.4 2019-05-01 23:48:05 +03:00
Kalle Sommer Nielsen
c71e35ea91 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove some more interbase leftovers
  Fix typo
  NEWS for ext/interbase unbundling
2019-05-01 23:45:24 +03:00
Kalle Sommer Nielsen
c8a20dfdca NEWS for ext/interbase unbundling 2019-05-01 23:35:30 +03:00
Nikita Popov
55ecfe4ef3 Add UPGRADING entries 2019-04-29 14:17:44 +02:00
Christoph M. Becker
c68dc6b5e3 Extend CURLFile to support streams
Due to former restrictions of the libcurl API, curl multipart/formdata
file uploads supported only proper files.  However, as of curl 7.56.0
the new `curl_mime_*()` API is available (and already supported by
PHP[1]), which allows us to support arbitrary *seekable* streams, which
is generally desirable, and particularly resolves issues with the
transparent Unicode and long part support on Windows (see bug #77711).

Note that older curl versions are still supported, but CURLFile is
still restricted to proper files in this case.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=a83b68ba56714bfa06737a61af795460caa4a105>
2019-04-29 10:21:07 +02:00
Nikita Popov
3cfbbf2956 Make DateInterval objects uncomparable
Arbitrary DateInterval objects don't have well-defined comparison
semantics. Throw a warning and treat the objects as uncomparable.

Support for comparing DateInterval objects returned by
DateTime::diff() may be added in the future.
2019-04-23 13:12:06 +02:00
Peter Kokot
a353d4c218 Update changelogs 2019-04-20 16:16:18 +02:00
Hugh McMaster
9f0c9b7ad6 Rename --enable-libxml to --with-libxml to meet naming guidelines 2019-04-18 13:08:02 +02:00
Nikita Popov
e2ea0f105c Fix bug #77866: Port Serializable SPL classes to use __unserialize()
Payloads created using Serializable are still supported.
2019-04-10 09:36:39 +02:00
Nikita Popov
e35a3cb28c ext/xml: Use object instead of resource
Use an XmlParser object instead of a resource. This is an internal
representation change, not a conversion to OO APIs. XmlParser objects
cannot be explicitly constructed, they are created through the usual
xml_parser_* APIs.

This change allows us to provide a proper get_gc() implementation,
thus resolving bugs #72793 and #76874.

xml_parser_free() is a no-op now and need not be called anymore.
2019-04-08 16:23:13 +02:00
Florian Berberich
07df6594b5 Added range options to the float validation filter
php_filter_int (called via the constant FILTER_VALIDATE_INT) has the options min_range
and max_range. they allow the user to not only test if a value is a double but also if
the value is inside a specific range. php_filter_float (called via the constant
FILTER_VALIDATE_FLOAT) didn't provide this yet, making validation of numeric but
not-only-int values more complicated for the user.
this commits implements the options min_range and max_range for the function
php_filter_float to fix this inconsistency.
2019-04-08 13:22:26 +02:00
Nikita Popov
d373c11e71 Implement new custom object serialization mechanism
RFC: https://wiki.php.net/rfc/custom_object_serialization
2019-03-22 10:43:06 +01:00
Nikita Popov
6311581ac6 Fix bug #73948
If PREG_UNMATCHED_AS_NULL is used, make sure that unmatched capturing
groups at the end are also set to null, rather than just those in the
middle.
2019-03-21 09:50:20 +01:00
Kalle Sommer Nielsen
26f98ecd19 Sync the changes to ext/filter with 7.4, now that it works.
- Removed --with-pcre-dir
- The filter extension can now be built as shared on Unix with ./configure
2019-03-20 20:09:45 +02:00
Christoph M. Becker
6bbb18a0b6 Unbundle ext/wddx
The extension is now available from <https://pecl.php.net/package/wddx>.

Cf. <https://wiki.php.net/rfc/deprecate-and-remove-ext-wddx>.
2019-03-20 14:15:50 +01:00
Nikita Popov
12bcdd68b4 Fix #77094: Add flags support for pcre_replace_callback(_array) 2019-03-19 10:38:21 +01:00
Nikita Popov
2b9acd37f0 Fixed bug #72685
We currently have a large performance problem when implementing lexers
working on UTF-8 strings in PHP. This kind of code tends to perform a
large number of matches at different offsets on a single string. This
is generally fast. However, if /u mode is used, the full string will
be UTF-8 validated on each match. This results in quadratic runtime.

This patch fixes the issue by adding a IS_STR_VALID_UTF8 flag, which
is set when we have determined that the string is valid UTF8 and
further validation is skipped.

A limitation of this approach is that we can't set the flag for interned
strings. I think this is not a problem for this use-case which will
generally work on dynamic data. If we want to use this flag for other
purposes as well (mbstring?) then it might be worthwhile to UTF-8 validate
strings during interning. But right now this doesn't seem useful.
2019-03-18 16:58:48 +01:00
Claude Pache
37443a6318 test reversed 2019-03-13 20:27:17 +01:00
Joe Watkins
b003e0a0f5
weakrefs upgrading note 2019-03-12 06:52:43 +01:00
Andrew Brampton
c79ce48ddb Fix #71890: Add support for crc32c Castagnoli's polynomial.
This variant of crc32 is heavily used by storage systems, such as iSCSI, SCTP,
Btrfs, ext4, and is increasingly being used in API (such as Google Cloud
Storage, and Apache Kafka).
2019-03-11 10:19:35 +01:00
Nikita Popov
deb44d405e Revert "Detect invalid uses of parent:: during compilation"
This reverts commit a9e6667817.

Breakage found in the wild: Mockery uses a parent:: call in the
implementation regardless of whether the class has a parent or not:
4324afeaf9/library/Mockery/Mock.php (L600)

This change is not worth the compat break in 7.4.
2019-03-04 12:24:02 +01:00
Kalle Sommer Nielsen
5e8ed0a0f5 NEWS 2019-03-01 01:41:19 +02:00
Nikita Popov
7be0e06b48 Remove mysqli embedded server support
This code is not compatible with PHP 7.0. The fact that nobody
complained that the mysqli embedded server functionality doesn't
build anymore seems like a strong signal that we can drop it...
2019-02-28 12:55:16 +01:00
Christoph M. Becker
f04cf7a587 Remove ability to import case-insensitive constants from typelibs
According to commit 23a5be3[1], we remove the ability to import case-
insensitive constants, but do not remove the now superfluous parameter
and ini setting.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=23a5be3696f4d92e1b18fd59f3ac63c6a15ea12a>
2019-02-19 16:54:52 +01:00
Tyson Andre
12ffee57d6 Fixed bug #77631
Do not include unbound anonymous classes in get_declared_classes().

Note that earlier PHP versions would include the anonymous class in
get_declared_classes(), and return false until the class was bound,
but would not crash.
2019-02-19 10:07:40 +01:00
Remi Collet
b537203d20 use pkg-config for libedit 2019-02-19 09:10:06 +01:00
Pedro Magalhães
40278879fd UPGRADING entry for pcntl_unshare [skip ci] 2019-02-18 19:58:56 +00:00
Christoph M. Becker
fae22461f9 Deprecate case-insensitive constants via typelib import
As of PHP 7.3.0, case-insensitive constants are deprecated.  We catch
up on this with regard to ext/com_dotnet, which allows to import
constants from typelibs, by triggering a deprecation notice whenever
`com_load_typelib()` is called with `$case_sensitive` being `false`,
and whenever `com.autoregister_casesensitive` is set to `false`,
regardless of whether there are actually constants in the typelib which
would be imported.
2019-02-15 13:07:56 +01:00
Gabriel Caruso
14357e5bcb Add UPGRADING entry for ad75511c8e 2019-02-14 05:15:27 -02:00
Nikita Popov
6347f0b937 Implement ReflectionReference
RFC: https://wiki.php.net/rfc/reference_reflection
2019-02-13 12:21:18 +01:00
Anatol Belski
34122ede21 Update NEWS and UPGRADING [ci skip] 2019-02-12 19:14:32 -08:00
legale
d77ad27415 Implement mb_str_split()
RFC: https://wiki.php.net/rfc/mb_str_split
2019-02-12 16:42:51 +01:00
kasper Franz
c4b77e03b1 Correct section number in UPGRADING
This make the top list follow the bottom numbering

[ci skip]
2019-02-12 15:09:09 +01:00
David Carlier
4e87e56e22 Adding bunch of FreeBSD socket options flags specifics.
SO_USER_COOKIE primarly to be traced via dtrace instrumentation.
If SO_USER_COOKIE is available, the rest is so the former is
two years old while the rest is from around 2008.
2019-02-12 10:27:33 +01:00
Christoph M. Becker
6ac8b0a783 Deprecate ext/wddx
Cf. <https://wiki.php.net/rfc/deprecate-and-remove-ext-wddx>.
2019-02-11 19:31:46 +01:00
Nikita Popov
61ef088f21 Add missing braces in UPGRADING example
[ci skip]
2019-02-11 17:10:36 +01:00
Nikita Popov
a302d11610 Don't silence fatal errors with @ 2019-02-11 16:17:55 +01:00
Nikita Popov
a6c535e658 Add UPGRADING notes for oniguruma unbundling 2019-02-11 15:00:33 +01:00
Nikita Popov
e93d6d97aa Disable PEAR by default
Installation of PEAR can be enabled using --with-pear, but will
through a deprecation warning during ./configure.
2019-02-11 11:10:13 +01:00
Nikita Popov
fdb85a828a Return empty str from quotemeta() on empty str 2019-02-11 09:58:10 +01:00
Nikita Popov
ab48b45f6c Improve UPGRADING note
[ci skip]
2019-02-11 09:54:08 +01:00
Peter Kokot
5ca12f6c5f [ci skip] Update changelog 2019-02-10 19:18:07 +01:00
Gabriel Caruso
35db1ccdd1
Fix variadic arginfos for Reflection functions
Fix arginfos of required arguments for some Reflection methods
2019-02-10 14:29:08 -02:00
Pedro Magalhães
6732028273 Implement the negative_array_index RFC 2019-02-08 16:08:32 +00:00
Levi Morrison
780bdcd80b Fix SplHeap::compare arginfo and tests 2019-02-08 10:14:38 +01:00
Peter Kokot
2b4495bf4d [ci skip] Move OPcache configure option changes 2019-02-08 00:31:25 +01:00
Nikita Popov
2f1f34952e Remove $errcontext argument to error handlers
I'm removing the argument entirely here, but we might want to change
this to passing null or and empty array instead, if the impact of
dropping it entirely turns out to be too large.

This was deprecated as part of https://wiki.php.net/rfc/deprecations_php_7_2
as a doc-only deprecation.
2019-02-05 14:12:10 +01:00
Côme Chilliet
f0ddc93f46 Removed ldap_sort and LDAP_DEPRECATED build flag
ldap_sort was deprecated in PHP7, it is now removed.
This allows removing the LDAP_DEPRECATED flag when building against
 openldap.
2019-02-04 13:10:05 +01:00
Côme Chilliet
d93ce17959 Mark ldap_control_paged_result and ldap_control_paged_result_response as deprecated
These functions have serious limitations and may confuse users.
Same operations can be done using the new ldap control system in search
 operations.
2019-02-04 12:20:51 +01:00
Nikita Popov
06ed6b8978 Make mb_ereg_replace() pattern argument a string 2019-02-01 15:19:46 +01:00
Nikita Popov
e366ceebad Deprecate mb_ereg_replace with non-string pattern
I'm counting this towards the non-string needle deprecation from
https://wiki.php.net/rfc/deprecations_php_7_3. I wasn't aware that
mb_ereg_replace() is also affected by this issue. It's even more
ridiculous than usual here, because the integer is interpreted as
an ASCII codepoint, even though these are supposed to be multibyte
functions :(
2019-02-01 15:02:31 +01:00
Nikita Popov
aad39879f2 Remove bareword fallback for constants
Access to undefined constants will now always result in an Error
exception being thrown.

This required quite a few test changes, because there were many
buggy tests that unintentionally used bareword fallback in combination
with error suppression.
2019-01-31 13:52:06 +01:00
Nikita Popov
340c6d3927 Revert "Don't silence fatal errors with @"
This reverts commit abd36289e2.

This wasn't ready for merging yet, there are still some test
failures.
2019-01-31 09:39:10 +01:00
Nikita Popov
abd36289e2
Don't silence fatal errors with @ 2019-01-31 07:11:05 +01:00
Nikita Popov
e18fde1a02 Remove -1 crop mode 2019-01-30 16:46:36 +01:00
Nikita Popov
f8038f827c Remove intl Normalizer::NONE 2019-01-30 16:35:32 +01:00
Nikita Popov
0dfd918ee7 Remove support for __autoload()
There are probably some improvements we can do to the SPL
implementation now that __autoload() is gone. In particular having
EG(autoload_func) as a property zend function, rather than a simple
callback probably doesn't make sense.
2019-01-30 14:00:16 +01:00
Nikita Popov
c88e2cce81 Removed read_exif_data() alias 2019-01-30 13:13:47 +01:00
Nikita Popov
5a2787a02d Require at least one arg for mktime/gmmktime 2019-01-30 13:13:47 +01:00
Nikita Popov
94ae35c9fb Remove ability to specify 'salt' in password_hash() 2019-01-30 13:13:47 +01:00
Nikita Popov
6c73b50cf6 Remove static calls to non-static methods 2019-01-30 09:19:02 +01:00
Nikita Popov
4eb5db2c68 Forbid unbinding $this from methods 2019-01-30 09:19:02 +01:00
Nikita Popov
23a5be3696 Remove ability to declare userland case-insensitive constants
This is part of https://wiki.php.net/rfc/case_insensitive_constant_deprecation.

This commit only removes the ability to declare such constants from
userland. Before the functionality can be removed entirely, it's
necessary to figure out the handling of true/false/null first.
2019-01-30 09:19:02 +01:00
Nikita Popov
52a9325328 Remove 'e' modifier for mb_ereg_replace()
This was deprecated in PHP 7.1 through
https://wiki.php.net/rfc/deprecate_mb_ereg_replace_eval_option.
2019-01-29 13:04:20 +01:00
Nikita Popov
682b54f687 Remove support for legacy constructors
This has been deprecated in PHP 7.0 by
https://wiki.php.net/rfc/remove_php4_constructors.
2019-01-29 13:04:20 +01:00
Nikita Popov
6b89dbcc5b Remove FILTER_FLAG_(SCHEME|HOST)_REQUIRED
Deprecated in PHP 7.3 as part of
https://wiki.php.net/rfc/deprecations_php_7_3.
2019-01-29 11:10:47 +01:00
Nikita Popov
d74d3922ce Remove (unset) cast
Deprecated in PHP 7.2 as part of
https://wiki.php.net/rfc/deprecations_php_7_2.
2019-01-29 11:10:47 +01:00
Nikita Popov
c97b9aa226 Always treat needles as strings
This is part of https://wiki.php.net/rfc/deprecations_php_7_3.
2019-01-29 11:10:47 +01:00
Nikita Popov
c7d7af8069 Remove fgetss and friends
These were deprecated in PHP 7.3 as part of
https://wiki.php.net/rfc/deprecations_php_7_3.
2019-01-29 09:43:00 +01:00
Nikita Popov
83bc092d40 Remove deprecated mbregex aliases
These have been deprecated in PHP 7.3 as part of
https://wiki.php.net/rfc/deprecations_php_7_3.
2019-01-29 09:43:00 +01:00
Nikita Popov
6db97f5e3e Remove each()
This has been deprecated in PHP 7.2 as part of
https://wiki.php.net/rfc/deprecations_php_7_2.
2019-01-29 09:42:59 +01:00
Nikita Popov
9bc2cacf7f Remove special treatment of strings in asserts
This was deprecated in PHP 7.2 as part of
https://wiki.php.net/rfc/deprecations_php_7_2.
2019-01-29 09:42:59 +01:00
Nikita Popov
97df99a6d7 Add UPGRADING entries for removed functionality 2019-01-28 16:05:02 +01:00
Christoph M. Becker
3d15a6f86b Remove deprecated INTL_IDNA_VARIANT_2003
Cf. <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003>
2019-01-28 15:18:01 +01:00
Christoph M. Becker
e973663882 Remove deprecated png2wbmp() and jpeg2wbmp()
Cf. <https://wiki.php.net/rfc/deprecate-png-jpeg-2wbmp>
2019-01-28 14:50:52 +01:00
Christoph M. Becker
dfa6c2046a Remove deprecated image2wbmp()
Cf. <https://wiki.php.net/rfc/image2wbmp>.
2019-01-28 14:29:06 +01:00
Nikita Popov
e118151139 Clear NEWS, UPGRADING and UPGRADING.INTERNALS 2019-01-28 11:17:30 +01:00
Andreas Treichel
b1e9c73b27 Allow strip_tags with an array of allowed tagnames 2019-01-24 15:56:32 +01:00
Nikita Popov
89a4c172e2 Remove the "o" serialization format
We never generate the "o" format during serialization, so let's not
keep this unnecessary attack surface around.
2019-01-22 18:09:49 +01:00
Nikita Popov
a50198d0fe Implement ??= operator
RFC: https://wiki.php.net/rfc/null_coalesce_equal_operator

$a ??= $b is $a ?? ($a = $b), with the difference that $a is only
evaluated once, to the degree that this is possible. In particular
in $a[foo()] ?? $b function foo() is only ever called once.
However, the variable access themselves will be reevaluated.
2019-01-22 11:12:04 +01:00
Christoph M. Becker
36c825575e [ci skip] Note preloading and ext/ffi in UPGRADING 2019-01-21 15:58:02 +01:00
Christoph M. Becker
570d4311b6 Use pkg-config to detect and configure for system libgd
Formerly, a single option `--with-gd` was sufficient to enable the
extension, and to determine whether to use the system or the bundled
libgd depending on whether a directory was passed.  Since pkg-config
determines the path automatically, we now offer `--enable-gd` (whether
the extension should be build) and `--with-external-gd` (whether to use
the system libgd).
2019-01-21 14:01:34 +01:00
Tyson Andre
58a2ced052 [ci skip] Fix typos in UPGRADING 2019-01-19 17:46:03 +01:00
Nikita Popov
48ca2c0833 Document pkg-config related changes
Creating a separate section in UPGRADING for this, as there are a
lot of these, and there's going to be more of them.
2019-01-15 10:15:05 +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
Sammy Kaye Powers
74c0e580ef Improve openssl_random_pseudo_bytes()
CSPRNG implementations should always fail closed. Now
openssl_random_pseudo_bytes() will fail closed by throwing an
`\Exception` in fail conditions.

RFC: https://wiki.php.net/rfc/improve-openssl-random-pseudo-bytes
2019-01-11 11:16:05 +01:00
Andreas Treichel
3c9af3095c Preserve aspect ratio for width or height 2019-01-05 13:39:49 +01:00
Nikita Popov
a9e6667817 Detect invalid uses of parent:: during compilation
We already detect the case where we're entirely outside a class --
now also check whether there actually is a parent.

This is a minor BC break, in that code that was never executed
might have previously contained an invalid parent:: reference without
generating an error.
2019-01-04 11:55:41 +01:00
Nikita Popov
f1c0e671e9 Add performance improvement section to UPGRADING
[ci skip]
2018-12-26 22:26:49 +01:00
Eli Schwartz
285a077c12 ext/gd: use --with instead of --enable
By convention it probably makes sense to stick with this even when
dropping the *-dir=DIR part.

See:
https://github.com/php/php-src/pull/3632#discussion_r229474568
https://autotools.io/autoconf/arguments.html
2018-12-26 13:37:39 +01:00
BohwaZ
82af24f2b2 Implement SQLite3Stmt::getSQL method, returning the original statement SQL, eventually expanded 2018-12-15 17:27:33 +01: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
Christoph M. Becker
8c781c1c20 Resolve imagecropauto() default $mode quirk
The `$mode` parameter of `imagecropauto()` defaults to `-1`.  However,
`-1` is changed to `GD_CROP_DEFAULT` right away, so basically the
default is `GD_CROP_DEFAULT`, which is rather confusing and
unnecessary.

Therefore, we change the default to `IMG_CROP_DEFAULT`, but still allow
an explicit `-1` to be passed for BC reasons, in which case we trigger
a deprecation notice, so we can rid the `-1` support eventually.
2018-12-12 17:25:37 +01:00
Christoph M. Becker
f0f4ab4b02 [ci skip] Fix names of the constants
`GD_CROP_DEFAULT` and `GD_CROP_SIDES` are names of libgd constants, and
as such they are not relevant for userland developers.  Therefore, we
replace them by the constant names of our wrapper, i.e.
`IMG_CROP_DEFAULT` and `IMG_CROP_SIDES`, respectively.
2018-12-01 23:54:17 +01:00
Christoph M. Becker
dcad13e8c9 Fix #73291: imagecropauto() $threshold differs from external libgd
Since upstream does not appear to move in any way[1], we sync our
behavior.  Even though the BC break is ugly (which is the reason we
target master only), having to deal with different algorithms is even
worse for portable userland code.

[1] <https://github.com/libgd/libgd/issues/334>
2018-12-01 18:49:30 +01:00
Christoph M. Becker
947ca9f43d Sync behavior of gdImageAutoCrop() with upstream
Since cropping support has been added to our bundled libgd,
`gdImageAutoCrop` differs from upstream in that `GD_CROP_DEFAULT` falls
back on `GD_CROP_SIDES` if there is no transparent color in the image.
While this difference seem to be a useful improvement in our bundled
libgd, upstream has not yet signaled that there willing to back-port
it[1], so we revert it to stay in sync with upstream.

We also remove the additional NULL bailout at the end of the function,
which doesn't appear to be relevant any longer since bug 77198 has been
fixed.

[1] <https://github.com/libgd/libgd/issues/298>
2018-12-01 15:34:10 +01:00
Christoph M. Becker
a757ebb5b5 Require SQLite ≥ 3.7.4 for ext/sqlite3
`SQLite3::readOnly()` uses `sqlite3_stmt_readonly()` which is only
available as of libsqlite 3.7.4.  For older SQLite3 versions we return
always `false`, which can be confusing.  Instead of sticking with this
behavior, or even undefining the method for old SQLite3 versions, we
lift the requirements to SQLite 3.7.4 (released on 2010-12-08),
according to a respective discussion[1].

Since pdo_sqlite doesn't use `sqlite3_stmt_readonly()`, we stick with
the minimum requirement of SQLite 3.5.0.

[1] <https://github.com/php/php-src/pull/3614>
2018-11-29 15:10:39 +01:00
Christoph M. Becker
035de21d77 Deny (un)serialization of SQLite3, SQLite3Stmt and SQLite3Result
Serializing `SQLite3`, `SQLite3Stmt` and `SQLite3Result` instances is
possible but pointless, since unserializing results in uninitialized
instances, which will bail out of any method call.  Therefore, we deny
serialization and unserialization in the first place.
2018-11-29 01:08:03 +01:00
Nikita Popov
28edeb2ba3 User serialize_deny for PDOStatement as well 2018-11-26 13:30:57 +01:00
Nikita Popov
6e4b202694 Switch PDO to use serialize_deny
And remove dummy __sleep/__wakeup. This switches the thrown
exception type from PDOException to Exception.
2018-11-26 13:28:14 +01:00
Nikita Popov
a624c2bd13 Use serialize_deny for CURLFile
Instead of a throwing __wakeup() method.
2018-11-26 13:20:51 +01:00
Nikita Popov
022eea8be1 Check for zero SplPriorityQueue extract flags earlier
Generate an exception during the SplPriorityQueue::setExtracFlags()
call instead of generating E_RECOVERABLE_FATAL all over the place
later.
2018-11-15 21:05:05 +01:00
Peter Kokot
35a9ec1b0d [ci skip] Update UPGRADING 2018-11-15 10:46:48 +01:00
Christoph M. Becker
86c6b3bdcd Support SQLite3 @name notation
Besides the common `:param` notation to designate named parameters in
prepared statements, SQLite3 also supports `@param` and `$param`.
While the latter is mostly to support the Tcl programming language, and
would be confusing for PHP's sqlite3 binding due to the similarity with
string interpolation, the former is common under .NET and raises no
such issue.  Therefore we add support for it.

This patch has been developed in cooperation with @BohwaZ.
2018-11-11 14:55:34 +01:00
Eli Schwartz
2d03197749 ext/gd: Use pkg-config to detect the availability of freetype2
The latest version of freetype2 does not install freetype-config by
default, but pkg-config support has been there for approximately 15
years. In order to reliably detect freetype2, pkg-config *must* be used.

See:
https://savannah.nongnu.org/bugs/?53093
https://bugs.php.net/bug.php?id=76324
2018-11-07 13:05:47 +01:00
Christoph M. Becker
0d6490598d Add TIDY_TAG_* constants supported by libtidy 5
Cf. <http://api.html-tidy.org/tidy/tidylib_api_5.0.0/tidyenum_8h.html#ae5b597c0999422ff383f08ab595ef5e8a16d20becf3c3cb022ddabccc83d8c314>.
2018-10-27 16:17:09 +02:00
Peter Kokot
37c329d715 Trim trailing whitespace in source code files 2018-10-13 14:17:28 +02:00
Christoph M. Becker
87392eff1a Require SQLite ≥ 3.5.0 for ext/sqlite3 and ext/pdo_sqlite
It is possible to pass flags when opening an SQLite database.  For
Sqlite < 3.5.0 these are ignored, since `sqlite3_open` doesn't support
flags.  Neither a warning or notice is raised in this case, nor is this
behavior documented in the PHP manual.  Instead of fixing it either
way, we lift the requirement to SQLite 3.5.0 (released on 2007-09-04)
instead of the former SQLite 3.3.9 (released on 2007-01-04).
2018-10-13 12:15:58 +02:00
Nikita Popov
0b6063f331 Restore array_key_exists() compatibility for ArrayObject
Doing this by special-casing array_key_exists() for ArrayObject.
2018-10-11 16:10:22 +02:00
Nikita Popov
5a679341b8 Add UPGRADING notes
[ci skip]
2018-10-10 12:00:57 +02:00
Christoph M. Becker
849a896a5e [ci skip] Update NEWS and UPGRADING wrt. unbundling libsqlite 2018-10-06 12:45:06 +02:00
Anatol Belski
969fdb717a Update UPGRADING [ci skip] 2018-10-03 19:11:31 +02:00
Kalle Sommer Nielsen
bf34442581 Implemented RFC "Always available hash extension" 2018-10-03 08:47:07 +02:00
Remi Collet
3d5fe90e7e NEWS and UPGRADING 2018-10-01 07:24:04 +02:00
Nikita Popov
fc18f44213 Deprecate unbinding of $this of non-static methods
Static calls to non-static methods have been fully deprecated in
PHP 7.0 as part of https://wiki.php.net/rfc/reclassify_e_strict.

A combination of ReflectionMethod::getClosure() ("fake closures")
and Closure::bindTo() etc can be used to achieve the same behavior.
This commit ensures that a deprecation notice will be thrown also
in this case.
2018-09-29 21:01:27 +02:00
Nikita Popov
96da1fe8a9 Fixed bug #76737
Explicitly prohibit serialization and unserialization of reflection
objects.
2018-09-29 14:47:57 +02:00
Nikita Popov
74235ca5f3 Bump minimum libxml version to 2.7.6
Released Oct 2009, part of RHEL 6.
2018-09-23 15:51:09 +02:00
Christoph M. Becker
7b9b398daa Update NEWS and UPGRADING wrt. PR 2760 2018-09-21 15:15:40 +02:00
Nikita Popov
1a55c3607d Drop --without-libzip option from Travis
We need to build against the system libzip now.

Also add an UPGRADING note.
2018-09-18 12:16:55 +02:00
Christoph M. Becker
6da3a1e3ce Revert "Implement #67331: Have parse_ini_file add empty entries"
This reverts commit 3f3e914df3.

The commit broke some tests on Windows, and generally needs more
though.
2018-09-15 17:08:58 +02:00
Christoph M. Becker
3f3e914df3 Implement #67331: Have parse_ini_file add empty entries
Some INI processors allow to specify empty values by just giving the
key without the equals sign, for instance MySQL and Python.  It appears
to be sensible to add this possibility to our INI parser, so that it
can be used for such INI files as well.  We choose NULL as the value of
empty values.

This syntactical enhancement is a (minor) BC break, though, as can be
seen by the necessary change to bug49692.ini.  The “comment” formerly
has been simply ignored, but now it would be parsed as key with an
empty value.

This PR is based on Adam's former patch.
2018-09-15 15:37:01 +02:00
Christoph M. Becker
01912f93c3 Change default of $variant param of idn_to_ascii() and idn_to_utf8()
According to the “Deprecate and remove INTL_IDNA_VARIANT_2003” RFC[1],
we change the default of the $variant parameter of `idn_to_ascii()` and
`idn_to_utf8()` from `INTL_IDNA_VARIANT_2003` to
`INTL_IDNA_VARIANT_UTS46`.

[1] <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003>
2018-09-15 14:41:30 +02:00
Christoph M. Becker
8a4c2f1621 Require ICU ≥ 50.1
Given that ICU is a set of lively developed libraries, that ICU 50.1
has been released on 2012-11-05, and PHP 7.4 is scheduled to be
released seven years after it, we consider it appropriate to ditch
these legacy versions.

Particularly, that would be a reasonable groundwork to implement part
two of the “Deprecate and remove INTL_IDNA_VARIANT_2003” RFC[1], namely
to default idn_to_ascii()'s and idn_to_utf8()'s $variant parameter to
INTL_IDNA_VARIANT_UTS46, which is not defined in ICU < 4.6.

See also the related discussion on internals@[2].

[1] <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003>
[2] <http://news.php.net/php.internals/101626>ff
2018-09-15 13:59:54 +02:00
Dmitry Stogov
0fbd2e6a16 Renumber ZEND_ACC_... flags 2018-09-11 17:21:17 +03: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
Christoph M. Becker
bf5cf79456 Fix UPGRADING 2018-07-31 13:31:28 +02:00
Christoph M. Becker
974abd8b43 Update UPGRADING wrt. samesite cookie RFC
Cf. <https://wiki.php.net/rfc/same-site-cookie>.
2018-07-31 12:48:33 +02:00
Jakub Zelenka
e5a9956336 Update NEWS and UPGRADING with info about syslog.filter 2018-07-22 16:36:36 +01:00
Nikita Popov
4a528d46f5 Add UPGRADING notes for deprecations 2018-07-21 22:48:42 +02:00
Trevor Rowbotham
fb0faf0208 [ci skip] Add new global MBString constants to UPGRADING
The constants are mentioned further up in the New Features section,
but weren't explicitly listed under the New Global Constants section.
2018-07-20 13:17:48 +02:00
Enno Woortmann
50516a6e1f Add implementation and tests for new methods - array_key_first(array $a) Returns the key of the first element or null - array_key_last(array $a) Returns the key of the last element or null 2018-07-17 11:31:00 +02:00
Christoph M. Becker
79a27ccf3f FILTER_FLAG_(SCHEME|HOST)_REQUIRED are now deprecated 2018-07-17 11:01:44 +02:00
Nikita Popov
3588d8af12 Deprecate case-insensitive constants
RFC: https://wiki.php.net/rfc/case_insensitive_constant_deprecation
2018-07-16 19:16:55 +02:00
Andrea Faulds
e4e9cd8355 Export stdClass objects using (object) cast (fixes #48016)
Before this change, var_export()'s output for stdClass objects calls
the non-existent stdClass::__set_state method, and is therefore useless.

This commit makes var_export() output an (object) cast from an array
instead, which when evaluated, will produce a stdClass object. Other
classes see unchanged output.
2018-07-12 13:22:26 +02:00
Kalle Sommer Nielsen
a8dce31957 Added the 'add_slashes' sanitization filter (FILTER_SANITIZE_ADD_SLASHES) as an alias to 'magic_quotes' (FILTER_SANITIZE_MAGIC_QUOTES) so we can move past our "magical" legacy. 2018-07-09 03:58:20 +02:00
Jakub Zelenka
2a78006adb Update NEWS and UPGRADING for fpm_get_status addition 2018-07-07 12:53:08 +01:00
seliver
95013042bf Fixed bug #76136 (stream_socket_get_name enclosed IPv6 in brackets)
The IPv6 IP of a socket is provided by inet_ntop() as a string, but
this function doesn't enclose the IP in brackets. This patch adds
them in the php_network_populate_name_from_sockaddr() function.
2018-07-07 11:47:50 +02:00
Nikita Popov
04e3523b7d Warn if continue is used on switch
Supersedes RFC https://wiki.php.net/rfc/continue_on_switch_deprecation
by generating a warning instead of deprecating and removing this
functionality.
2018-07-07 11:12:48 +02:00
Nikita Popov
41a6625c09 Add UPGRADING for mb_ereg changes
Also some minor code cleanup.
2018-07-07 11:06:29 +02:00
Remi Collet
587ab00698 NEW and UPGRADING 2018-07-05 06:34:08 +02:00
Dmitry Stogov
3a8f26060c Argument unpacking with Traversables and non-integer keys.
Changed error message, added UPGRADING note and test.
2018-07-04 22:34:36 +03:00
Rudi Theunissen
30156d588c Fixed bug #63217
Don't automatically convert literal string keys to integers on
array access, as we may be dealing with an ArrayAccess object,
rather than a plain array.
2018-07-02 16:41:59 +02:00
Jakub Zelenka
ce0721bee5 Update NEWS, UPGRADING and default php.ini files with syslog changes 2018-07-01 18:27:36 +01:00
Christoph M. Becker
3f241f3caa Update UPGRADING wrt. PCRE2
The upgrade to PCRE2 should mostly be transparent to existing code, but
apparently there are some minor differences, which warrant a note in
UPGRADING (and consequently, in the migration guide).
2018-06-27 15:19:41 +02:00
Nikita Popov
2543e61aed Fixed bug #76509
In PHP static properties are shared between inheriting classes,
unless they are explicitly overwritten. However, because this
functionality was implemented using reference, it was possible
to break the implementation by reassigning the static property
reference.

This is fixed by switching the implementation from using references
to using INDIRECTs, which cannot be affected by userland code.
2018-06-25 15:04:09 +02:00
Nikita Popov
490a49d0bb Use COPY_DEREF for DIM_IS and LIST_R as well
Also add an upgrading note for the behavior change, not that we
expect anyone to be affected...
2018-06-25 14:23:06 +02:00
Christoph M. Becker
d169d06d30 Remove useless PHPDBG_* constants
The sole purpose of `PHPDBG_FILE`, `PHPDBG_METHOD`, `PHPDBG_LINENO` and
`PHPDBG_FUNC` has been to be passed as first argument to `phpdbg_break`.
However, this functions is replaced as of PHP 5.6.3 by
`phpdbg_break_file`, `phpdbg_break_method` and 'phpdbg_break_func`,
respectively.  Therefore, we're finally removing the useless constants.
2018-06-25 11:42:54 +02:00
Charles R. Portwood II
55277a6684 RFC: Argon2 Password Hash Enhancements Implementation of Argon2id per RFC https://wiki.php.net/rfc/argon2_password_hash_enhancements
- m4 and Windows configure scripts now forces Argon2 reference library version >= 20161029
- Implementation tested against 20161029 and 20171227 for Argon2id support
- Updates Argon2 ext/standard/password/tests to run tests for both Argon2i and Argon2id
2018-06-21 13:26:57 +02:00
Gabriel Caruso
fc775f6915 Report unknown variables passed to compact() 2018-06-19 12:50:15 +02:00
Nikita Popov
d04917c7b3 Fixed bug #75218
I've introduced a new CompileError type, from which ParseError
inherits. These errors are not parse errors in the narrow sense
of the term, even though they happen to be generated during
parsing in our implementation. Additionally reusing the ParseError
class for this purpose would change existing error messages (if
the exception is not caught) from a "Fatal error:" to a "Parse
error:" prefix, and also the error kind from E_COMPILE_ERROR to
E_PARSE.
2018-06-16 12:41:03 +02:00
Victor Csiky
71c04324b7 Fixe bug #76386
..that is also a duplicate of #67122
2018-06-15 07:23:31 +02:00
Nikita Popov
f2be6e732a Update data tables for Unicode 11 2018-06-11 20:25:37 +02:00
Christoph M. Becker
3cbf594dfd Deprecate image2wbmp()
According to https://wiki.php.net/rfc/image2wbmp, we deprecate
`image2wbmp()`, rename the `$threshold` parameter to `$foreground`, and
remove superfluous code.
2018-06-10 00:33:42 +02:00
Anatol Belski
e147eb24b2 [ci skip] Add UPGRADING note 2018-06-02 20:58:39 +02:00
Nikita Popov
c70468b8d3 Add note about heredoc BC break 2018-05-28 22:14:04 +02:00
Nikita Popov
cc98b88087 UPGRADING tweaks
Fix a typo and clarify that Reflection changes only affect string
export. No API relevant return values are changed.

[ci skip]
2018-05-26 21:59:36 +02:00
Nikita Popov
95c9d9d2d7 Add some upgrading notes for mbstring 2018-05-25 12:09:51 +02:00
Anatol Belski
e788708e01 [ci skip] Add upgrading note 2018-05-17 13:18:43 +02:00
Jakub Zelenka
1f474272e5 Update NEWS and UPGRADING for openssl_pkey_derive 2018-05-09 19:56:34 +01:00
Thomas Punt
4887357269 Implement flexible heredoc/nowdoc syntax
RFC: https://wiki.php.net/rfc/flexible_heredoc_nowdoc_syntaxes

* The ending label no longer has to be followed by a semicolon or
  newline. Any non-label character is fine.
* The ending label may be indented. The indentation will be stripped
  from all lines in the heredoc/nowdoc string.

Lexing of heredoc strings performs a scan-ahead to determine the
indentation of the ending label, so that the correct amount of
indentation can be removed when calculting the semantic values for
use by the parser. This makes the implementation quite a bit more
complicated than we would like :/
2018-04-13 21:35:37 +02:00
Christoph M. Becker
c8c0bb11e7 [ci skip] Update UPGRADING
Cf. ce1d69a1f6 and
fef879a2d6, respectively.

Patch provided by Gabriel Caruso.
2018-04-12 19:00:22 +02:00
Anatol Belski
39301abbe1 Expose functionality for NFKC_Casefold normalization 2018-04-06 18:14:11 +02:00
Anatol Belski
36014ad23f Replace the deprecated API by the newer one available with ICU 56+ 2018-04-06 10:12:44 +02:00
Christoph M. Becker
a9ab5d473b [ci skip] Update UPGRADING
5c5bd30339 removed support for `--with-libmbfl`.
2018-04-04 14:11:37 +02:00
Tim Bazuin
033907b9a5 Add support for rl_completion_suppress_append and rl_completion_append_character
These options are only available with libreadline.
2018-03-25 18:21:35 +02:00
timurib
f7f48643e7 Remove redundant warning in array_push() and array_unshift()
Cf. https://github.com/php/php-src/pull/3011.
2018-03-25 17:49:04 +02:00
Christoph M. Becker
aed1e358dc Implement #51368: php_filter_float does not allow custom thousand separators
A set of hard-coded thousand separator characters (presently, `',.`) is
somewhat limited (users may prefer other separators, such as spaces or
underscores), as well as somewhat too liberal (arbitrary combinations
of different thousand separators are presently possible).  Therefore we
introduce a `thousand` option analogous to `decimal`, which allows to
define the desired thousand separators as non-empty string, defaulting
to `',.`.  While we easily could support empty strings here as well,
that would not make much sense, since this behavior can more easily be
accomplished by not setting the `FILTER_FLAG_ALLOW_THOUSAND` flag in
the first place.
2018-03-24 15:04:32 +01:00
Paul Crovella
aca0f7e24c [ci skip] Add normalizer_get_raw_decomposition to UPGRADING 2018-03-23 10:37:05 +01:00
Gabriel Caruso
d0ee2a8254 Add is_countable function
RFC: https://wiki.php.net/rfc/is-countable
2018-03-11 16:41:16 +01:00
Jonathan Torres
1cb3c15032
Fix typo in upgrade notes 2018-03-09 12:06:17 +01:00
Nikita Popov
47699a24e6 Bump libcurl requirement to 7.15.5
The existence of the following functions is now guaranteed:
 * curl_escape()
 * curl_unescape()
 * curl_multi_setopt()

libcurl 7.15.5 has been released 11.5 years ago and is available
even in RHEL 5.
2018-02-03 21:11:20 +01:00
Benjamin Morel
85021a3993 Add CURLOPT_REQUEST_TARGET constant 2018-02-03 20:43:18 +01:00
Anatol Belski
b2a1199d33 [ci skip] Fix typos 2018-01-12 19:12:54 +01:00
Anatol Belski
d857703bdb [ci skip] Update UPGRADING 2018-01-12 07:45:39 +01:00
Anatol Belski
45db77ed0d Revert "Add possibility to lower timer resolution"
This reverts commit c3717d9aec.

The final mitigation of the consequences with spectre should be
discussed more also with the regard to the happenings on the
developments. Right now a preliminary mitigation might be wrong or
suboptimal, thus reverting this.
2018-01-11 12:40:01 +01:00
Anatol Belski
c3717d9aec Add possibility to lower timer resolution
The recently discovered security flaw Spectre requires a high resolution
timer. To the today's knowledge, PHP can't be used to create an attack for
this flaw. Still some concerns were raised, that there might be impact in
shared hosting environments. This patch adds a possibility to reduce the
timer resolution by an ini setting, thus giving administrators full
control. Especially, as the flaw was also demonstrated by an abuse of
the JS engine in a browser, Firefox reduced several time sources to 20us.
Any programming language, that doesn't compile to JIT, won't be able to
produce an attack vector for Meltdown and Spectre, at least by todays
knowledge. There are also other factors that say that the security
concern on the hrtime feature is to the big part not justified, still we
aim JIT in the future. Thus, adding a possibility to control the timer
resolution is a good and small enough tradeoff for safety and future.
2018-01-10 18:45:15 +01:00
Anatol Belski
83497327e7 Implement high resolution monotonic timer function hrtime() 2018-01-07 16:03:52 +01:00
Xinchen Hui
ec69cb664f Added entry on UPGRADING 2018-01-04 13:50:34 +08:00
Nikita Popov
b2b2b437af Add _IS_NUMBER as cast_object() target type
convert_scalar_to_number() will now call cast_object() with an
_IS_NUMBER argument, in which case the cast handler should return
either an integer or floating point number, whichever is more
appropriate.

Previously convert_scalar_to_number() unconditionally converted
objects to integers instead.

Fixes bug #53033.
Fixes bug #54973.
Fixes bug #73108.
2017-12-26 12:39:06 +01:00
Nikita Popov
688b9136ab Fixed bug #54043 2017-12-23 13:35:08 +01:00
Nikita Popov
161fd75773 Bump libcurl requirement to 7.12.1
The existence of the following functions is now guaranteed:
 * curl_reset()
 * curl_strerror()
 * curl_multi_strerror()
 * curl_share_strerror()

libcurl 7.12.1 has been released more than 13 years ago and is
available even in RHEL 4.
2017-12-19 23:23:56 +01:00
Nikita Popov
e512305581 Remove opcache.inherited_hack
This ini directive has already been ignored since PHP 5.3.
2017-12-18 22:00:54 +01:00
Nikita Popov
43d9f5995d Fix duplicate NEWS entry
Also add an UPGRADING note while at it, as this is potentially
BC breaking.

[ci skip]
2017-12-16 17:41:24 +01:00
Nikita Popov
fc80114a48 Add gmp_kronecker()
Exposes the mpz_kronecker(), mpz_si_kronecker() and
mpz_kronecher_si() for computing the Kronecker symbol.
2017-12-11 19:25:54 +01:00
Nikita Popov
10a336d3d0 Add gmp_perfect_power()
Exposes the mpz_perfect_power_p() function.

We already had the more specific gmp_perfect_square() function.
2017-12-11 19:25:54 +01:00
Nikita Popov
a1d36a1157 Add gmp_lcm()
Exposes mpz_lcm() and mpz_lcm_ui() for calculating the least
common multiple.

We already expose the somewhat complementary gmp_gcd() function.
2017-12-11 19:25:54 +01:00
Nikita Popov
7fea79675c Add gmp_binomial()
Adds PHP bindings for mpz_bin_ui and mpz_bin_uiui, for calculating
binomial coefficients.
2017-12-11 19:25:54 +01:00
David Walker
6d4de4cf05 Implement list() reference assignments
Support list() reference assignments of the form:

    list(&$a, list(&$b, $c)) = $d;

RFC: https://wiki.php.net/rfc/list_reference_assignment
2017-12-09 13:39:52 +01:00
Nikita Popov
9cdd547eca Fixed bug #74372 2017-12-06 23:36:09 +01:00
Joe Watkins
18c833504f
Merge branch 'PHP-7.2'
* PHP-7.2:
  Mention spl_object_id in UPGRADING notes
2017-11-06 07:20:14 +00:00
Tyson Andre
88e94a0bd1
Mention spl_object_id in UPGRADING notes
This was implemented in PR #2611
2017-11-06 07:18:39 +00:00
Anatol Belski
b66eeb3652 Note to UPGRADING about Spoofchecker::setRestrictionLevel() 2017-11-02 13:34:58 +01:00
Andrea Faulds
e823770515 Merge JSON_THROW_ON_ERROR 2017-10-22 19:41:23 +01:00
Dmitry Stogov
cb9d81ef4f Refactored recursion pretection 2017-10-06 01:34:50 +03:00
Christoph M. Becker
b0d6d27349 [ci skip] hash_hmac_algos() is new in PHP 7.2.0 2017-09-27 17:18:10 +02:00
Jannes Jeising
c7a0177491 [ci skip] Fix more typos in UPGRADING 2017-09-20 15:50:06 -04:00
Christoph M. Becker
97bfc28341 [ci skip] Update UPGRADING wrt. PR 2742 2017-09-18 15:57:51 +02:00
Christoph M. Becker
9848e417c3 Merge branch 'PHP-7.2'
* PHP-7.2:
  [ci skip] Fix typos in UPGRADING
2017-09-14 00:36:43 +02:00
Christoph M. Becker
b5052f0110 [ci skip] Fix typos in UPGRADING 2017-09-14 00:34:26 +02:00
Christoph M. Becker
18adc6f0fc Merge branch 'pull-request/2745'
* pull-request/2745:
  Fixed bug #75169 (BCMath errors/warnings bypass error handling)
2017-09-13 16:21:30 +02:00
Christoph M. Becker
1738fa3ec1 Merge branch 'pull-request/2739'
* pull-request/2739:
  Fix proto and indentation
  Fix arginfo
  Return old scale value from bcscale()
2017-09-13 16:04:54 +02:00
Christoph M. Becker
d95221ec4b [ci-skip] Add missing UPGRADING entry for commit 0d0f7cd
There is a respective entry in NEWS, but that would likely be missed by
the doc team.
2017-09-11 18:37:51 +02:00
Nikita Popov
fd07302024 Fixed bug #75170
This change may result in different mt_rand/rand sequences being
generated on 64-bit systems for a specific seed.

See also https://externals.io/message/100229.
2017-09-07 20:04:38 +02:00
Remi Collet
040a3230b2 UPGRADING 2017-09-07 14:28:05 +02:00
Remi Collet
7378967206 UPGRADING 2017-09-05 08:20:04 +02:00
Kalle Sommer Nielsen
d3bc8beb4f Removed support for BeOS, development for BeOS was supported 17 years ago.
This patch however does not drop support for the BeOS compatible variant, Haiku, see Github PR #2697 which is currently a WiP

I intentionally left out some fragments for BeOS in the build system for that seems to be bundles
2017-08-29 22:03:56 +02:00
Michael Moravec
d9d13aba58 Added method DateTime::createFromImmutable() 2017-08-25 22:20:43 +02:00
Kalle Sommer Nielsen
1d9b46f362 Implemented FR #74781 (Add the latest PG_DIAG_* const) 2017-08-17 21:04:41 +02:00
Christoph M. Becker
9221bd7f32 Merge branch 'pull-request/2670'
* pull-request/2670:
  Change getimagesize() and friends to report image/bmp
2017-08-13 21:22:57 +02:00
Nikita Popov
b202587e09 Note deprecation of $errcontext 2017-08-12 20:34:44 +02:00
Andreas Treichel
29e4d4eee6 Add ftp_append to create a new file or append data to an existing file (RFC959) 2017-08-02 20:52:28 +02:00
Kalle Sommer Nielsen
398be731e6 Removed support for ODBCRouter 2017-07-28 10:31:48 +02:00
Andreas Treichel
00cd671233
Make transfer mode optional, set default to binary 2017-07-25 09:09:12 +01:00
jrfnl
f901e7e3c5 Fix typo in PHP 7.2 changelog 2017-07-24 16:57:07 -04:00
Issei.M
f1d7857969
Fix typo in UPGRADING for 7.2 2017-07-24 10:44:19 +01:00
Kalle Sommer Nielsen
f35f45906e Redesigned ext_skel to be written entirely in PHP with no dependencies, this means it will now run on Windows without Cygwin and other nonsense.
It no longer includes a way to generate XML documentation (the PHP documentation utilities already got tools for that in svn under phpdoc/doc-base) and it no longer support function stubs.

$ php ext_skel.php --help
php ext_skel.php --ext=<name> [--experimental] [--author=<name>]
                 [--dir=<path>] [--std] [--onlyunix]
                 [--onlywindows] [--help]

  --ext=<name>          The name of the extension defined as <name>
  --experimental        Passed if this extension is experimental, this creates
                        the EXPERIMENTAL file in the root of the extension
  --author=<name>       Your name, this is used if --header is passed and
                        for the CREDITS file
  --dir=<path>          Path to the directory for where extension should be
                        created. Defaults to the directory of where this script
                        lives
  --std                 If passed, the standard header and vim rules footer used

                        in extensions that is included in the core, will be used

  --onlyunix            Only generate configure scripts for Unix
  --onlywindows         Only generate configure scripts for Windows
  --help                This help

Example usage:
$ php ext_skel.php --ext test --std --experimental
$ php ext_skel.php --ext kalle --author "Kalle Sommer Nielsen"
$ php ext_skel.php --ext phpfi --dir "/home/kalle/dev/" --onlyunix
2017-07-23 10:36:35 +02:00