Commit Graph

365 Commits

Author SHA1 Message Date
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
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
59593ba66c Fixed #68915 (wrong assertion here) 2015-01-27 15:58:32 +08:00
Andrea Faulds
0be3626ec6 fix build 2015-01-18 19:20:12 +00:00
Xinchen Hui
4b3ae843fc Fixed #68832 (Unchecked return value) 2015-01-17 22:19:25 -05: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
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Xinchen Hui
b5b617674e Micro optimaztion (yeah, I know compiler supposed to do that) 2014-12-22 00:10:46 -05:00
Anatol Belski
e112f6a04e second shot on removing TSRMLS_* 2014-12-14 14:07:59 +01:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Julien Pauli
3cd156d1d9 Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated NEWS
  Updated NEWS
  Fixed #68479 - Added escape parameter to SplFileObject::fputcsv

Conflicts:
	ext/spl/spl_directory.c
2014-12-05 10:18:22 +01:00
Julien Pauli
ee709c5366 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Updated NEWS
  Fixed #68479 - Added escape parameter to SplFileObject::fputcsv
2014-12-05 10:12:08 +01:00
Peter Cowburn
557026301f Fixed #68479 - Added escape parameter to SplFileObject::fputcsv 2014-12-05 10:10:10 +01:00
Tjerk Meesters
52b41f24e3 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed #65213 - cannot cast SplFileInfo to boolean
2014-12-04 07:21:13 +08:00
Tjerk Meesters
2bcf8a6cd9 Fixed #65213 - cannot cast SplFileInfo to boolean 2014-12-04 07:17:33 +08:00
Remi Collet
65ad2aadea cleanup uneeded cast 2014-12-01 19:06:16 +01:00
Julien Pauli
2faf448982 Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated NEWS
  Updated NEWS
  SPL: Fix for bug 66405 RecursiveDirectoryIterator with CURRENT_AS_PATHNAME

Conflicts:
	ext/spl/spl_directory.c
2014-11-29 12:14:37 +01:00
Julien Pauli
a93fb3524e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Updated NEWS
  SPL: Fix for bug 66405 RecursiveDirectoryIterator with CURRENT_AS_PATHNAME
2014-11-29 12:11:06 +01:00
Paul Garvin
605d32bedd SPL: Fix for bug 66405 RecursiveDirectoryIterator with CURRENT_AS_PATHNAME
Currently when you use RecursiveDirectoryIterator with the
CURRENT_AS_PATHNAME flag PHP will throw an UnexpectedValueException with
message 'Objects returned by RecursiveIterator::getChildren() must implement
RecursiveIterator'.This happend because getChildren() will return the
current directory name instead of an Iterator (or subclass of) as required
by the RecursiveIterator interface.

This commit changes getChildren() to return annother
RecursiveDirectoryIterator but current() still returns the path name when
CURRENT_AS_PATHNAME is used. A PHPT test case (bug66405.phpt) that
reproduces the bug is included.

