Commit Graph

222 Commits

Author SHA1 Message Date
Dmitry Stogov
f2b4ec4bdc Export standard object handlers, to avoid indirect access 2018-05-31 11:57:22 +03:00
Dmitry Stogov
d90c6f2443 Removed useless zval_ptr_dtor() 2018-05-29 17:58:06 +03:00
Gabriel Caruso
701437a948
Remove return types from some magic method in protos
__construct, __destruct, __wakeup does not have return types defined.
2018-03-09 12:04:46 +01:00
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
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Dmitry Stogov
1db8402208 Move zend_object_iterator_funcs structures into read-only data segment 2017-12-14 14:21:22 +03:00
Nikita Popov
b72b1a4e4d Add zend_object_alloc() API
Using ecalloc() to create objects is expensive, because the
dynamic-size memset() is unreasonably slow. Make sure we only
zero the main object structure with known size, as the properties
are intialized separately anyway.

Technically we do not need to zero the embedded zend_object
structure either, but as long as the memset argument is constant,
a couple more bytes don't really matter.
2017-11-25 17:12:37 +01:00
Xinchen Hui
d56a534acc RC manipulation cleanup 2 2017-11-02 12:13:35 +08:00
Dmitry Stogov
9cf87aa196 Avoid HashTable allocations for empty arrays (using zend_empty_array). 2017-10-24 17:27:31 +03:00
Nikita Popov
e7a7065024 Merge branch 'PHP-7.0' into PHP-7.1 2017-05-24 18:02:13 +02:00
jhdxr
872e43d6e5 Fixed bug #74478 2017-05-24 18:01:41 +02:00
Nikita Popov
e3f411c9f7 Merge branch 'PHP-7.0' into PHP-7.1 2017-05-01 12:15:41 +02:00
Nikita Popov
1967950dc3 Fix typo in SplFixedArray has_dimension implementation 2017-05-01 12:15:26 +02:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Nikita Popov
1903fc6298 Fix SplFixedArray::offsetGet() invocation for NULL offset 2016-10-15 23:58:28 +02:00
Levi Morrison
9b6d7f5701 Remove extra pointer in SplFixedArray 2016-08-11 18:25:56 +02:00
Dmitry Stogov
323b2733f6 Fixed compilation warnings 2016-06-22 00:40:50 +03:00
Joe Watkins
e27a43b7be variable used out of scope 2016-04-28 15:40:28 +01:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Dmitry Stogov
53403fe56d Get rid of ZVAL_ZVAL() macro usages. Replace them with more clear and optimal equialent sequences. 2015-07-01 02:05:21 +03:00
Nikita Popov
e10be0d0fd Remove unnecessary retval members in SPL
This is what the rv params are for. Avoid holding onto values
longer than necessary.
2015-04-15 20:39:08 +02:00
Nikita Popov
122d759618 Always throw TypeException on throwing zpp failures
Introduces a ZEND_PARSE_PARAMS_THROW flag for zpp, which forces to
report FAILURE errors using a TypeException instead of a Warning,
like it would happen in strict mode.

Adds a zend_parse_parameters_throw() convenience function, which
invokes zpp with this flag.

