Commit Graph

876 Commits

Author SHA1 Message Date
Nikita Popov
267a7b052c Fix new simplexml test
This interacted unfortunately with the addition of the %0 placeholder
in 8.1. Use %r to escape it.
2021-11-15 09:26:25 +01:00
Stanislav Malyshev
9de4eb9e37
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #79971: special character is breaking the path in xml function
2021-11-14 23:29:59 -08:00
Stanislav Malyshev
9d74c5b40b
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #79971: special character is breaking the path in xml function
2021-11-14 23:29:37 -08:00
Stanislav Malyshev
0ef1dfc9f6
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #79971: special character is breaking the path in xml function
2021-11-14 23:29:27 -08:00
Stanislav Malyshev
ca87d46a3e
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79971: special character is breaking the path in xml function
2021-11-14 23:28:13 -08:00
Christoph M. Becker
f15f8fc573
Fix #79971: special character is breaking the path in xml function
The libxml based XML functions accepting a filename actually accept
URIs with possibly percent-encoded characters.  Percent-encoded NUL
bytes lead to truncation, like non-encoded NUL bytes would.  We catch
those, and let the functions fail with a respective warning.
2021-11-14 23:24:33 -08:00
Kamil Tekiela
c3dda473cc
Fix 'can not' in test data and in code comments 2021-10-05 09:51:58 +01:00
Remi Collet
1aaec4df67
SKIPIF to EXTENSIONS 2021-08-03 12:16:13 +02:00
Remi Collet
649af56ad6
Merge branch 'PHP-8.0'
* PHP-8.0:
  typo
2021-08-03 12:10:30 +02:00
Remi Collet
940c35366d
typo 2021-08-03 12:10:20 +02:00
Remi Collet
a48bf8a0b9
Merge branch 'PHP-8.0'
* PHP-8.0:
  NEWS
  Fix bug #81325  Segfault in zif_simplexml_import_dom
2021-08-03 12:08:03 +02:00
Remi Collet
112527d677
Fix bug #81325 Segfault in zif_simplexml_import_dom 2021-08-03 12:06:36 +02:00
Nikita Popov
6d505d4445 Add RETURN/RETVAL_COPY_DEREF() macros
These were missing from the set...

I think quite a few of these usages don't actually need the DEREF,
but I've just kept things as is for now.
2021-07-22 09:44:19 +02:00
Máté Kocsis
2378f35787
Use single line phpdoc in stubs where possible 2021-07-20 13:16:56 +02:00
Joe Watkins
570d9b63e9
Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
Nikita Popov
cde735e630 Remove SimpleXMLElement dtor_obj handler
I don't see any reason why this cleanup needs to happen inside
dtor_obj.

If there is a reason, it's lacking in test coverage...
2021-06-09 11:46:28 +02:00
Máté Kocsis
37a3c9bc8d
Declare tentative return types for ext/simplexml
Closes GH-7003
2021-05-26 11:23:38 +02:00
Christoph M. Becker
d61d21ad57
Merge branch 'PHP-8.0'
* PHP-8.0:
  SimpleXMLElement::addAttribute() is a void function
2021-05-22 22:31:51 +02:00
Christoph M. Becker
24d9527c75
SimpleXMLElement::addAttribute() is a void function
Closes GH-7033.
2021-05-22 22:28:34 +02:00
Máté Kocsis
8f411006a3
Merge branch 'PHP-8.0'
* Fix some nullable return types in ext/simplexml
2021-05-18 14:44:53 +02:00
Máté Kocsis
eedc988a4e
Fix some nullable return types in ext/simplexml
Closes GH-7004
2021-05-18 14:43:36 +02:00
Nikita Popov
10a5e506ed Drop SXE_METHOD() macro
Don't break my grep.
2021-05-18 11:45:15 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Stanislav Malyshev
476888d99b
Merge branch 'PHP-8.0'
* PHP-8.0:
  Revert "Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement"
2021-04-26 21:03:23 -07:00
Stanislav Malyshev
eed03fce59
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Revert "Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement"
2021-04-26 21:02:09 -07:00
Stanislav Malyshev
2b3346208a
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Revert "Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement"
2021-04-26 21:02:03 -07:00
Stanislav Malyshev
1b88c85cd8
Revert "Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement"
Sorry, this solution seems to have BC breaks, will need to look
for better one.