This fix was originally against the PHP-5.4 branch, but it was not merged
before 5.4 reached EOL. I am hoping to get it applied to 5.5, 5.6, and
master.
2014-11-29 12:04:44 +01:00
Anatol Belski
c6116bea57 fix datatype mismatches 2014-10-29 15:30:06 +01:00
Dmitry Stogov
bd9a234645 Replaced EG(This) and EX(object) with EX(This).
Internal functions now recieves zend_execute_data as the first argument.
2014-10-03 19:32:46 +04:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Dmitry Stogov
3bc8a958c5 Fixed useless or duplicated IS_INTERNED() checks 2014-09-19 15:41:01 +04:00
Anatol Belski
fc6f7bfcf3 fix signed/unsigned mismatch 2014-09-16 21:17:25 +02:00
Anatol Belski
bf96ee95ce 's' works with size_t round 4 2014-08-27 20:49:37 +02:00
Anatol Belski
6db8d4f829 's' works with size_t round 3 2014-08-27 20:49:36 +02:00
Anatol Belski
257ed4061a 's' works with size_t round 2 2014-08-27 20:49:33 +02:00
Anatol Belski
3234480827 first show to make 's' work with size_t 2014-08-27 20:49:31 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
70de6180d5 fixes to %pd format usage 2014-08-24 02:35:34 +02:00
Anatol Belski
5d62cf2f7d fix zpp 2014-08-21 15:36:33 +02:00
Anatol Belski
4498f93c0e more fixes to ext/spl 2014-08-20 18:06:01 +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
7301994c28 Merge branch 'master' into phpng
* master: (46 commits)
  PHP_INT_MIN and _MAX tests
  NEWS and UPGRADING
  Added PHP_INT_MIN
  Fix wrong lenght size
  Bug #51096 - Remove unnecessary ? for first/last day of
  Moved streams related functions to xp_ssl.c
  Remove duplicate NEWS
  Update NEWS
  Update NEWS
  Update NEWS
  BFN
  BFN
  Fixed bug #67715 (php-milter does not build and crashes randomly).
  We need to turn off any strict mode here for this warning to show up
  Disable restrictions regarding arrays in constants at run-time. For the discussion around it, see the thread on the mailing list: http://www.mail-archive.com/internals@lists.php.net/msg68245.html
  Revert "Fix bug #67064 in a BC safe way"
  Updated NEWS for #67693
  Updated NEWS for #67693
  Fixed bug #67693 - incorrect push to the empty array
  add missing entry to NEWS
  ...

Conflicts:
	Zend/tests/errmsg_040.phpt
	Zend/tests/ns_059.phpt
	Zend/zend_language_parser.y
	Zend/zend_vm_def.h
	ext/openssl/openssl.c
	ext/reflection/php_reflection.c
	ext/session/session.c
	ext/spl/spl_directory.c
	ext/spl/spl_iterators.c
	ext/sqlite3/sqlite3.c
	ext/standard/array.c