Converts all cases I could identify, where we currently have
throwing zpp usage in constructors and replaces them with this API.
Error handling is still replaced to EH_THROW in some cases to handle
other, domain-specific errors in constructors.
2015-04-06 11:27:34 +02:00
Danack
910a324306 Fixed indentation. Fixed comment style. Fixed commented out code. 2015-03-16 23:14:56 +00:00
Danack
c57bde7c9e Fixed SplFixedArray and tests. 2015-03-01 13:44:55 +00: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
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
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski
e888f3e4de fix datatype mismatches 2014-10-29 15:30:08 +01:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Anatol Belski
af59e92b24 master renames phase 7 2014-08-25 21:51:49 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
a5ffd245bd fixed splfixedarray 2014-08-18 19:55:05 +02:00
Anatol Belski
90d6f60bc1 mostly fixes to spl, but also some other 2014-08-17 13:31:39 +02:00
Anatol Belski
cb25136f4e fix macros in the 5 basic extensions 2014-08-16 11:37:14 +02:00
Dmitry Stogov
c1965f58d4 Use reference counting instead of zval duplication 2014-06-05 16:04:11 +04:00
Xinchen Hui
82a4897446 Use new iterator macros 2014-05-19 10:55:09 +08:00
Dmitry Stogov
7fcd4064c0 Merge branch 'master' into phpng
* master: (41 commits)
  fix test - output can be chunked
  fix test
  fix test
  Fixed test for commit 997be125eb
  Add bug fix to NEWS
  Update UPGRADING according to bug fix
  fix test
  improve CURL tests to allow testing without separate server
  improve CURL tests to allow testing without separate server
  Fixed bug #67199	mb_regex_encoding mishmash
  Fix bug #67248 (imageaffinematrixget missing check of parameters)
  Fix bug #67247	spl_fixedarray_resize integer overflow
  fix news
  add tests stuff to README
  Updated NEWS
  Fix Linux specific fail in error traces (cherry-picked and fix for bug #67245) Linux apparently does not like memcpy in overlapping regions...
  - Fixed off-by-one in phar_build (patch by crrodriguez at opensuse dot org)
  - Move checking
  - Fixed missing NULL check in SimpleXMLElement::xpath()
  - Fixed missing NULL check
  ...

Conflicts:
	ext/bz2/bz2.c
	ext/gd/gd.c
	ext/mbstring/php_mbregex.c
	ext/session/tests/031.phpt
	ext/simplexml/simplexml.c
	ext/spl/spl_fixedarray.c
2014-05-13 15:24:40 +04:00
Stanislav Malyshev
eaa39c9388 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #67248 (imageaffinematrixget missing check of parameters)
  Fix bug #67247	spl_fixedarray_resize integer overflow
  fix news
  add tests stuff to README
  Updated NEWS
  Fix Linux specific fail in error traces (cherry-picked and fix for bug #67245) Linux apparently does not like memcpy in overlapping regions...
2014-05-11 18:57:39 -07:00
Stanislav Malyshev
f2fdeba19d Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #67248 (imageaffinematrixget missing check of parameters)
  Fix bug #67247	spl_fixedarray_resize integer overflow
  fix news
  add tests stuff to README
  Updated NEWS
  Fix Linux specific fail in error traces (cherry-picked and fix for bug #67245) Linux apparently does not like memcpy in overlapping regions...
2014-05-11 18:56:32 -07:00
Stanislav Malyshev
af5cc61cf3 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #67247	spl_fixedarray_resize integer overflow
  fix news
2014-05-11 18:16:19 -07:00
Stanislav Malyshev
2b475eebbe Fix bug #67247 spl_fixedarray_resize integer overflow 2014-05-11 17:54:27 -07:00
Xinchen Hui
d8651fbe1c Make they are in the same style of Z_ISREF 2014-05-03 16:08:58 +08:00
Dmitry Stogov
7402af380b Fixed destruction of objects and iterators on unclean request shutdown and GC (few cases are still unfixed).
Now we destroy objects it two steps. At first - object properties of all objects and only then the objects their selves.
2014-04-09 01:50:15 +04:00
Dmitry Stogov
76cc99fe60 Refactored ZVAL flags usage to simplify various checks (e.g. Z_REFCOUNTED(), candidate for GC, etc) 2014-04-03 15:26:23 +04:00
Dmitry Stogov
b7938ab1bd Refactored GC (incomplete) 2014-03-19 17:00:28 +04:00
Xinchen Hui
d0bbc227aa IS_UNDEF should never goes to user script land 2014-03-15 22:37:27 +08:00
Xinchen Hui
bfe1f224b2 Fixed fixed_array returning initializing 2014-03-15 13:20:23 +08:00
Xinchen Hui
28e0a58018 Fixed fixedarray iterator fetching 2014-03-15 13:18:32 +08:00
Xinchen Hui
b2432872c4 Fixed fixed_array fetching 2014-03-15 13:12:55 +08:00
Xinchen Hui
350260624d Fixing SplFixedArray (this probably will be revert, just show what the problem is) 2014-03-08 19:03:38 +08:00
Xinchen Hui
0680cdb4ac Fixed refcount handling 2014-02-28 22:47:24 +08:00
Xinchen Hui
0def388427 Fixed Z_ADDREF 2014-02-28 15:29:00 +08:00
Xinchen Hui
a5ce7d526e Revert "Move zend_objects_store_put out of zend_object_std_init"
This reverts commit 8ced4f0ac9.
2014-02-28 13:59:07 +08:00
Xinchen Hui
8ced4f0ac9 Move zend_objects_store_put out of zend_object_std_init 2014-02-28 12:59:51 +08:00
Xinchen Hui
0817cee164 Fixed object creating (std_init calls store_put now) 2014-02-27 22:47:30 +08:00
Dmitry Stogov
3696e038e5 Various fixes related to read_property(), read_dimension() and iterators refactoring 2014-02-27 16:07:36 +04:00
Xinchen Hui
382b0dfdb7 Refactoring zend_iterator (incompleted) 2014-02-27 19:19:02 +08:00
Dmitry Stogov
495551aa8c Fixed iterators API. zend_iterator_init() has to be used in each get_iterator() callback. 2014-02-26 15:01:08 +04:00
Xinchen Hui
ad1838d248 Use better data structures (incomplete) 2014-02-16 22:27:31 +08:00
Xinchen Hui
f0168baecf Use better data structures (incomplete) 2014-02-16 22:15:54 +08:00
Xinchen Hui
0f53e37494 Merge branch 'PHP-5.6' 2014-01-03 11:09:07 +08:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui
47c9027772 Bump year 2014-01-03 11:06:16 +08:00
Xinchen Hui
c0d060f5c0 Bump year 2014-01-03 11:04:26 +08:00
Kalle Sommer Nielsen
d14670ccdb Eliminate another TSRMLS_FETCH() in i_zend_is_true()
# Affected extensions have all been updated, ext/opcache and ext/zip
# both have macros for cross version compatibility
2013-12-18 07:25:05 +01:00
Levi Morrison
7f3b5b77cc Standardized usage of zpp_none and the order of the comparison zpp(...) == FAILURE 2013-10-11 10:32:40 -06:00
Adam Harvey
3becd3879f Add a __wakeup() method to SplFixedArray, thereby fixing serialising an
SplFixedArray object and bug #60560 (SplFixedArray un-/serialize, getSize(),
count() return 0, keys are strings).
2013-06-28 13:50:33 -07:00
Nikita Popov
fcc6611de9 Add support for non-scalar Iterator keys in foreach
RFC: https://wiki.php.net/rfc/foreach-non-scalar-keys
2013-03-12 17:27:31 +01:00
Xinchen Hui
e75804c34e Merge branch 'PHP-5.4' into PHP-5.5 2013-02-24 12:59:10 +08:00
Xinchen Hui
d24ac6953e Merge branch 'PHP-5.3' into PHP-5.4
Conflicts:
	ext/spl/spl_fixedarray.c
2013-02-24 12:58:39 +08:00
Xinchen Hui
1b58bd39a6 Fixed bug #64264 (SPLFixedArray toArray problem) 2013-02-24 12:55:53 +08:00
Nikita Popov
f540e086e2 Fixed bug #64106: Segfault on SplFixedArray[][x] = y when extended 2013-01-30 20:40:02 +01:00
Nikita Popov
bb4d11b405 Merge branch 'PHP-5.3' into PHP-5.4 2013-01-30 20:25:59 +01:00
Nikita Popov
321f4f18e5 Fixed bug #64106: Segfault on SplFixedArray[][x] = y when extended 2013-01-30 20:23:39 +01:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Xinchen Hui
0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Xinchen Hui
a2045ff332 Happy New Year~ 2013-01-01 16:02:16 +08:00
Dmitry Stogov
274ceb3d8d Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #63680 (Memleak in splfixedarray with cycle reference)

Conflicts:
	NEWS
2012-12-05 17:55:21 +04:00
Dmitry Stogov
881416cda6 Fixed bug #63680 (Memleak in splfixedarray with cycle reference) 2012-12-05 17:53:26 +04:00
Xinchen Hui
a3d701e11c Merge branch 'PHP-5.4' 2012-08-23 23:28:24 +08:00
Xinchen Hui
13bcf685cb Fixed bug #62904 (Crash when cloning an object which inherits SplFixedArray) 2012-08-23 23:27:16 +08:00
Xinchen Hui
42f91d6ac6 Fixed bug #62904 (Crash when cloning an object which inherits SplFixedArray) 2012-08-23 23:21:25 +08:00
Johannes Schlüter
b025b9d0cf Fix #62432 ReflectionMethod random corrupt memory on high concurrent
This fixes the same issue in multiple extensions. This isn't needed
in later branches as 5.4 introduced object_properties_init()
2012-06-27 23:26:33 +02:00
Adam Harvey
37272e46de Add a __wakeup() method to SplFixedArray, thereby fixing serialising an
SplFixedArray object and bug #60560 (SplFixedArray un-/serialize, getSize(),
count() return 0, keys are strings).
2012-02-21 10:34:42 +00:00
Felipe Pena
e4ca0ed09f - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Etienne Kneuss
81700b8b2f Fix CID 1211, unused intern variable 2011-08-12 21:46:40 +00:00
Etienne Kneuss
32e67db84c Fix CID 1211, unused intern variable 2011-08-12 21:46:40 +00:00
Felipe Pena
23e438594d - Make usage of new PHP_FE_END macro 2011-07-25 11:42:53 +00:00
Felipe Pena
4b30846b50 - Make usage of new PHP_FE_END macro 2011-07-25 11:35:02 +00:00
Felipe Pena
da376383e8 - Make usage of new PHP_FE_END macro 2011-07-25 11:35:02 +00:00
Felipe Pena
0afd4bd18b - Possible fix for bug #54609 (Certain implementation(s) of SplFixedArray cause hard crash) 2011-06-05 01:38:12 +00:00
Felipe Pena
f57cbfcaa1 - Possible fix for bug #54609 (Certain implementation(s) of SplFixedArray cause hard crash) 2011-06-05 01:38:12 +00:00
Felipe Pena
a2124382ac - Possible fix for bug #54609 (Certain implementation(s) of SplFixedArray cause hard crash) 2011-06-05 01:38:12 +00:00
Felipe Pena
47315dfdf6 - Fixed bug #54970 (SplFixedArray::setSize() isn't resizing) 2011-06-02 00:40:27 +00:00
Felipe Pena
767f924665 - Fixed bug #54970 (SplFixedArray::setSize() isn't resizing) 2011-06-02 00:40:27 +00:00
Felipe Pena
df4c4a9e7f - Fixed bug #54970 (SplFixedArray::setSize() isn't resizing) 2011-06-02 00:40:27 +00:00
Felipe Pena
927bf09c29 - Year++ 2011-01-01 02:19:59 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Felipe Pena
9608da9443 - Fixed bug #53362 (Segmentation fault when extending SplFixedArray) 2010-11-19 20:07:32 +00:00
Felipe Pena
f16059d697 - Fixed bug #53362 (Segmentation fault when extending SplFixedArray) 2010-11-19 20:07:32 +00:00
Felipe Pena
904b9282fe - Fixed bug #50481 (Storing many SPLFixedArray in an array crashes) 2010-08-08 23:56:29 +00:00
Felipe Pena
84bc1c8593 - Fixed bug #50481 (Storing many SPLFixedArray in an array crashes) 2010-08-08 23:56:29 +00:00
Dmitry Stogov
c5237d82bf Added caches to eliminate repeatable run-time bindings of functions, classes, constants, methods and properties 2010-05-24 14:11:39 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Felipe Pena
fc4e43ec3c MFH:
- Added missing methods' arginfo (for void params)
- Fixed arginfos:
  - MultipleIterator::__construct
  - MultipleIterator::setFlags      (Thanks Philip!)
  - SplFixedArray::__construct
2009-07-04 20:31:27 +00:00
Felipe Pena
941ac63eef - MFH: Added missing param checks 2009-05-23 15:14:15 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Felipe Pena
fc2fb50d09 - MFH: Added 'static' into ZEND_BEGIN_ARG_INFO_EX macro 2008-11-17 11:28:01 +00:00
Felipe Pena
7a37fa2d6b - Revert ZEND_BEGIN_ARG_INFO change 2008-11-02 21:19:39 +00:00
Felipe Pena
df10005563 - MFH: Added 'static' into ZEND_BEGIN_ARG_INFO_EX macro 2008-10-24 14:35:40 +00:00
Etienne Kneuss
6f289c582b MFH: Iterator methods overwriting optimisations 2008-07-20 17:32:10 +00:00
Antony Dovgal
cd408f1235 MFH: minor speedup - convert offset to long only when needed 2008-07-14 08:09:09 +00:00
Etienne Kneuss
f60da35554 MFH: Implement toArray,fromArray and get_properties (Thanks Tony for the patches) 2008-07-13 15:59:52 +00:00
Etienne Kneuss
0eea0a059e MFH: First part of count/handlers related fixes 2008-07-06 23:45:56 +00:00
Etienne Kneuss
0f5ddaf4ce MFH: Rename everything from SplFastArray to SplFixedArray 2008-06-18 14:54:40 +00:00