This reverts commit 9f7e8b777c.
2021-04-26 21:01:25 -07:00
Stanislav Malyshev
833fac34d0
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement
2021-04-26 20:51:46 -07:00
Stanislav Malyshev
6de2d54425
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement
2021-04-26 20:50:29 -07:00
Stanislav Malyshev
76637017ac
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement
2021-04-26 20:50:15 -07:00
Christoph M. Becker
9f7e8b777c
Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement
We ignore `XML_ENTITY_DECL` nodes when getting the hash of the
properties of a `SimpleXMLElement`.
2021-04-26 20:43:45 -07:00
Máté Kocsis
0cd06d1d19
Merge branch 'PHP-8.0'
* Fix arginfo/ZPP mismatch for simplexml_import_dom
2021-04-26 11:12:12 +02:00
Máté Kocsis
cb84e5c332
Fix arginfo/ZPP mismatch for simplexml_import_dom
Closes GH-6905
2021-04-26 11:09:30 +02:00
Max Semenik
7f2f0c007c Migrate skip checks to --EXTENSIONS--, p4
For rationale, see #6787

Extensions migrated in part 4:
* simplexml
* skeleton
* soap
* spl
* sqlite3
* sysvmsg
* sysvsem
* tidy - also removed a check for an ancient dependency version
2021-04-08 10:36:44 +02:00
George Peter Banyard
5caaf40b43
Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
Máté Kocsis
bf0f6aaf18
Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
Máté Kocsis
99b08ac281
Implicitly enable function entry generation when class entry generation is enabled
Closes GH-6675
2021-02-09 13:37:24 +01:00
Máté Kocsis
1954e59758
Add support for generating class entries from stubs
Closes GH-6289

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-01-26 11:50:36 +01:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Nikita Popov
c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00
Máté Kocsis
36fd95b524
Generate arginfos 2020-09-16 21:28:27 +02:00
Máté Kocsis
de912821e0
Display string default values in stubs more uniformly
Settling on using quoted string
2020-09-16 21:27:01 +02:00
Máté Kocsis
628db3f3b5
Fix UNKNOWN default values in various extensions
Closes GH-6075
2020-09-07 19:02:02 +02:00
Máté Kocsis
6c8fb123d2
Promote warnings to exceptions in ext/simplexml
Closes GH-6011

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-08-25 15:15:58 +02:00
Nikita Popov
f4e9d0e325 Don't return temporary from SXE write_property handler
Return the original value. If we don't return the original value,
we need to own the zval, which we don't.

For clarity also switch things to work on a zend_string* value
instead of a zval*.
2020-08-25 11:28:44 +02:00
Nikita Popov
afde6dcf5f Simplify change_node_zval implementation
At this point, the value has already been converted into a string.
2020-08-25 11:01:48 +02:00
Nikita Popov
8f61854108 Add a missing null check in simplexml 2020-08-13 16:46:08 +02:00
Nikita Popov
fc7bab3aee Throw on uninitialized SimpleXMLElement
Elevate this warning into an Error, as usual. Add a few checks
in places that were missing them.
2020-08-13 16:13:02 +02:00
Máté Kocsis
7aacc705d0
Add many missing closing PHP tags to tests
Closes GH-5958
2020-08-09 22:03:36 +02:00
Benjamin Eberlei
eaeceb3293 Consolidate Parameter Names For ext/simplexml
Co-authored-by: Thomas Weinert <thomas@weinert.info>
2020-07-27 21:42:33 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
Nikita Popov
312201dce4 Add get_gc handle for object iterators
Optional handler with the same semantics as the object handler.
2020-07-01 15:17:22 +02:00
Nikita Popov
4730b06f1d Make SimpleXMLElement a RecursiveIterator
Context: https://externals.io/message/108789

This essentially moves the functionality of SimpleXMLIterator into
SimpleXMLElement, and makes SimpleXMLIterator a no-op extension.

Ideally SimpleXMLElement would be an IteratorAggregate, whose
getIterator() method returns SimpleXMLIterator. However, because
SimpleXMLIterator extends SimpleXMLElement (and code depends on
this in non-trivial ways), this is not possible.

The only way to not keep SimpleXMLElement as a magic Traversable
(that implements neither Iterator nor IteratorAggregate) is to
move the SimpleXMLIterator functionality into it.

