Gabriel Caruso
6400264856
Trailing whitespaces
...
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514
year++
2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49
year++
2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7
year++
2018-01-02 12:53:31 +08:00
Dmitry Stogov
efcbea4345
Cheaper reference construction
2017-12-26 13:30:25 +03:00
Nikita Popov
3fde27d87d
Merge branch 'PHP-7.2'
2017-12-16 17:10:09 +01:00
Pedro Magalhães
83964e0468
Fix #75607 - Check if existing static trait property is a ref before comparing
2017-12-16 17:07:12 +01:00
Dmitry Stogov
ec2dde0c0b
Introduced zend_hash_find_ex() that may avoid unnecessary hash value check.
2017-11-24 14:01:19 +03:00
Pedro Magalhães
179ed6e43d
63911: Compare opcodes of the op_array to determine different functions
2017-11-22 05:35:24 +00:00
Anatol Belski
80d6eb6806
Fix unsigned comparisons and remove dead code
...
Fix unsigned comparison
Cleanup never executed block
Fix unsigned comparison
Fix unsigned comparison, diff can't be < 0
Fix unsigned comparison
Fix unsigned comparison
Remove dead code
2017-11-17 22:38:44 +01:00
Dmitry Stogov
ccc12b82da
Avoid unnecessary reference-counting on strings.
2017-11-16 17:09:32 +03:00
Pedro Magalhães
897bdb42f0
Fix #74922 - Try to resolve constants when importing trait properties
2017-11-02 21:06:27 +01:00
Xinchen Hui
a8a17a72b0
RC manipulation cleanup
2017-11-01 10:25:10 +08:00
Dmitry Stogov
8482a6f511
Fixed use-after free introduced in fcc08ce19f
2017-10-31 01:20:38 +03:00
Dmitry Stogov
fcc08ce19f
Prevent reference-counting on persistent zvals (internal constants, default properties and constants of internal classes).
...
New macro ZVAL_COPY_OR_DUP() is used perform duplication, if necessary.
This should eliminate related race-coditions in ZTS build and prevent reference-counting bugs after unclean shutdown.
2017-10-30 23:13:10 +03:00
Dmitry Stogov
49ea143bbd
Encapsulate reference-counting primitives.
...
Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead.
Added mactros to validate reference-counting (disabled for now).
These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
2017-10-27 01:28:58 +03:00
Dmitry Stogov
ef5ea48741
Always use IS_CONSTANT_AST (IS_CONSTANT is removed).
2017-10-10 10:11:05 +03:00
Dmitry Stogov
e70618aff6
Changed the way VM accesses constant operands in 64-bit builds.
2017-10-04 16:53:01 +03:00
Anatol Belski
bc5811f361
further sync for vim mode lines
2017-07-04 18:12:45 +02:00
Pedro Magalhães
c6c1e75e6b
Fix bug #74607 : Don't check for bi-directional compatibility in traits
2017-06-03 00:24:43 +02:00
Pedro Magalhães
a5eb57c96e
Allow overriding abstract methods
...
RFC: https://wiki.php.net/rfc/allow-abstract-function-override
2017-05-24 17:42:01 +02:00
Dmitry Stogov
dfffe6cb32
Type hint inheritance check optimization
2017-05-10 22:25:32 +03:00
Nikita Popov
d8aa99ed94
Drop unused variable
2017-05-01 14:16:26 +02:00
Pedro Magalhães
5324fb1f34
Fixed bug #61970 : Allow a child class to restrict access to ctor
2017-05-01 14:15:57 +02:00
Pedro Magalhães
92124f9cdc
Fixed bug #74269 : Strict comparison of initial trait property values
2017-05-01 12:59:27 +02:00
Nikita Popov
b6a4aad820
Remove the ZEND_ACC_CLONE flag
...
This one is completely unused
2017-04-22 15:47:53 +02:00
Niklas Keller
2edc3cf8d2
Implement Parameter Type Widening RFC
2017-02-04 23:33:24 +01:00
Joe Watkins
46de334452
Revert "Inheritance checks should not ignore parents if these implement an interface"
...
This reverts commit b67eb3440b
.
2017-02-01 18:34:14 +00:00
Joe Watkins
c827124632
Merge branch 'PHP-7.1'
...
* PHP-7.1:
Added tests demonstrating the same effect with abstracts
Inheritance checks should not ignore parents if these implement an interface
2017-01-28 06:28:24 +00:00
Pedro Magalhães
b67eb3440b
Inheritance checks should not ignore parents if these implement an interface
2017-01-28 06:28:10 +00:00
Dmitry Stogov
141d1ba980
Introduced "zend_type" - an abstraction for type-hinting representation.
2017-01-13 11:37:46 +03:00
Sammy Kaye Powers
dac6c639bb
Update copyright headers to 2017
2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
9e29f841ce
Update copyright headers to 2017
2017-01-02 09:30:12 -06:00
Nikita Popov
7cd2494bb8
Merge branch 'PHP-7.0' into PHP-7.1
2016-09-22 12:34:55 +02:00
John Boehr
8e313becf4
Fix bug #69579
2016-09-22 12:32:37 +02:00
Nikita Popov
2b46e3c710
Merge branch 'PHP-7.0'
2016-07-05 14:34:20 +02:00
Nikita Popov
8a555d7c66
Merge branch 'PHP-5.6' into PHP-7.0
...
Conflicts:
Zend/zend_compile.c
2016-07-05 14:32:38 +02:00
Aaron Piotrowski
583386d59e
Swap type check order
2016-06-29 09:36:33 -05:00
Aaron Piotrowski
277d89cde8
Limit covariance to array and Traversable
2016-06-05 22:06:17 -05:00
Aaron Piotrowski
cf0290c273
Fix abort too early
2016-06-05 02:01:01 -05:00
Aaron Piotrowski
4da3e77b4c
Covariance on inheriting classes with iterable
2016-06-04 09:44:49 -05:00
Dmitry Stogov
0cdbabe558
Merge branch 'nullable_types' of github.com:morrisonlevi/php-src
...
* 'nullable_types' of github.com:morrisonlevi/php-src:
Fix bug #71428
Add nullable parameter types
Implement nullable return types.
2016-05-23 10:14:26 +03:00
Dmitry Stogov
37c8711f49
Fixed typo
2016-05-06 10:47:58 +03:00
Dmitry Stogov
c19cb70dac
Revert "Refactor zval cleanup into single function"
...
This reverts commit bac6fdb0c5
.
2016-05-06 10:47:58 +03:00
Bob Weinand
bac6fdb0c5
Refactor zval cleanup into single function
...
Also use zval_ptr_dtor_nogc() everywhere in Zend in favor of zval_dtor()
2016-05-05 23:31:57 +02:00
Levi Morrison
56c3d75780
Fix bug #71428
...
This also affects bug #72119
2016-05-05 11:53:32 -06:00
Levi Morrison
9662259cb9
Add nullable parameter types
...
This works off of Dmitry's commit for nullable return types
2016-05-05 11:53:32 -06:00
Dmitry Stogov
49fe737e58
Implement nullable return types.
2016-05-05 09:34:16 -06:00
Dmitry Stogov
19c0335609
Revert "Fix bad merge into master"
...
This reverts commit 2c8e4ba8f1
.
2016-04-29 11:15:26 +03:00
Bob Weinand
2c8e4ba8f1
Fix bad merge into master
...
This should only have been reverted in 7.0, but not for 7.1. (merge=ours??)
Added appropriate NEWS entry.
2016-04-28 19:32:14 +02:00
Dmitry Stogov
389f77b37c
Merge branch 'PHP-7.0'
...
* PHP-7.0:
Fixed BC break described by bug #72119 . It was introduced after 7.0.5 release by attempt to fix bug #71428 .
2016-04-28 19:57:59 +03:00
Dmitry Stogov
9e45ac53ce
Fixed BC break described by bug #72119 .
...
It was introduced after 7.0.5 release by attempt to fix bug #71428 .
2016-04-28 19:56:10 +03:00
Dmitry Stogov
0f8d0df938
Merge branch 'PHP-7.0'
...
* PHP-7.0:
Prevent usage in GC after free.
2016-04-19 01:37:45 +03:00
Dmitry Stogov
e46be0cd19
Merge branch 'PHP-5.6' into PHP-7.0
...
* PHP-5.6:
Prevent usage in GC after free.
2016-04-19 01:37:24 +03:00
Dmitry Stogov
3c305c14f6
Merge branch 'PHP-7.0'
...
* PHP-7.0:
Fixed build
2016-04-07 01:00:34 +03:00
Dmitry Stogov
088f55ae74
Fixed build
2016-04-07 00:59:21 +03:00
Kalle Sommer Nielsen
fdff901cad
Fix the build
2016-04-06 22:25:05 +02:00
Dmitry Stogov
936f161402
Merge branch 'PHP-7.0'
...
* PHP-7.0:
Fixed bug #71978 (Existence of return type hint affects other compatibility rules)
2016-04-06 17:20:43 +03:00
Dmitry Stogov
e9d65160e8
Fixed bug #71978 (Existence of return type hint affects other compatibility rules)
2016-04-06 17:17:10 +03:00
Nikita Popov
32294a25c8
Fixed bug #62814
2016-03-29 19:08:17 +02:00
Joe Watkins
8ae3524a13
Merge branch 'PHP-7.0'
...
* PHP-7.0:
remove unused param
2016-03-29 11:34:31 +01:00
Joe Watkins
d12ed0c7fa
remove unused param
2016-03-29 11:34:18 +01:00
Joe Watkins
45035b1b8d
Merge branch 'PHP-7.0'
...
* PHP-7.0:
fix bug #71428 : Validation type inheritance with = NULL
2016-03-29 09:58:06 +01:00
Joe Watkins
dd70c39556
fix bug #71428 : Validation type inheritance with = NULL
2016-03-29 09:57:51 +01:00
Joe Watkins
bdd05e7483
Merge branch 'PHP-7.0'
...
* PHP-7.0:
Bug #71428 work ... hopefully, fix drupal 8
2016-03-29 09:36:46 +01:00
Joe Watkins
3f56dfe866
Bug #71428 work ... hopefully, fix drupal 8
2016-03-29 09:36:08 +01:00
Joe Watkins
34d8fea1a8
Merge branch 'PHP-7.0'
...
* PHP-7.0:
work on #71428
2016-03-28 11:55:03 +01:00
Joe Watkins
ee9a78a033
work on #71428
2016-03-28 11:54:25 +01:00
Xinchen Hui
9b61479166
We don't need to dup zend_class_constant here.
...
quote why the internal class is still using duplication:
```
for internal classes, the zend_class_constant is malloc-ed. we need to
free it.
if (const->ce == ce) {
zval_ptr_dtor(&const->value);
free(const)
}
so, if two classes share one const, and it(parent class) was freed
before, this read(in child class, const->ce) is invalid..
and destroy_zend_class is called via zend_hash_destroy(class_table).
which is not in reverse order... so, parent classes are dtor first.
if we want this work, we should change that order.
```
2016-01-22 11:22:37 +08:00
Xinchen Hui
62c1c11ad3
Fixed bug #71413 (Crash with constants on internal interfaces)
2016-01-21 13:30:41 +08:00
Dmitry Stogov
d47285648c
Merge branch 'PHP-7.0'
...
* PHP-7.0:
Fixed bug #71248 (Wrong interface is enforced)
Update NEWS
2016-01-13 11:42:50 +03:00
Dmitry Stogov
50be2c89be
Fixed bug #71248 (Wrong interface is enforced)
2016-01-13 11:41:57 +03:00
Xinchen Hui
4550e93b78
Merge branch 'PHP-7.0'
2016-01-06 00:03:01 +08:00
Bob Weinand
654c8aedd1
Fixed bug #71275 (Bad method called on cloning an object having a trait)
2016-01-05 16:27:24 +01:00
Xinchen Hui
563659822d
Merge branch 'PHP-7.0'
2016-01-02 17:56:54 +08:00
Xinchen Hui
97a9470d97
bump year which is missed in rev 49493a2
2016-01-02 17:56:11 +08:00
Julien Pauli
7a2f60d3c7
Merge branch 'PHP-7.0'
...
* PHP-7.0:
Remove mentions of "type hint" and "typehint"
2015-12-24 15:19:54 +01:00
Levi Morrison
2a7eeff33e
Remove mentions of "type hint" and "typehint"
2015-12-24 15:19:31 +01:00
Dmitry Stogov
a75c195000
Implemented the RFC Support Class Constant Visibility
.
...
Squashed commit of the following:
commit f11ca0e7a5
Author: Dmitry Stogov <dmitry@zend.com>
Date: Tue Dec 8 12:38:42 2015 +0300
Fixed test expectation
commit 211f873f54
Author: Dmitry Stogov <dmitry@zend.com>
Date: Tue Dec 8 12:28:38 2015 +0300
Embed zend_class_constant.flags into zend_class_constants.value.u2.access_flags
commit 51deab84b2
Author: Dmitry Stogov <dmitry@zend.com>
Date: Mon Dec 7 11:18:55 2015 +0300
Fixed issues found by Nikita
commit 544dbd5b47
Author: Dmitry Stogov <dmitry@zend.com>
Date: Sat Dec 5 02:41:05 2015 +0300
Refactored immplementation of https://wiki.php.net/rfc/class_const_visibility
@reeze created an RFC here and I emailed internals here and didn't get any responses positive/negative.
2015-12-08 12:40:42 +03:00
Nikita Popov
ccec609b82
Fix bug #62441
...
These checks were introduced by 8646d9afce
back when name resolution was working differently.
2015-08-28 19:00:05 +02:00
Dmitry Stogov
71af54e5f6
Mark error and exception functions as "cold" (Matt's idea)
2015-08-19 14:40:56 +03:00
Michael Wallner
17fc5cc65d
fix inheritance of internal interfaces with constants
2015-08-18 08:20:12 +02:00
Xinchen Hui
121409865b
use efree_size here
2015-08-12 11:15:09 +08:00
Xinchen Hui
8e709d7f5d
Fixed invalid read (Part issue of #69579 )
2015-07-10 22:26:53 +08:00
Xinchen Hui
54305c8952
Fixed No 2 issue in #1400
2015-07-10 16:04:45 +08:00
Xinchen Hui
a3f05d640d
Fixed Issue #1400 (double free static property)
2015-07-10 15:27:06 +08:00
Niklas Keller
5f72d94a8b
Correct type hint name for booleans in method signatures
2015-07-02 21:14:30 +02:00
Dmitry Stogov
7aa7627172
Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes).
2015-06-30 13:59:27 +03:00
Dmitry Stogov
66031cfe19
Restored old behavior
2015-06-29 14:10:46 +03:00
Bob Weinand
e5fae77969
Show full signature upon inheritance mismatch
2015-06-29 01:00:12 +02:00
Dmitry Stogov
6bcf121f5b
micro-optimization
2015-06-03 13:43:05 +03:00
Xinchen Hui
6b5ca7202f
Fixed #69566 in master
2015-05-04 10:35:55 +08:00
Dmitry Stogov
a2d87429d5
Removred temporary code
2015-04-22 13:14:03 +03:00
Dmitry Stogov
8ef7e14117
Improved property inheritance code
2015-04-22 12:53:54 +03:00
Xinchen Hui
a090977419
Merge branch 'PHP-5.6'
...
Conflicts:
Zend/zend_compile.c
2015-04-21 22:39:46 +08:00
Xinchen Hui
c5903e79be
Merge branch 'PHP-5.6'
...
Conflicts:
Zend/zend_compile.c
2015-04-10 22:50:15 +08:00
Dmitry Stogov
ea09a9fa32
Convert fatal errors into EngineExceptions
...
Make zval_update_constant_ex(), zval_update_constant(), zend_update_class_constants() and zend_ast_evaluate() return SUCCESS or FAILURE.
2015-04-02 02:05:25 +03:00
Nikita Popov
8d00385871
Reclassify E_STRICT notices
...
Per RFC https://wiki.php.net/rfc/reclassify_e_strict
While reviewing this, found that there are still three E_STRICTs
left in libraries - need to discuss those.
2015-04-01 11:17:55 +02:00
Andrea Faulds
db76b708cf
Deprecate PHP 4 constructors
2015-03-31 17:55:27 +02:00
Nikita Popov
a34f81deee
Allow adding return type during inheritance
...
This is allowed as per the return types RFC. The test for this
behavior happened to use an internal class without arginfo, which
is why this was not properly implemented.
2015-03-22 18:56:14 +01:00
Xinchen Hui
95b4aa5293
Fixed zend_hash_append result duplicated key
...
actually, maybe we should precalculate before calling zend_hash_appen
when we are not sure whether the hash is caclculated(prop_info->name).
but it looks a little ugly.. (also for zend_string_copy)
2015-03-08 00:21:02 +08:00
Dmitry Stogov
66f5a1e8b4
Make fast path linear
2015-03-06 17:07:36 +03:00
Xinchen Hui
eadff75c7d
Merge branch 'PHP-5.6'
2015-03-05 21:10:02 +08:00
Xinchen Hui
2f88a2d520
Merge branch 'cleanup' of https://github.com/zxcvdavid/php-src
2015-03-05 18:45:00 +08:00
Xinchen Hui
f2c8b611cf
Merge branch 'PHP-5.6'
2015-03-05 18:44:13 +08:00
Wei Dai
488688cfc7
Remove the unused vars
2015-03-05 15:55:30 +08:00
Dmitry Stogov
6dfff52f61
Improved method inhereitance code and cleanup
2015-03-05 02:10:38 +03:00
Dmitry Stogov
c9bd24de7a
Improved ineritance code
2015-03-04 23:06:07 +03:00
Dmitry Stogov
8ec8648c91
Improved code for class property inheritance
2015-03-04 17:41:01 +03:00
Guilherme Blanco
4498d34aea
Check interface/trait extension for internal classes
...
Removed possibility to have extensions to declare classes extending
interfaces or traits. It was checked in user classes, not extensions
or internal.
2015-02-13 15:31:48 +01:00
Guilherme Blanco
8c81d80e10
Made ZEND_ACC_TRAIT a saner value
...
CC_TRAIT valued as 0x120 is too magical to be comprehensible by others.
2015-02-12 23:20:19 +01:00
Dmitry Stogov
9e70d7672d
Move zend_object->guards into additional slot of zend_object->properties_table[]. As result size of objects without __get/__set/__unset/__isset magic methods is reduced.
2015-02-04 15:24:13 +03:00
Joshua Rogers
26d5ad6c98
Add check for null pointer, as done in case 5 lines above.
2015-01-30 13:30:17 +11:00
Xinchen Hui
a1d9ceac7a
Fixed annoying warnings
2015-01-29 11:59:37 +08:00
Levi Morrison
c8576c5a46
Implement return types
...
RFC is documented here: https://wiki.php.net/rfc/return_types
2015-01-27 11:49:56 -07:00
Xinchen Hui
fc33f52d8c
bump year
2015-01-15 23:27:30 +08:00
Stanislav Malyshev
b7a7b1a624
trailing whitespace removal
2015-01-10 15:07:38 -08:00
Dmitry Stogov
c42ac09518
Added new API function 'zend_string* zend_string_tolower(zend_string*)'.
...
It simplifies code and avoids unnecessary allocation and copying if string is already in lower case.
2014-12-24 15:04:51 +03:00
Dmitry Stogov
2646f7bcb9
Don't count variadic argument in zend_func.common.num_args. This allows faster CALL/RETURN code.
2014-12-22 16:44:39 +03:00
Anatol Belski
bdeb220f48
first shot remove TSRMLS_* things
2014-12-13 23:06:14 +01:00
Dmitry Stogov
3893c1fc3d
Fixed compilation warnings
2014-12-12 21:57:34 +03:00
Guilherme Blanco
094d409b3d
Removed ZEND_ACC_FINAL_CLASS which is unnecessary. This also fixed some currently defined classes as final which were just not being considered as such before.
2014-12-12 17:29:54 +01:00
Julien Pauli
ebe755f149
Merge branch 'PHP-5.6'
...
* PHP-5.6:
Updated NEWS
Updated NEWS
Fixed Bug #65576 (Constructor from trait conflicts with inherited constructor)
Conflicts:
Zend/zend_compile.c
2014-12-12 16:14:24 +01:00
Dmitry Stogov
14e29f5146
Reduced size of zend_op on 64-bit systems.
...
the main idea - the smaller the zend_op structure, the lees memory traffic is required to load VM instructions during execution. The patch reduces the size of each opcode from 48 to 32 bytes (saves 16 bytes for each opcode, and applications use thousands of opoceds). This reduced the number of CPU cache misses by 12% and improved performance of real-life apps by 1-2%.
The patch affects how constants and jump targets are represented in VM during execution. Previously they were implemented as absolute 64-bit pointers. Now they are relative 32-bit offsets.
In run-time constant now should be accessed as:
RT_CONSTANT(op_array, opine->op1) instead of opline->op1.zv
EX_CONSTANT(opline->op1) instead of opline->op1.zv
Jump targets:
OP_JMP_ADDR(opline, opline->op2) instead of opline->op2.jmp_addr
The patch doesn't change zend_op representation for 32-bit systems. They still use absolute addresses. The compile-time representation is also kept the same.
2014-12-12 10:19:41 +03:00
Dmitry Stogov
5dd427eac2
Use zend_string* for op_array->arg_info[]->name and op_array->arg_info[]->class_name. For internal functions we still use char*.
2014-12-03 16:56:09 +03:00
Julien Pauli
af3a42022b
Fix #68185 - Inconsistent insteadof definition
2014-11-21 16:05:31 +01:00
Veres Lajos
4b9535341a
typo fixes - https://github.com/vlajos/misspell_fixer
2014-11-19 20:23:00 +00:00
Dmitry Stogov
75041379a6
Improved object property access.
2014-11-06 14:50:03 +03:00
Anatol Belski
8fdaeef8e8
fix datatype mismatches
2014-10-27 16:38:38 +01:00
Dmitry Stogov
7cef08c5d1
Allocate copies of internal functions inherited in user classes at CG(arena), instead of permanent heap (malloc).
2014-09-23 12:35:42 +04:00
Nikita Popov
a770d29df7
Add smart_str_append for appending zend_strings
...
Also replaces usages in Zend/ and ext/standard
2014-09-21 20:58:31 +02:00
Nikita Popov
e26a688871
Use smart_str in get_function_declaration
...
Instead of custom smart string implementation
2014-09-21 20:49:39 +02:00
Xinchen Hui
96ccf3ef98
Added missed mod str
2014-09-20 15:12:08 +08:00
Nikita Popov
c343ca4efb
Split inheritance into separate file
...
This moves handling of inheritance and interface implementation
from zend_compile.c into a separate zend_inheritance.c file, as
this is not really related to compilation.
2014-09-19 19:54:37 +02:00