Commit Graph

10063 Commits

Author SHA1 Message Date
Dmitry Stogov
0ef5a6b409 Avoid unnecassary check 2015-02-24 19:21:21 +03:00
Dmitry Stogov
e97ae4fee8 Make zend_array_destroy() to free the corresponding zend_array 2015-02-24 18:34:37 +03:00
Dmitry Stogov
26be614400 Eliminate check on the fast path 2015-02-24 18:34:15 +03:00
Xinchen Hui
078340b563 correct title 2015-02-22 00:22:20 +08:00
Xinchen Hui
e3416beb03 Fixed segfault because resource is freed prematurely 2015-02-22 00:19:06 +08:00
Xinchen Hui
f25419f8e3 Only do this in debug build 2015-02-21 22:44:51 +08:00
Xinchen Hui
865a719a3f Fixed mem issue with internal return type hinting assert 2015-02-21 22:17:17 +08:00
Xinchen Hui
4629f8978e Cleanup globals initialization
No needs explicit inititlize zero for globals in no-zts build.
executor_globals should be initialized in zend side.
2015-02-21 11:35:16 +08:00
Xinchen Hui
1c31ad4f0d Unused var 2015-02-21 10:58:23 +08:00
Dmitry Stogov
e142e31137 Fixed memory leak 2015-02-20 20:50:01 +03:00
Xinchen Hui
09ac3e931c uint32_t 2015-02-21 01:19:07 +08:00
Anthony Ferrara
b3be3c5b17 Clean up tri-state logic to use break instead 2015-02-20 11:54:33 -05:00
Anthony Ferrara
e3b020b945 Fix declare error behavior so that improper usages will actually error 2015-02-20 11:43:18 -05:00
Dmitry Stogov
5f76eed14e don't count op_arrays stored in opcache SHM 2015-02-20 14:59:30 +03:00
Dmitry Stogov
d85113702c Lazy duplication of op_array->static_variables 2015-02-20 13:28:26 +03:00
Dmitry Stogov
6b779596d7 Implemented AST pretty-printer 2015-02-19 11:11:17 +03:00
Stanislav Malyshev
3551083c2c Merge branch 'pull-request/1007'
* pull-request/1007:
  Fix associativity to match Perl
  Blast off to space.
2015-02-18 08:48:17 +01:00
Anatol Belski
af3ca74501 made ZEND_TSRMLS_CACHE_* macros look like function calls
which also comply with the current semantics for such macros
2015-02-16 17:19:32 +01:00
Dmitry Stogov
e10e151e9b Merged zend_array and HashTable into the single data structure.
Now each HashTable is also zend_array, so it's refcounted and may be a subject for Copy on Write
zend_array_dup() was changed to allocate and return HashTable, instead of taking preallocated HashTable as argument.
2015-02-13 22:20:39 +03:00
Nikita Popov
03ded8c7ea Remove unused variable 2015-02-13 15:33:50 +01: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
Xinchen Hui
e5d8a14239 Revert "Cleanup globals initialization"
This reverts commit 309e90638d.
2015-02-13 18:25:44 +08:00
Xinchen Hui
da7d94cd73 Merge branch 'PHP-5.6'
Conflicts:
	ext/soap/soap.c
	ext/standard/basic_functions.c
	ext/zlib/zlib.c
2015-02-13 13:28:24 +08:00
Xinchen Hui
309e90638d Cleanup globals initialization 2015-02-13 10:58:35 +08:00
Xinchen Hui
2766dbaf6d Unused vars 2015-02-13 10:53:40 +08:00
Dmitry Stogov
12abac8bb7 Limit HashTable size to avoid integer overflow checks 2015-02-13 02:12:42 +03:00
Nikita Popov
2fb85f1058 Cleanup checks in zend_builtin_functions.c
The EXPLICIT_ABSTRACT_CLASS comparisons are no longer necessary.
2015-02-12 23:31:01 +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
Anatol Belski
07fdc1c78b fix data types 2015-02-12 18:39:40 +01:00
Dmitry Stogov
4d2a575db2 Stop using internal array/object pointer in foreach by reference according to https://wiki.php.net/rfc/php7_foreach 2015-02-12 14:36:04 +03:00
Dmitry Stogov
97fe15db43 Fix "forech" statemt behaviour according to https://wiki.php.net/rfc/php7_foreach
Squashed commit of the following:

commit 1e41295097
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Sat Jan 31 07:28:58 2015 +0300

    Generalize HashTableIterator API to allows its usage without involvement of HashTable.nInternalPonter

