summaryrefslogtreecommitdiff
path: root/Zend/zend_operators.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove HAVE_STRCOLL checkPeter Kokot2019-06-281-2/+0
| | | | | | | | | The strcoll function is defined in the C89 standard and should be on today's systems always available via the <string.h> header. https://port70.net/~nsz/c/c89/c89-draft.html#4.11.4.3 - Remove also SKIPIF strcoll check in test
* Disable float division by zero sanitizer for div_functionNikita Popov2019-06-201-0/+3
| | | | | We intentionally divide by zero here and want to get IEEE-754 semantics.
* Fix signed shift UBNikita Popov2019-06-191-1/+2
|
* Avoid overflow UB in is_numeric_stringNikita Popov2019-06-191-2/+2
| | | | | We intentionally overflow the signed space here, so make this an unsigned variable and only cast to signed at the end.
* Support full variance if autoloading is usedNikita Popov2019-06-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keep track of delayed variance obligations and check them after linking a class is otherwise finished. Obligations may either be unresolved method compatibility (because the necessecary classes aren't available yet) or open parent/interface dependencies. The latter occur because we allow the use of not fully linked classes as parents/interfaces now. An important aspect of the implementation is we do not require classes involved in variance checks to be fully linked in order for the class to be fully linked. Because the involved types do have to exist in the class table (as partially linked classes) and we do check these for correct variance, we have the guarantee that either those classes will successfully link lateron or generate an error, but there is no way to actually use them until that point and as such no possibility of violating the variance contract. This is important because it ensures that a class declaration always either errors or will produce an immediately usable class afterwards -- there are no cases where the finalization of the class declaration has to be delayed until a later time, as earlier variants of this patch did. Because variance checks deal with classes in various stages of linking, we need to use a special instanceof implementation that supports this, and also introduce finer-grained flags that tell us which parts have been linked already and which haven't. Class autoloading for variance checks is delayed into a separate stage after the class is otherwise linked and before delayed variance obligations are processed. This separation is needed to handle cases like A extends B extends C, where B is the autoload root, but C is required to check variance. This could end up loading C while the class structure of B is in an inconsistent state.
* Support for exceptions thrown during "Array to string conversion" error ↵Dmitry Stogov2019-06-061-1/+2
| | | | processing
* Cheaper checks for exceptions thrown from __toString()Dmitry Stogov2019-06-061-15/+18
|
* Allow exceptions in __toString()Nikita Popov2019-06-051-11/+50
| | | | | | | | | | 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.
* Implement basic variance supportNikita Popov2019-05-241-2/+2
| | | | | | | This is a minimal variance implementation: It does not support any cyclic type dependencies. Additionally the preloading requirements are much more restrictive than necessary. Hopefully we can relax these in the future.
* Make is_identical() functions return zend_bool (instead of int)Dmitry Stogov2019-04-041-7/+2
|
* Remove local variablesPeter Kokot2019-02-031-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Adios, yearly copyright rangesZeev Suraski2019-01-301-1/+1
|
* Update email addresses. We're still @Zend, but future proofing it...Zeev Suraski2018-11-011-3/+3
|
* Introduce get_properties_for() handlerNikita Popov2018-10-101-24/+12
| | | | | This handler allows getting the object properties for a particular purpose, such as array casting, serialization, etc.
* Remove dead code (only IS_ARRAY may relive ↵Dmitry Stogov2018-09-271-11/+9
| | | | zendi_convert_scalar_to_number()), and micro-optimization.
* Replace ZEND_ACC_ANON_BOUND, ZEND_ACC_UNRESOLVED_PARENT and ↵Dmitry Stogov2018-09-181-2/+2
| | | | ZEND_ACC_UNRESOLVED_INTERFACES with single ZEND_ACC_LINKED.
* Remove unused ZEND_FILE_LINE in i_zval_ptr_dtorNikita Popov2018-09-161-2/+2
|
* Merge branch 'PHP-7.3'Remi Collet2018-08-301-1/+1
|\ | | | | | | | | * PHP-7.3: fix double cast to int on 32-bit
| * Merge branch 'PHP-7.2' into PHP-7.3Remi Collet2018-08-301-1/+1
| |\ | | | | | | | | | | | | * PHP-7.2: fix double cast to int on 32-bit
| | * Merge branch 'PHP-7.1' into PHP-7.2Remi Collet2018-08-301-1/+1
| | |\ | | | | | | | | | | | | | | | | * PHP-7.1: fix double cast to int on 32-bit
| | | * fix double cast to int on 32-bitRemi Collet2018-08-301-1/+1
| | | |
| | | * year++Xinchen Hui2018-01-021-1/+1
| | | |
| | * | year++Xinchen Hui2018-01-021-1/+1
| | | |
* | | | Keep information about unresolved interfaces in ↵Dmitry Stogov2018-08-231-6/+12
|/ / / | | | | | | | | | | | | | | | | | | zend_class_entry->interface_names. Move interface implementation code into ZEND_DECLARE_*CLASS opcodes. Remove ZEND_ADD_INTERFACE and ZEND_VERIFY_ABSTRACT_CLASS opcodes.
* | | Split add/sub_function(s) into fast and slow partsDmitry Stogov2018-07-251-99/+132
| | |
* | | Remove unused Git attributes identPeter Kokot2018-07-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
* | | API cleanup.Dmitry Stogov2018-07-231-3/+3
| | | | | | | | | | | | | | | Removed useless filename and lineno arguments, used in DEBUG build. The patch doesn't break source compatibility of public API (only binary compatibility).
* | | Removed deprecated conditionDmitry Stogov2018-07-101-1/+1
| | |
* | | Use zval_ptr_dtor() instead of zval_dtor() in in-place array/object ↵Dmitry Stogov2018-07-061-8/+8
| | | | | | | | | | | | conversion functions
* | | Conversion related optimizationsDmitry Stogov2018-07-061-26/+22
| | |
* | | Removed legacy zval_dtor() usage. It doesn't work with zvals with refcount ↵Dmitry Stogov2018-07-051-8/+3
| | | | | | | | | | | | == 0, anyway.
* | | Fixed some incorrect zval_dtor() usagesDmitry Stogov2018-07-041-11/+11
| | |
* | | se zval_ptr_dtor_str() instead of zend_string_release_ex(Z_STR(*), 0)Dmitry Stogov2018-07-041-12/+12
| | |
* | | concat_function() micro optimizationDmitry Stogov2018-07-041-38/+26
| | |
* | | Avoid agressive inlining in rarely used pathsDmitry Stogov2018-05-301-71/+114
| | |
* | | Removed useless zval_ptr_dtor()Dmitry Stogov2018-05-291-2/+0
| | |
* | | Use zend_string_release_ex() instread of zend_string_release() in places, ↵Dmitry Stogov2018-05-281-16/+16
| | | | | | | | | | | | where we sure about string persistence.
* | | Avoid double copyingDmitry Stogov2018-03-061-8/+3
| | |
* | | Use bool instead of booleanGabriel Caruso2018-02-081-1/+1
| | |
* | | Added zendi_smart_streq() for smart string equality checkDmitry Stogov2018-01-161-0/+48
| | |
* | | Convert "sparse switch" statements into sequences of "if" with the most ↵Dmitry Stogov2018-01-101-242/+248
| | | | | | | | | | | | probable conditions first
* | | Trailing whitespacesGabriel Caruso2018-01-031-2/+2
| | | | | | | | | | | | Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
* | | year++Xinchen Hui2018-01-021-1/+1
| | |
* | | Add _IS_NUMBER as cast_object() target typeNikita Popov2017-12-261-24/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Cleanup type conversionDmitry Stogov2017-12-071-1/+1
| | |
* | | Use zend_string_equal*() API for zend_string equality check instead of ↵Dmitry Stogov2017-12-041-3/+1
| | | | | | | | | | | | direct memcmp() usage.
* | | Use zend_string_tolower() where it's possible (to avoid reallocations).Dmitry Stogov2017-11-301-2/+2
| | | | | | | | | | | | Allow zend_string_tolower_ex() to create parsistent strings
* | | Fixed bug #75575Nikita Popov2017-11-281-2/+2
| | | | | | | | | | | | | | | | | | | | | These functions are never called with needle longer than haystack, but it makes sense to explicitly check for this, especially as we already perform a check for empty haystack anyway, which is naturally subsumed by a haystack_len < needle_len check.
* | | Enable and fix printf() format warningsNikita Popov2017-11-161-1/+1
| | | | | | | | | | | | | | | | | | Add _unchecked() variants of zend_spprintf and zend_strpprintf for cases where we specifically want to disable these checks, such as use of %H.
* | | Avoid unnecessary reference-counting on strings.Dmitry Stogov2017-11-161-16/+20
| | |