summaryrefslogtreecommitdiff
path: root/tests/classes
Commit message (Collapse)AuthorAgeFilesLines
* Return error_zval form get_property_ptr_ptr on exceptionNikita Popov2019-10-101-5/+1
| | | | | | | | | | | | | This goes in the reverse direction of 4463acb9513dfb62206760c49b3da1fe4d92f40a. After looking around a bit, it seems that we already check for Z_ISERROR_P() on the get_property_ptr_ptr return value in other places. So do this in zend_fetch_property_address() as well, and also make sure that EG(error_zval) is indeed returned on exception in get_property_ptr_ptr. In particular, this fixes the duplicate exceptions that we used to get because first get_property_ptr_ptr threw one and then read_property throws the same exception again.
* Explicitly check for exceptions in by-ref obj prop assignNikita Popov2019-10-101-5/+8
| | | | | | | | Relying on setting ERROR if an exception happened during the property address fetch is both a bit fragile and may pessimize other codepaths that will check for exceptions in the VM. Adding an extra exception check instead, which should also allow us to drop the use of ERROR in this area in master.
* Allow throwing exception while loading parent classNikita Popov2019-09-123-3/+15
| | | | | | | | | | | | | | This is a fix for symfony/symfony#32995. The behavior is: * Throwing exception when loading parent/interface is allowed (and we will also throw one if the class is simply not found). * If this happens, the bucket key for the class is reset, so it's possibly to try registering the same class again. * However, if the class has already been used due to a variance obligation, the exception is upgraded to a fatal error, as we cannot safely unregister the class stub anymore.
* Register class before fetching parentNikita Popov2019-06-112-11/+2
| | | | | We want the class declaration to be available while compiling the parent class.
* Allow exceptions in __toString()Nikita Popov2019-06-053-28/+46
| | | | | | | | | | 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.
* Fix lineno for more inheritance errorsNikita Popov2019-03-2712-12/+12
| | | | And also include explicit linenos in tests.
* Replace dirname(__FILE__) by __DIR__ in testsFabien Villepinte2019-03-156-6/+6
|
* Use EXPECT when possibleGabriel Caruso2019-03-111-1/+1
| | | | EXPECTF logic in run-tests.php is considerable, so let's avoid it.
* Implement fine-grained conflict handlingNikita Popov2019-02-201-0/+0
| | | | | | Tests can specify conflict keys, either in --CONFLICTS-- or a per-directory CONFLICTS file. Non-conflicting tests may be run in parallel.
* run-tests.php: experimental parallel testing supportAndrea Faulds2019-02-181-0/+0
|
* Fix testNikita Popov2019-02-121-1/+1
| | | | Missing this change in 93641539429c41a8997016ee4a4502882b0a722e.
* Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-02-123-10/+14
|\
| * Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-02-123-10/+14
| |\
| | * Fixed bug #75546DanielCiochiu2019-02-123-10/+14
| | | | | | | | | | | | | | | By respecting the SILENT flag when checking the visibility of a class constant.
| | * Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-1565-79/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Trim trailing whitespace in *.phptPeter Kokot2018-10-14132-323/+323
| | |
| | * Trim trailing whitespace in source code filesPeter Kokot2018-10-132-2/+2
| | |
| | * Req #74963 (Improved error message on fetching property of non-object)Xinchen Hui2017-07-311-9/+9
| | |
| * | Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-1565-79/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Trim trailing whitespace in *.phptPeter Kokot2018-10-14131-319/+319
| | |
* | | Implement typed propertiesNikita Popov2019-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Remove some mentions of RECOVERABLE_ERROR in testsNikita Popov2018-11-151-5/+0
| | | | | | | | | | | | Mostly drop error handlers that are no longer necessary.
* | | Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-1564-78/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Trim trailing whitespace in *.phptPeter Kokot2018-10-1421-22/+22
| | |
* | | Trim trailing whitespace in testsGabriel Caruso2018-10-14113-297/+297
| | |
* | | Don't overload get_properties for ArrayObjectNikita Popov2018-10-101-13/+0
| | | | | | | | | | | | | | | | | | Instead overload get_properties_for for a few specific cases such as array casts. This resolves the issue where ArrayObject get_properties may violate engine invariants in some cases.
* | | Merge branch 'PHP-7.3'Nikita Popov2018-09-291-1/+4
|\ \ \ | |/ /
| * | Fixed bug #72635Nikita Popov2018-09-291-1/+4
| | | | | | | | | | | | | | | | | | This seems to be a simple oversight, where we did not enable exceptions. Other constexpr conditions already throw, so there is no particular reason to stick to a fatal error here.
* | | Remove duplicate test fileNikita Popov2018-09-221-69/+0
| | | | | | | | | | | | This is already tested in Zend/tests/bug63463.phpt.
* | | Rename *.p5c files to *.incPeter Kokot2018-09-2110-6/+6
| | | | | | | | | | | | | | | | | | When including files in PHP tests a good practice so far has been to use the *.inc extension. This patch renames few *.p5c files that are included in phpt files.
* | | Fix permissionsPeter Kokot2018-09-214-0/+0
| | | | | | | | | | | | Certain files don't need to be executables.
* | | Fix some misspellingsGabriel Caruso2018-08-123-3/+3
|/ /
* | Fixed bug #76509Nikita Popov2018-06-251-5/+5
| | | | | | | | | | | | | | | | | | | | | | 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.
* | Remove duplicated testsGabriel Caruso2018-02-221-37/+0
| |
* | Use EXPECT instead of EXPECTF when possibleGabriel Caruso2018-02-2071-71/+71
| | | | | | | | EXPECTF logic in run-tests.php is considerable, so let's avoid it.
* | Remove trailing whitespace in inc filesGabriel Caruso2018-02-102-2/+2
| |
* | Use int instead of integer in type errorsGabriel Caruso2018-02-042-11/+11
| | | | | | | | | | | | | | PHP requires integer typehints to be written "int" and does not allow "integer" as an alias. This changes type error messages to match the actual type name and avoids confusing messages like "must be of the type integer, integer given".
* | Remove superfluous SKIPIF sections in testsGabriel Caruso2018-02-035-10/+0
| |
* | Fix #75765 Exception on extend of undefined classtimurib2018-01-122-1/+26
| | | | | | | | | | | | As the parent class is fetched prior to binding, there are no safety concerns in this case and we can replace the fatal error with an Error exception.
* | Req #74963 (Improved error message on fetching property of non-object)Xinchen Hui2017-07-311-9/+9
|/
* Implement object type annotationMichaƂ Brzuchalski2017-06-254-94/+94
| | | | RFC: https://wiki.php.net/rfc/object-typehint
* Change 'undefined constant' from E_NOTICE to E_WARNING and mention deprecationRowan Collins2017-03-232-2/+2
| | | | | Implements RFC "Deprecate and Remove Bareword (Unquoted) Strings" [https://wiki.php.net/rfc/deprecate-bareword-strings]
* Implement Parameter Type Widening RFCNiklas Keller2017-02-041-14/+0
|
* Deprecate each()Nikita Popov2017-02-031-4/+3
|
* Deprecate __autoload()Nikita Popov2017-02-0321-208/+188
|
* Remove zend_version() checks from testsNikita Popov2017-01-30111-216/+0
|
* Remove more PHP 6 leftovers from testsNikita Popov2016-11-247-43/+43
|
* Implement \ArgumentCountError exceptionDavey Shafik2016-08-301-1/+1
|
* Fixed testsXinchen Hui2016-08-232-4/+0
|
* Show "or null" in TypeErrors for nullable arg_infosAndrea Faulds2016-08-111-3/+3
|