2014-08-04 13:56:27 +04:00
Stanislav Malyshev
47a12117c3 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix SPL objects initialization checks
2014-07-26 19:37:37 -07:00
Stanislav Malyshev
90a0d58af8 Fix SPL objects initialization checks 2014-07-26 18:59:16 -07:00
Xinchen Hui
d196ac6a48 Merge branch 'PHP-5.6' 2014-06-01 19:42:53 +08:00
Xinchen Hui
c4e7c7d50e Merge branch 'PHP-5.5' into PHP-5.6 2014-06-01 19:42:20 +08:00
Xinchen Hui
9bb5867fad Merge branch 'PHP-5.4' into PHP-5.5 2014-06-01 19:41:35 +08:00
Xinchen Hui
38be99b739 Fixed bug #67359 (Segfault in recursiveDirectoryIterator) 2014-06-01 19:41:01 +08:00
Dmitry Stogov
9eb89dddb1 Use optimized zend_array_dup() function. convert zend_hash_num_elements() and zend_hash_next_free_element() into macros. 2014-05-23 20:37:53 +04:00
Nikita Popov
9f9ee0186e Fix memory error in spl_directory.c 2014-05-12 21:35:39 +02:00
Nikita Popov
8904f72d7c Fix spl_directory cast_object, reenable error 2014-05-12 20:44:30 +02:00
Xinchen Hui
d8651fbe1c Make they are in the same style of Z_ISREF 2014-05-03 16:08:58 +08:00
Dmitry Stogov
17d027ed47 Split IS_BOOL into IS_FALSE and IS_TRUE 2014-04-30 18:32:42 +04:00
Dmitry Stogov
f9927a6c97 Merge mainstream 'master' branch into refactoring
During merge I had to revert:
	Nikita's patch for php_splice() (it probably needs to be applyed again)
	Bob Weinand's patches related to constant expression handling (we need to review them carefully)
	I also reverted all our attempts to support sapi/phpdbg (we didn't test it anyway)

Conflicts:
	Zend/zend.h
	Zend/zend_API.c
	Zend/zend_ast.c
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_constants.c
	Zend/zend_exceptions.c
	Zend/zend_execute.c
	Zend/zend_execute.h
	Zend/zend_execute_API.c
	Zend/zend_hash.c
	Zend/zend_highlight.c
	Zend/zend_language_parser.y
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner_defs.h
	Zend/zend_variables.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/date/php_date.c
	ext/dom/documenttype.c
	ext/hash/hash.c
	ext/iconv/iconv.c
	ext/mbstring/tests/zend_multibyte-10.phpt
	ext/mbstring/tests/zend_multibyte-11.phpt
	ext/mbstring/tests/zend_multibyte-12.phpt
	ext/mysql/php_mysql.c
	ext/mysqli/mysqli.c
	ext/mysqlnd/mysqlnd_reverse_api.c
	ext/mysqlnd/php_mysqlnd.c
	ext/opcache/ZendAccelerator.c
	ext/opcache/zend_accelerator_util_funcs.c
	ext/opcache/zend_persist.c
	ext/opcache/zend_persist_calc.c
	ext/pcre/php_pcre.c
	ext/pdo/pdo_dbh.c
	ext/pdo/pdo_stmt.c
	ext/pdo_pgsql/pgsql_driver.c
	ext/pgsql/pgsql.c
	ext/reflection/php_reflection.c
	ext/session/session.c
	ext/spl/spl_array.c
	ext/spl/spl_observer.c
	ext/standard/array.c
	ext/standard/basic_functions.c
	ext/standard/html.c
	ext/standard/mail.c
	ext/standard/php_array.h
	ext/standard/proc_open.c
	ext/standard/streamsfuncs.c
	ext/standard/user_filters.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	main/php_variables.c
	sapi/phpdbg/phpdbg.c
	sapi/phpdbg/phpdbg_bp.c
	sapi/phpdbg/phpdbg_frame.c
	sapi/phpdbg/phpdbg_help.c
	sapi/phpdbg/phpdbg_list.c
	sapi/phpdbg/phpdbg_print.c
	sapi/phpdbg/phpdbg_prompt.c
2014-04-26 00:32:51 +04:00
Dmitry Stogov
e96073b1e4 Moved zend_literal->cache_slot right into zval.
It should be accessed using Z_CACHE_SLOT() macro.
zend_literal structure is removed.
API functions that accepted pointer to zend_literal now accept pointer to zval or cache_slot directly.
Calls of such functiond that now accept cache_slot need to be changed to pass -1 instead of NULL.
2014-04-17 15:40:45 +04:00
Dmitry Stogov
050d7e38ad Cleanup (1-st round) 2014-04-15 15:40:40 +04:00
Nikita Popov
20f2e5986e Fix ZTS build
This only makes it compile, it doesn't actually work, presumably
because interned strings are assumed in some places.
2014-04-09 23:41:16 +02: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
ea85451b65 Refactored data structures to keep zend_object* instead of a whole zval in some places 2014-03-28 02:11:22 +04:00
Dmitry Stogov
b7938ab1bd Refactored GC (incomplete) 2014-03-19 17:00:28 +04:00
Xinchen Hui
b78bbe93ca Fixed segfault (invalid free handling) 2014-03-16 22:05:38 +08:00
Xinchen Hui
b264e96497 Fixed bug codes in SplFileInfo::getExtension 2014-03-15 22:17:55 +08:00
Xinchen Hui
9d4dca0880 Refactor Spl_Directory to fixed bug after default_properties changed 2014-03-15 22:07:40 +08:00
Tjerk Meesters
777831a24b Merge branch 'PHP-5.6' 2014-03-07 19:24:50 +08:00
Tjerk Meesters
8d3f4b647b Merge branch 'PHP-5.5' into PHP-5.6 2014-03-07 19:24:02 +08:00
Tjerk Meesters
972935cd95 Fixed null termination 2014-03-07 19:23:46 +08:00
Tjerk Meesters
7137775ec2 Merge branch 'PHP-5.6' 2014-03-07 19:01:53 +08:00
Tjerk Meesters
64906cdc38 Merge branch 'PHP-5.5' into PHP-5.6 2014-03-07 18:57:36 +08:00
datibbaw
3c673fed34 Add fread(length) method
Fixed off-by-one write bug

Added test
2014-03-07 18:50:33 +08:00
Dmitry Stogov
19670c2bbc Fixied calling object closures from internal functions 2014-03-05 01:54:21 +04:00
Xinchen Hui
237dbd972e Fixed uninilized intern 2014-02-28 22:55:59 +08:00
Xinchen Hui
2a82660923 Temporary fix zcontext 2014-02-28 22:21:51 +08:00
Xinchen Hui
990c923ef4 Refactored spl_filesystem_iterator 2014-02-28 19:07:54 +08:00
Xinchen Hui
b353d5abe9 Fixed un-initilized iterator in DirectoyItrator 2014-02-28 16:06:47 +08:00
Xinchen Hui
1265850fef Add zend_iterator_dtor 2014-02-28 15:03:43 +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
Xinchen Hui
382b0dfdb7 Refactoring zend_iterator (incompleted) 2014-02-27 19:19:02 +08:00
Xinchen Hui
c0aba2c641 Refactor basename using zend_string 2014-02-23 18:08:35 +08:00
Dmitry Stogov
2b9b9afa7a Use better data structures (incomplete) 2014-02-17 17:59:18 +04:00
Xinchen Hui
ad1838d248 Use better data structures (incomplete) 2014-02-16 22:27:31 +08:00
Xinchen Hui
34aefa5604 Use better data structures (incomplete) 2014-02-15 23:21:09 +08:00
Xinchen Hui
6cb316cf5d Use better data structures (incomplete) 2014-02-14 23:11:40 +08:00
Dmitry Stogov
f4cfaf36e2 Use better data structures (incomplete) 2014-02-10 10:04:30 +04: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
Nikita Popov
0d7a638866 Implement variadic function syntax
As per RFC: https://wiki.php.net/rfc/variadics
2013-09-26 18:39:17 +02:00
Nikita Popov
ad976d8240 Fix bug #64782: SplFileObject constructor make $context optional 2013-09-12 17:46:14 +02:00
Xinchen Hui
c2cfc242c4 Merge branch 'PHP-5.4' into PHP-5.5 2013-06-27 12:38:13 +08:00
Xinchen Hui
fa8611c81e Fixed bug #65136 (RecursiveDirectoryIterator segfault) 2013-06-27 12:37:57 +08:00
Xinchen Hui
9d9ec2a90e Merge branch 'PHP-5.4' into PHP-5.5 2013-06-25 13:38:50 +08:00
Xinchen Hui
38eb909d06 Fixed Bug #61828 (Memleak when calling Directory(Recursive)Iterator/Spl(Temp)FileObject ctor twice) 2013-06-25 13:38:27 +08: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
Gustavo Lopes
b8b3bb08b2 Merge branch 'bug64023' into PHP-5.4
* bug64023:
  Fix bug #64023 (__toString() & SplFileInfo)

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-01-22 12:24:33 +01:00
Gustavo Lopes
aa0adce47d Fix bug #64023 (__toString() & SplFileInfo)
Defining a __toString() method was having no effect when concatenating
the object. This was because the cast_object() handler would ignore
__toString().

Using echo() directly would actually use __toString(), but this was a
bug: the ECHO handler would try zend_std_cast_object_tostring() before
cast_object(), but cast_object() should have priority as
zend_std_cast_object_tostring() assumes an object with a
zend_class_entry.
2013-01-22 11:33:29 +01: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
Xinchen Hui
6284ef112e Fixed bug #63236 (Executable permission on various source files) 2012-10-09 13:28:31 +08:00
Xinchen Hui
e4a8fa6a15 Merge branch 'PHP-5.3' into PHP-5.4 2012-10-09 13:29:51 +08:00
Felipe Pena
2497bb97e7 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  - Value stored to var is never used
2012-08-19 12:55:43 -03:00