Closes GH-5234.
2020-06-24 15:09:21 +02:00
Nikita Popov
c9b9f525a9 Include stub hash in generated arginfo files
The hash is used to check whether the arginfo file needs to be
regenerated. PHP-Parser will only be downloaded if this is actually
necessary.

This ensures that release artifacts will never try to regenerate
stubs and thus fetch PHP-Parser, as long as you do not modify any
files.

Closes GH-5739.
2020-06-24 09:55:19 +02:00
Christoph M. Becker
3a0bdb720a Fix #63575: Root elements are not properly cloned
Cloning of root elements has to preserve that property, so they require
some special treatment.
2020-06-17 16:48:50 +02:00
Nikita Popov
15846ff115 Add ZVAL_OBJ_COPY macro
For the common ZVAL_OBJ + GC_ADDREF pattern.
This mirrors the existing ZVAL_STR_COPY API.
2020-06-17 16:36:56 +02:00
twosee
1b85e749c7 Fix warning of strict-prototypes
Closes GH-5673.
2020-06-07 10:36:50 +02:00
Tyson Andre
32a1ebbd43 Clean up calls to extension_loaded('json') in tests
These are no longer needed after https://wiki.php.net/rfc/always_enable_json

Closes GH-5637
2020-05-28 15:07:47 -04:00
George Peter Banyard
f0794c7719 Fix [-Wundef] warning in SimpleXML extension 2020-05-20 16:29:52 +02:00
Christoph M. Becker
1d20443679 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79528: Different object of the same xml between 7.4.5 and 7.4.4
2020-05-01 12:42:09 +02:00
Christoph M. Becker
9b9252c667 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79528: Different object of the same xml between 7.4.5 and 7.4.4
2020-05-01 12:40:37 +02:00
Christoph M. Becker
54148fd686 Fix #79528: Different object of the same xml between 7.4.5 and 7.4.4
Revert "Fix #61597: SXE properties may lack attributes and content"

This reverts commit 7c081db885.
2020-05-01 12:37:39 +02:00
Máté Kocsis
4815be44db
Generate function entries from stubs
Converts ext/pcntl, ext/simplexml, ext/snmp, ext/soap, ext/sqlite3.
Closes GH-5421
2020-04-20 10:38:41 +02:00
Máté Kocsis
e088836bbc
Fix nullable types in PHPDoc 2020-04-12 00:25:33 +02:00
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
Máté Kocsis
36935e42ea
Improve undefined variable error messages
Closes GH-5312
2020-03-31 13:02:32 +02:00
Nikita Popov
6bf483a94a Clarify SimpleXML comparison logic 2020-03-31 12:48:57 +02:00
Nikita Popov
fb5bfcb75b Add a ZEND_UNCOMPARABLE value
To explicitly indicate that objects are uncomparable. For now
this has no functional difference from the usual 1 return value,
but makes intent clearer.
2020-03-31 12:36:48 +02:00
Máté Kocsis
01b266aac4
Improve error messages of various extensions
Closes GH-5278
2020-03-23 18:59:04 +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
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
208e348982 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #61597: SXE properties may lack attributes and content
2020-03-12 10:57:14 +01:00
Christoph M. Becker
2b56735ea0 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #61597: SXE properties may lack attributes and content
2020-03-12 10:56:13 +01:00
Christoph M. Becker
7c081db885 Fix #61597: SXE properties may lack attributes and content
We must not treat a node as string if it has attributes, unless it is
an entity declaration which is always treated as string by simplexml.
2020-03-12 10:52:28 +01:00
Máté Kocsis
f44dd16b7a
Improve error message of foreach
Closes GH-5240
2020-03-09 11:29:40 +01:00
Nicolas Grekas
9e775db025 Define Stringable with __toString():string method 2020-03-02 15:25:32 +01:00
Máté Kocsis
4f89211810
Remove the deprecated reflection export methods
Closes GH-5188
2020-02-19 13:19:37 +01:00
Máté Kocsis
ac0853eb26
Make type error messages more consistent
Closes GH-5092
2020-02-17 14:22:17 +01:00
Nikita Popov
f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Máté Kocsis
8b36be268d
Fix indentation and whitespaces in tests
In preparation for GH-5074
2020-01-31 17:47:14 +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
345703724c
Use RETURN_THROWS() during ZPP in most of the extensions
Except for some bigger ones: reflection, sodium, spl
2019-12-31 11:46:11 +01:00
Christoph M. Becker
dabc28d182 Fix #78880: Spelling error report
We fix the most often occuring typos according to a recent codespell
report[1] in tests, code comments and documentation.