commit 5406f21b11
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:43 2015 +0300

    Reduced alghorithms complexity

commit b37f1d58d2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:30 2015 +0300

    Fixed test name

commit fb2d079645
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:05 2015 +0300

    API cleanup

commit 08302c0d6d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 14:20:46 2015 +0300

    Make array_splice() to preserve foreach hash position

commit cc4b7be41e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 12:24:31 2015 +0300

    Make internal function, operation on array passed by reference, to preserve foreach hash position

commit 5aa9712b0a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 09:49:35 2015 +0300

    Implement consistent behavior for foreach by value over plain object

commit 4c5b385ff5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 07:56:37 2015 +0300

    More careful iterators update.

commit 721fc9e80d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:43:28 2015 +0300

    Added new test

commit 15a23b1218
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:05:02 2015 +0300

    Reimplement iteration magic with HashTableIterators (see https://wiki.php.net/rfc/php7_foreach#implementation_details)

commit 10a3260b1f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:04:44 2015 +0300

    New test

commit eef80c5837
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 16:52:21 2015 +0300

    Fixed foreach by reference iteration over constant array

commit 61e7391873
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 14:59:54 2015 +0300

    Fixed temporary variable re-allocation pass

commit 92e90c09f0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 12:44:57 2015 +0300

    Fixed operand destruction in case of exceptions in iterator

commit dd2a36a207
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 10:02:34 2015 +0300

    Use GET_OP1_ZVAL_PTR_DEREF() (IS_TMP_VAR and IS_CONST can't be IS_REFERENCE)

commit 4638f7b914
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 07:43:28 2015 +0300

    Change "foreach" statement behavior (this is just a PoC yet)

    - "foreach by value" don't relay on internal array/object pointer and doesnt perform array duplication. It just locks it incrementing reference counter. If the original array is modified by some code, the copy on write is performed and "foreach" still work with the old copy.

    - it makes no difference if array given to "foreach by value" is reference itself

    - "foreach by reference" still use internal array/object pointer and should work similar to PHP-5. (This id not completely implemented)
2015-02-12 13:57:12 +03:00
Xinchen Hui
b83352ccf3 Merge branch 'PHP-5.6' 2015-02-12 11:28:42 +08:00
Xinchen Hui
3ae88e023c Merge branch 'PHP-5.5' into PHP-5.6 2015-02-12 11:28:30 +08:00
Xinchen Hui
c2062ca470 Added test for #69017 2015-02-12 11:28:16 +08:00
Xinchen Hui
7062465be0 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-12 10:59:59 +08:00
Xinchen Hui
f2940b7120 Fixed bug #69017 (Fail to push to the empty array with the constant value defined in class scope) 2015-02-12 10:59:28 +08:00
Dmitry Stogov
a75d1d99b4 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  add missing test for class member access with deference relates to https://wiki.php.net/rfc/uniform_variable_syntax
  fix dir separator in test
2015-02-11 17:41:52 +03:00
Dmitry Stogov
35aea97e42 Fixed bug #69025 (Invalid read of size 4 when calling __callStatic) 2015-02-11 17:41:21 +03:00
Márcio Almada
1849546ada add missing test for class member access with deference
relates to https://wiki.php.net/rfc/uniform_variable_syntax
2015-02-11 15:23:20 +01:00
Xinchen Hui
63c923e3e1 Forget this change 2015-02-11 16:06:47 +08:00
Xinchen Hui
4f1fc31e16 Expose zend_string_equals_str_ci 2015-02-11 16:05:20 +08:00
Bob Weinand
2b3bebfa4c Revert removal of two ReflectionParameter functions
Rather fix them for now by exempting function parameter defaults from *any* (non-ct) constant substitution (also from persistent constant substitution, which was already broken before)
2015-02-10 22:20:53 +01:00
Bob Weinand
830d3d79b3 Revert "Revert "Improve and generalize class constant substitution""
This reverts commit 400e65e955.

Removing ReflectionParameter::getDefaultValueConstantName() and isDefaultValueConstant()
They become useless with such optimizations and already anyway are (e.g. CONSTANT?:CONSTANT ... yields the constant back without telling isDefaultValueConstant() about it etc.)
2015-02-10 15:47:17 +01:00
Bob Weinand
400e65e955 Revert "Improve and generalize class constant substitution"
This reverts commit 9ff3800b79.
2015-02-09 22:44:25 +01:00
Bob Weinand
9ff3800b79 Improve and generalize class constant substitution 2015-02-09 17:11:23 +01:00
Xinchen Hui
2a4ed626ca Merge branch 'PHP-5.6' 2015-02-09 11:32:53 +08:00
Xinchen Hui
3d1ec33f96 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-09 11:32:32 +08:00
Márcio Almada
e9f99e3d71 Márcio Almada remove dead tokens: T_CHARACTER, T_BAD_CHARACTER. 2015-02-08 21:44:44 -03:00
Reeze Xia
49073fcf38 Add zend assert deleted by accident 2015-02-07 19:45:22 +08:00
Reeze Xia
61239e1e8b Let's keep it simple 2015-02-07 19:43:00 +08:00
Reeze Xia
d9c28c5581 Improve internal function return types checking for parent
Previously the checking was against 'self', 'parent' need
to be checked as user land declearation as well.

This also add two missing test cases.
2015-02-07 14:19:56 +08:00
Reeze Xia
4d034b1a1e Improve tests for bug 67436
I always use a.php or b.php for local testing,
this diff makes the test more stable
2015-02-07 14:11:09 +08:00
Xinchen Hui
594c220dea Fixed issue #1041 (Fix build in OSX with --enable-dtrace) 2015-02-07 11:27:42 +08:00
Xinchen Hui
3b3308a70a Further fix for bug #68987 2015-02-06 21:13:16 +08:00
Dmitry Stogov
57496c3836 This should fix compilation on OSX (bug #68987 Failed to compile zend.c with gcc-4.9.2) 2015-02-06 13:42:22 +03:00
Xinchen Hui
a3379d6691 Padding 2015-02-05 16:11:44 +08:00
Dmitry Stogov
f5a9cfc33a Merge branch 'internal-function-return-types' of github.com:reeze/php-src into test
* 'internal-function-return-types' of github.com:reeze/php-src:
  Add load time return type checking to match user land logic
  Add test function arguments
  Implemented internal function return types
2015-02-05 11:01:07 +03:00
Reeze Xia
601fcc31af Add load time return type checking to match user land logic 2015-02-05 11:22:11 +08:00
Reeze Xia
2c84006f5a Add test function arguments 2015-02-05 01:21:42 +08:00
Reeze Xia
bff4c47fa7 Implemented internal function return types 2015-02-05 01:04:54 +08:00
Dmitry Stogov
a787719d4f Removed TSRMLS_D 2015-02-04 18:47:30 +03:00
Dmitry Stogov
8b46d45a9d Simplify code and add comments 2015-02-04 17:56:14 +03: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
Dejan Marjanovic
836dcb1da7 Rename __callstatic (internal name) to __callStatic (userland name) in error message 2015-02-03 17:04:52 +01:00
Xinchen Hui
38829b3b4b Merge branch 'master' into resource-api 2015-02-03 23:01:48 +08:00
Dmitry Stogov
6720716682 Optimize class lookup 2015-02-03 17:39:05 +03:00
Dmitry Stogov
e375ba877a Fixed "delayed" compilation 2015-02-02 20:44:16 +03:00
Anatol Belski
79c9dc75de rely on macros from stdint for int constants on 64 bit
32 bit ones are already in use
2015-02-02 09:39:33 +01:00
Xinchen Hui
e98caf27ea found type is unnecessary 2015-02-02 14:45:19 +08:00
Xinchen Hui
942809909e Cleanup resource handling APIs 2015-02-02 13:23:16 +08:00
Stanislav Malyshev
b64cafdb9e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Added test and possible fix for https://bugs.php.net/bug.php?id=67068
2015-01-31 23:17:24 -08:00
Danack
dbc0a80b23 Added test and possible fix for https://bugs.php.net/bug.php?id=67068 2015-01-31 23:13:55 -08:00
Stanislav Malyshev
e8e0481755 Merge branch 'pull-request/994'
* pull-request/994:
  Added test and possible fix for https://bugs.php.net/bug.php?id=67068
2015-01-31 23:12:00 -08:00
Xinchen Hui
1a60175e25 Fixed Magic getter bug tickled by Moodle 2015-01-31 18:12:31 +08:00
Xinchen Hui
8aab1c619c Fixed unused opline warning 2015-01-31 16:50:17 +08:00
Joshua Rogers
26d5ad6c98 Add check for null pointer, as done in case 5 lines above. 2015-01-30 13:30:17 +11:00
Andrea Faulds
d8b7a4480b Fix associativity to match Perl 2015-01-29 17:56:09 +00:00
Andrea Faulds
797dee59cd Blast off to space. 2015-01-29 17:56:09 +00:00
Xinchen Hui
a1d9ceac7a Fixed annoying warnings 2015-01-29 11:59:37 +08:00
Nikita Popov
d133e68bab Remove support for hex number from is_numeric_string 2015-01-28 22:54:17 +01:00
Dmitry Stogov
638d0cb753 Merge branch 'typed_returns' of github.com:morrisonlevi/php-src into test
* 'typed_returns' of github.com:morrisonlevi/php-src:
  Implement return types
2015-01-28 06:56:19 +03: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
Nikita Popov
4d3e4d3bf9 Remove assignment of new by reference 2015-01-26 21:00:22 +01:00
Dmitry Stogov
371dc9b6a6 Fixed bug #68896 (Changing ArrayObject value cause Segment Fault) 2015-01-26 11:25:05 +03:00
Xinchen Hui
91045c4d74 Fixed ext/standard/tests/general_functions/bug41970.phpt fails 2015-01-26 14:41:45 +08:00
Rasmus Lerdorf
388624d359 These tests all have intentional circular references
and they will leak and cause failures unless gc is enabled
2015-01-24 16:06:18 -08:00
Nikita Popov
6093c9370b Fix resource leak when casting to string 2015-01-24 23:18:26 +01:00
Nikita Popov
05166566db Fix declare encoding tests
Also add a test for bwoebi's last change.
2015-01-24 21:51:45 +01:00
Bob Weinand
c637ba118e Fix segfault when no class ctx is defined 2015-01-24 20:00:46 +01:00
Nikita Popov
8dc1287739 Fix build 2015-01-24 19:53:07 +01:00
Bob Weinand
f3675d950d Inline self-constants if possible at compile time 2015-01-24 19:19:02 +01:00
Adam Harvey
eb6dc9db29 Make gc_collect_cycles hookable. 2015-01-23 19:23:58 +00:00
Dmitry Stogov
be31acc927 Fixed memory leak 2015-01-23 20:35:32 +03:00
Dmitry Stogov
a7f1bf3ec5 Fixed possible double free of class static members 2015-01-23 17:10:05 +03:00
Dmitry Stogov
46e486ff3d It doesn't make sense to colect garbage after fatal errors 2015-01-23 16:40:16 +03:00
Dmitry Stogov
f71e64e53a Revert "Fixed ASSERTION"
This reverts commit 76f438e06f.
2015-01-23 16:37:39 +03:00
Xinchen Hui
76f438e06f Fixed ASSERTION 2015-01-23 14:18:56 +08:00
Xinchen Hui
16732dedfe Fixed refcount handling in get_class_vars() 2015-01-23 13:32:07 +08:00
Sara Golemon
b8e262901e Add missing ZEND_API tag to declaration of int zendparse(); 2015-01-22 14:04:49 -08:00
Dmitry Stogov
b494aa0ba0 Fixed compiler reenterability 2015-01-22 20:39:34 +03:00
Dmitry Stogov
6f0e5aab43 Fixed GC after destruction of object store. 2015-01-22 20:38:42 +03:00
Dmitry Stogov
faf917d94e define() must not modify the source array 2015-01-22 15:49:38 +03:00
Dmitry Stogov
e21fefde38 Fixed destruction of circular garbage 2015-01-22 14:24:27 +03:00
Dmitry Stogov
061c0ed9ee Fixed double free and cleanup 2015-01-22 12:59:53 +03:00
Dmitry Stogov
3e31838d19 zend_read_property() has to provide a holder for return value.
Previously it was possible that zend_read_property() returned pointer to zval allocated on stack.
2015-01-22 11:50:42 +03:00
Bob Weinand
4e0ae4dbbc Forgot to add test... 2015-01-21 23:54:03 +01:00
Bob Weinand
bd629428a6 Removed efree() on arena_alloc()ed memory 2015-01-21 23:52:48 +01:00
Anatol Belski
8fb29d3f63 fix declaration 2015-01-20 11:30:03 +01:00
Dmitry Stogov
d975f63f73 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Update remaining octal 32-bit tests
2015-01-20 08:56:09 +03:00
Dmitry Stogov
8dc3c283b8 cleanup 2015-01-20 08:55:36 +03:00
Andrea Faulds
5c88d11243 Update remaining octal 32-bit tests 2015-01-20 05:54:13 +00:00
Xinchen Hui
6f67d5ad6e Unused parse_arg_object_to_string 2015-01-20 12:02:54 +08:00
Xinchen Hui
8d60d37001 Unused var 2015-01-20 11:58:40 +08:00
Sara Golemon
1010b0ea4f Provide compiler hook for altering the AST pre-compilation. 2015-01-19 10:43:57 -08:00
Xinchen Hui
137a251a52 Merge branch 'master' of https://git.php.net/repository/php-src 2015-01-19 09:12:44 -05:00
Nikita Popov
5f0248304e Revert "Remove static calls from incompatible $this context"
This reverts commit dc9991b167.
2015-01-19 15:12:51 +01:00
Xinchen Hui
442efdaaea Optimized is_a 2015-01-19 09:10:01 -05:00
Dmitry Stogov
230bfb1067 Generate better code for comparisons with boolean constants 2015-01-19 17:02:17 +03:00
Dmitry Stogov
eb8d7fe710 old_size is already known 2015-01-19 15:26:04 +03:00
Dmitry Stogov
2efa53649e Optimize code generated for "while" and "for" loops.
Eliminate one JMP opcode for each loop iteration.
2015-01-19 13:27:44 +03:00
Xinchen Hui
b33629f212 Only use explicit ">" in sorting algo 2015-01-19 03:32:28 -05:00
Xinchen Hui
020b51b46e Don't use >= as sorting condition
which could avoid breaking usage like:

usort($a, function($a, $b) { return $a > $b; })
2015-01-19 01:36:56 -05:00
Xinchen Hui
218d83d217 Fixed annoying incompatible pointer type warning 2015-01-18 07:24:57 -05:00
Xinchen Hui
f42d9d6161 Fixed bug #68805 (Double define) 2015-01-17 23:06:37 -05:00
Rasmus Lerdorf
6c9621c937 typo 2015-01-17 11:38:40 -08:00
Andrea Faulds
5f29b98051 Error on invalid octal (fixes PHPSadness #31)
Further error checks
2015-01-17 18:50:28 +00:00
Nikita Popov
83391b5518 Remove for #-style comments in ini files 2015-01-17 18:26:44 +01:00
Nikita Popov
dc9991b167 Remove static calls from incompatible $this context 2015-01-17 18:26:44 +01:00
Dmitry Stogov
b46894d104 Partially revert 3477135cd1 2015-01-16 02:21:27 +03:00
Dmitry Stogov
1c5e914616 Fixed build without alloca() 2015-01-15 21:43:17 +03:00
Dmitry Stogov
12cbb9c156 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  updated NEWS
  updated NEWS
  PDO_MySQL: Differentiate between linux and win32 when passing unix_socket
  bump year
  bump year
  Bump year
2015-01-15 21:09:20 +03:00
Dmitry Stogov
b476c27135 Fixed double free 2015-01-15 21:08:43 +03:00
Dmitry Stogov
3477135cd1 Avoid usage of uninitialized data 2015-01-15 21:08:21 +03:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Dmitry Stogov
34723d1b75 Fixed malloc/emalloc mess 2015-01-15 18:05:58 +03:00
Dmitry Stogov
989daeb5bb Initialize ht->nTableMask 2015-01-15 15:21:38 +03:00
Anatol Belski
1af91d944a optimize offset computation 2015-01-15 11:18:40 +01:00
Anatol Belski
706b7c6e07 don't return value in the void function 2015-01-15 11:18:39 +01:00
Anatol Belski
cdfafd3f38 fix "unknown void * size" err 2015-01-15 11:18:38 +01:00
Xinchen Hui
8a0bc38535 Merge branch 'zend_sort' of https://github.com/laruence/php-src 2015-01-14 22:15:41 -05:00
Dmitry Stogov
90c20b4c24 Fixed typo 2015-01-14 21:09:06 +03:00
Dmitry Stogov
2325758624 Improve "instanceof". Interfaces of the left operand should be checked only if the right operand is interafce itself. 2015-01-14 15:06:26 +03:00
Anatol Belski
d5b5ad72b6 cleanup 2015-01-14 12:32:23 +01:00
Anatol Belski
8e3764e287 fixed zend_hash_init() when the lzcnt instruction isn't supported 2015-01-14 12:32:23 +01:00
Xinchen Hui
2193de0d18 Faster sorting algo 2015-01-14 18:02:41 +08:00
Dmitry Stogov
3e3b006738 Reorder conditions to make "fast paths" shorter 2015-01-13 15:31:42 +03:00
Dmitry Stogov
5a24ac8853 Improved access to object properties (cache property offset instead of pointer to property_info). 2015-01-13 11:33:00 +03:00
Dmitry Stogov
58efbf0a92 Fixed possible double free 2015-01-13 11:32:36 +03:00