[1] <https://fossies.org/linux/test/php-src-master-f8f48ce.191129.tar.gz/codespell.html>.
2019-12-21 11:58:00 +01:00
Máté Kocsis
c58b12334d Add union return types with one class 2019-11-18 12:44:38 +01:00
Fabien Villepinte
a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00
Christoph M. Becker
4008704f62 zend_parse_parameters_throw() is obsolete
Since `zend_parse_parameters()` throws now, there is no reason to
explicitly call `zend_parse_parameters_throw()` anymore, and since both
have actually the same implementation, we redefine the latter as macro.
2019-11-01 16:47:15 +01:00
Dmitry Stogov
b02b81299c Comparison cleanup:
- introduce zend_compare() that returns -1,0,1 dirctly (without intermediate zval)
- remove compare_objects() object handler, and keep only compare() handler
2019-10-07 17:57:49 +03: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
Joe Watkins
32b87f855e
Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed #75245 Don't set content of elements with only whitespaces
2019-10-02 08:17:45 +02:00
Erik Lundin
6462c19689
Fixed #75245 Don't set content of elements with only whitespaces 2019-10-02 08:17:04 +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
Christoph M. Becker
de6b76805d Just return on throwing ZPP 2019-09-25 10:40:45 +02:00
Christoph M. Becker
2540c44dbe Add missing zend_parse_parameters_none() 2019-09-25 10:40:45 +02:00
Stephen Reay
b0d80e16e3 Add SimpleXML arginfo stubs 2019-09-25 10:34:21 +02:00
Nikita Popov
743d27631f Normalize SimpleXML::asXML() argument handling
Remove odd manual checks in favor of a standard zpp call.
2019-08-15 11:18:56 +02:00
Nikita Popov
3121b7174f Deprecate Reflection export() methods
And remove the Reflector::export() interface method.
2019-07-22 11:39:52 +02:00
Nikita Popov
bbd12b3d30 Merge branch 'PHP-7.4' 2019-07-10 11:11:30 +02:00
Nikita Popov
a207b3574b Fix iteration limits in SXE test
Test doesn't look like it's specifically testing out of bounds
access, just two different iteration patterns, so make sure the
limits are correct.
2019-07-10 11:09:47 +02:00
twosee
63171d88f2 Add do...while(0) for RETURN_* and ZVAL_* APIs
Closes GH-4255.
2019-06-12 16:17:16 +02:00
Dmitry Stogov
e029cc4dd4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Cheaper checks for exceptions thrown from __toString()
2019-06-06 02:23:17 +03:00
Dmitry Stogov
457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03: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
Christoph M. Becker
c89b788a8a Merge branch 'PHP-7.4'
* PHP-7.4:
  SimpleXMLElement and ResourceBundle implement Countable
2019-05-31 19:01:41 +02:00
Thomas Gerbet
bfc10978ef SimpleXMLElement and ResourceBundle implement Countable
Both classes already have a count() method and are considered
countable by \is_countable().
2019-05-31 18:59:19 +02:00
Nikita Popov
45a0656e95 Remove get() object handler
Now that set() is gone, there is little point in keeping get(), as
it is essentially just a different way of writing cast_object()
now.

Closes GH-4202.
2019-05-29 17:15:19 +02:00
Dmitry Stogov
b2cdde0826 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros
2019-05-28 20:19:15 +03:00
Dmitry Stogov
83804519df Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros 2019-05-28 20:10:02 +03:00
Nikita Popov
20e983d9ce Merge branch 'PHP-7.4' 2019-05-14 14:59:36 +02:00
Nikita Popov
3f19f5112a Add RETURN_EMPTY_ARRAY() / RETVAL_EMPTY_ARRAY()
The usual wrappers around ZVAL_EMPTY_ARRAY()...
2019-05-14 14:59:10 +02:00
Peter Kokot
64923adccf Merge branch 'PHP-7.4'
* PHP-7.4:
  Convert CRLF to LF
2019-05-13 03:54:10 +02:00
Peter Kokot
addf2ad5fd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Convert CRLF to LF
2019-05-13 03:53:49 +02:00
Peter Kokot
43e6fd1e2b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Convert CRLF to LF
2019-05-13 03:53:31 +02:00
Peter Kokot
f95b27c6f6 Convert CRLF to LF
These files are tracked with CRLF line endings in Git and can be
converted to LF. Neither are parts of tests or code itself.
2019-05-13 03:51:00 +02:00
Peter Kokot
2cf90bb2f0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Normalize comments in *nix build system m4 files
2019-05-12 18:51:50 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Nikita Popov
d9ec9a919c Merge branch 'PHP-7.4' 2019-04-18 13:08:27 +02:00
Hugh McMaster
9f0c9b7ad6 Rename --enable-libxml to --with-libxml to meet naming guidelines 2019-04-18 13:08:02 +02:00
Hugh McMaster
cc930cdd75 Use PKG_CHECK_MODULES to detect libxml2 2019-04-18 13:04:54 +02:00
Hugh McMaster
29d1b7fd52 Remove support for --with-libxml-dir 2019-04-18 13:04:54 +02:00
Nikita Popov
dc42e403a2 Merge branch 'PHP-7.4' 2019-04-15 11:42:55 +02:00
Nikita Popov
7f6c22cb3d Fix last maybe uninit warnings on 7.4
Most of these only occur under GCC 5. Not fond of all the workarounds
(especially the PDO one), but it gets us a clean build...
2019-04-15 11:35:13 +02:00
Peter Kokot
61d9e53ed9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove extension readmes
2019-03-19 20:26:07 +01:00
Peter Kokot
38b22448f8 Remove extension readmes
This patch removes several extension readmes in favor of the PHP manual
and where possible.
2019-03-19 20:25:32 +01:00
Peter Kokot
6426420f61 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace dirname(__FILE__) by __DIR__ in tests
2019-03-15 23:36:47 +01:00
Fabien Villepinte
26dfce7f36 Replace dirname(__FILE__) by __DIR__ in tests 2019-03-15 22:55:30 +01:00
Dmitry Stogov
c56bd7e220 Merge branch 'PHP-7.4'
* PHP-7.4:
  Cleanup unused module globals
2019-03-12 13:44:25 +03:00
Dmitry Stogov
5aa1176238 Cleanup unused module globals 2019-03-12 13:44:05 +03:00
Nikita Popov
852485d8ec Adjust tests for zpp TypeError change 2019-03-11 11:32:20 +01:00
Peter Kokot
d0fd9fe977 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add AS_HELP_STRING to *nix build configure options
2019-03-07 20:38:04 +01:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00
Nikita Popov
f15d89a5e4 Merge branch 'PHP-7.4' 2019-02-14 13:00:11 +01:00
Nikita Popov
29d87caebf Fix typo in XML test
Uncovered by the change in e63febb1c7.
2019-02-14 12:59:08 +01:00
Nikita Popov
924142fef0 Merge branch 'PHP-7.4' 2019-02-14 12:51:39 +01:00
David Walker
e63febb1c7 Fixed bug #75921
Ensure that the "creating default object from empty value" warning is
always thrown. Previously some cases were missing the warning, in
particular those going through FETCH_OBJ_W rather than a dedicated
opcode (like ASSIGN_OBJ).

One slightly unfortunate side-effect of this change is that something
like $a->b->c = 'd' will now generate two warnings rather than one
when $a is null (one for property b, one for property c).
2019-02-14 12:50:25 +01:00
Dmitry Stogov
91ef4124e5 Refactor zend_object_handlers API to pass zend_object* and zend_string* insted of zval(s). 2019-02-04 13:20:25 +03: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
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
0f7f1498be Use ZEND_THIS macro to hide implementation details in extensions code. 2018-11-15 19:54:19 +03:00
Dmitry Stogov
c6ad0b92b7 Replace getThis() by EX(This), when additional check is not necessary. 2018-11-14 02:44:25 +03:00
Peter Kokot
d679f02295 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:33:09 +02:00
Peter Kokot
b746e69887 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:32:30 +02:00
Peter Kokot
f1d7e3ca0b Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:31:31 +02:00
Peter Kokot
d7a3edd45d Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +02:00
Peter Kokot
782352c54a Trim trailing whitespace in *.phpt 2018-10-14 19:45:12 +02:00
Peter Kokot
17ccbeec32 Trim trailing whitespace in *.phpt 2018-10-14 19:44:14 +02:00
Gabriel Caruso
9c144e0d82
Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
Peter Kokot
1ad08256f3 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:56:38 +02:00