Compare commits

...
3849 Commits
Author SHA1 Message Date
Anatol Belski af59e92b24 master renames phase 7 2014-08-25 21:51:49 +02:00
Anatol Belski b9514bb8fd master renames phase 6 2014-08-25 21:26:42 +02:00
Anatol Belski 28b7a03318 master renamings phase 5 2014-08-25 21:20:44 +02:00
Anatol Belski 455741fce3 master renames phase 4 2014-08-25 20:57:25 +02:00
Anatol Belski 5410282258 Merge branch 'master' of git.php.net:php-src
# By Daniel Lowrey
# Via Daniel Lowrey
* 'master' of git.php.net:php-src:
  Update NEWS
  Bug #67850: Build when OpenSSL compiled without SSLv3 support
2014-08-25 20:23:14 +02:00
Anatol Belski 4d997f63d9 master renames phase 3 2014-08-25 20:22:49 +02:00
Daniel Lowrey 3dd5366b15 Merge branch 'PHP-5.6'
* PHP-5.6:
  Update NEWS
2014-08-25 19:51:03 +02:00
Daniel Lowrey cc487e6cdf Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug #67850: Build when OpenSSL compiled without SSLv3 support
2014-08-25 19:35:01 +02:00
Anatol Belski 6f9f0bf205 master renames phase 2 2014-08-25 19:28:33 +02:00
Anatol Belski c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Lior Kaplan 0cf2dbdf58 Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug #67730: Add tests by Ryan Mauger <ryan@rmauger.co.uk>
2014-08-25 00:31:10 +03:00
Anatol Belski 80a3b9ca40 bring back the logic to parse 64 bit props also in 32 bit build 2014-08-24 11:48:57 +02:00
Anatol Belski b2d123f985 fix a phrase 2014-08-24 02:57:19 +02:00
Anatol Belski 9ac656cc20 Merge branch 'master' of git.php.net:php-src
# By Ferenc Kovacs
# Via Ferenc Kovacs
* 'master' of git.php.net:php-src:
  this test depends on the simplexml ext, not just on xml
2014-08-24 02:55:01 +02:00
Anatol Belski 3c17ce9e0f note on %pd format 2014-08-24 02:36:17 +02:00
Anatol Belski 70de6180d5 fixes to %pd format usage 2014-08-24 02:35:34 +02:00
Ferenc Kovacs 50b20e75ff Merge branch 'PHP-5.6'
* PHP-5.6:
  this test depends on the simplexml ext, not just on xml

Conflicts:
	ext/simplexml/tests/bug62328.phpt
2014-08-24 00:18:51 +02:00
Tjerk Meesters 86674b5837 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed #67694: Regression in session_regenerate_id()

Conflicts:
	ext/session/session.c
2014-08-23 09:21:36 +08:00
Tjerk Meesters d1d0f55e22 Use %d instead of object id 2014-08-23 08:09:08 +08:00
Tjerk Meesters 32e8d0f03e Fixed test case based on var_dump() changes made in c1965f58d4 2014-08-23 08:06:47 +08:00
krakjoe 3f4811c76e fix wrong type causing build error 2014-08-22 18:30:13 +01:00
Anatol Belski 4ff697b6b1 adedd note on portable numeric macros 2014-08-22 13:48:20 +02:00
Anatol Belski 4c56e68b7f note on LFS macros 2014-08-22 13:40:45 +02:00
Anatol Belski fa6fe06a86 updated UPGRADING so far 2014-08-22 13:35:07 +02:00
Anatol Belski 24cf50d2df note on hash table and sprintf 2014-08-22 13:22:49 +02:00
Anatol Belski c893552a9a note on zpp specs 2014-08-22 10:31:48 +02:00
Anatol Belski 612e459041 updated UPGRADING.INTERNALS with new data types 2014-08-22 10:24:51 +02:00
Anatol Belski 79f888a602 Merge remote-tracking branch 'weltling/master'
* weltling/master: (725 commits)
  fix zpp
  fixed array_pad()
  fix zpp
  fix zpp
  fix zpp
  fix zpp and a bit more
  fix zpp
  fix zpp
  fix zpp
  fix zpp
  fix zpp
  fix zpp
  fix zpp
  fix zpp
  fix zpp
  fix zpp
  fix zpp
  fix zpp
  fix zpp
  fixed the test
  ...
2014-08-22 08:58:03 +02:00
Xinchen Hui da35db3ec5 Fixed complier error 2014-08-22 10:20:44 +08:00
Michael Wallner 7fca659a7b Merge branch 'PHP-5.6'
* PHP-5.6:
  fix bug #67865
  updated NEWS to fit last release
  NEWS
  Fix bug #67878 program_prefix not honoured in man pages
  NEWS
  Fix bug #67878 program_prefix not honoured in man pages
2014-08-21 22:46:03 +02:00
Anatol Belski 411b920a6f fix zpp 2014-08-21 22:20:42 +02:00
Anatol Belski 9d760498c1 fixed array_pad() 2014-08-21 22:13:22 +02:00
Anatol Belski 96a570cb03 fix zpp 2014-08-21 20:32:39 +02:00
Anatol Belski 4a85ec874a fix zpp 2014-08-21 20:31:32 +02:00
Anatol Belski fdfe8ac36e fix zpp 2014-08-21 20:25:31 +02:00
Anatol Belski 7815d23e9e fix zpp and a bit more 2014-08-21 20:22:18 +02:00
Anatol Belski 3cb5c6e692 fix zpp 2014-08-21 20:13:55 +02:00
Anatol Belski 7de2259818 fix zpp 2014-08-21 17:59:28 +02:00
Anatol Belski 21a45d9aca Merge remote-tracking branch 'php/master' 2014-08-21 15:55:56 +02:00
Anatol Belski c1b65ac66b fix zpp 2014-08-21 15:54:47 +02:00
Anatol Belski 5eef3a9eed fix zpp 2014-08-21 15:51:09 +02:00
Anatol Belski ff853d2fe0 fix zpp 2014-08-21 15:47:52 +02:00
Anatol Belski b315af1d9f fix zpp 2014-08-21 15:44:23 +02:00
Anatol Belski 113e3c1eeb fix zpp 2014-08-21 15:42:48 +02:00
Anatol Belski 0e546cecd6 fix zpp 2014-08-21 15:40:24 +02:00
Anatol Belski fb8c41101d fix zpp 2014-08-21 15:39:29 +02:00
Anatol Belski 5d62cf2f7d fix zpp 2014-08-21 15:36:33 +02:00
Anatol Belski daa0f094cf fix zpp 2014-08-21 15:32:17 +02:00
Dmitry Stogov b9a5db2b55 Fixed incorrect string length 2014-08-21 17:30:34 +04:00
Anatol Belski f7c8213741 fix zpp 2014-08-21 15:25:39 +02:00
Anatol Belski 8b2f1ac177 fix zpp 2014-08-21 15:23:05 +02:00
Anatol Belski 8e94fbfc6a Merge remote-tracking branch 'php/master' 2014-08-21 14:38:43 +02:00
Dmitry Stogov 455bcc4182 Fixed test. It's not a problem to perform/continue replacing if the source "$search" string was modified by callback, because the source string is duplicate in this case. 2014-08-21 16:21:13 +04:00
Dmitry Stogov b0a54673f4 Fixed wrong test. Value of the static property must not be changed to string. 2014-08-21 16:15:01 +04:00
Anatol Belski 7ef536e4c9 Merge remote-tracking branch 'php/master'
Conflicts:
	Zend/zend_exceptions.c
2014-08-21 13:54:15 +02:00
Anatol Belski 79b2852da4 fixed the test
the cause for this to fail now was that _php_iconv_strpos had int for
the offset, but the int from userland is 64 bit, that was an overflow
cusing wrong behaviour
2014-08-21 13:49:09 +02:00
Dmitry Stogov 16b4d90fa9 Separate values before conversion 2014-08-21 14:30:52 +04:00
Anatol Belski 307dac3cfd Merge branch 'master' of github.com:weltling/php-src 2014-08-21 12:18:31 +02:00
Anatol Belski 6bea54b7b9 fixed mem leak 2014-08-21 12:18:08 +02:00
Anatol Belski 98bb620bfe fixed memory leak 2014-08-21 12:13:52 +02:00
krakjoe cbc7b8e67c remove bogus locale use from test 2014-08-21 10:03:48 +01:00
krakjoe e530817209 fix the version requirements for these tests 2014-08-21 09:29:43 +01:00
krakjoe 25cc882425 correct version number requirements for this test 2014-08-21 09:22:05 +01:00
krakjoe 1ba509ce19 use a suitable number of patterns to show the bug is resolved, not a stupid number that could cause memory limit to be exceeded or other side effects 2014-08-21 09:14:46 +01:00
krakjoe 051671ba6c Merge branch 'master' of https://github.com/php/php-src 2014-08-21 09:09:00 +01:00
krakjoe b83e45e1ef only run this test if SimpleXML is loaded 2014-08-21 09:08:28 +01:00
Dmitry Stogov e9439f62e5 Avoid reallocation and copying 2014-08-21 12:02:48 +04:00
Anatol Belski eb1871b3fb yet trivial fixes to mysql exts 2014-08-21 09:54:40 +02:00
Anatol Belski 8d6ef99a39 Merge remote-tracking branch 'php/master' 2014-08-21 09:21:31 +02:00
Dmitry Stogov 92ac625b94 Fixed incorrect string length comparison 2014-08-21 11:17:24 +04:00
Dmitry Stogov 887c12da77 dtor handler must be set 2014-08-21 11:17:05 +04:00
Remi Collet dde4d2e628 Fix bug #67878 program_prefix not honoured in man pages
- add @program_prefix@ in php, phpize and php-config man pages
- set date to 2014
- fix "SEE ALSO" alignment
2014-08-21 09:13:12 +02:00
Anatol Belski 333f093010 Merge branch 'PHP-5.6'
* PHP-5.6:
  avoid clash when stdint.h was included after win32/php_stdint.h
2014-08-21 09:09:47 +02:00
Anatol Belski d15360c1dd Merge remote-tracking branch 'php/master' 2014-08-21 08:39:46 +02:00
Dmitry Stogov 4c6fb62702 Fixed get_resources() prototype comments 2014-08-21 09:49:35 +04:00
Anatol Belski c80c0174ea Merge branch 'master' of github.com:weltling/php-src 2014-08-21 00:21:38 +02:00
Anatol Belski 4c2330c1e8 make g++ see all the stdint.h stuff 2014-08-20 15:26:53 -07:00
Stanislav Malyshev 3a97ed4bb2 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test
2014-08-20 14:44:40 -07:00
Stanislav Malyshev 557a6d8c6f Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test
2014-08-20 14:44:02 -07:00
Anatol Belski cd18b5884b Merge remote-tracking branch 'php/master' 2014-08-20 23:27:26 +02:00
Anatol Belski 888ef26cc5 yet trivial fixes 2014-08-20 22:54:00 +02:00
Anatol Belski 6d54e89916 Merge remote-tracking branch 'php/master' 2014-08-20 21:29:49 +02:00
Dmitry Stogov 6b5b5094d3 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  fix directory separator in test
2014-08-20 23:29:21 +04:00
Anatol Belski b3198b6845 more fixes to ext/iconv 2014-08-20 21:29:04 +02:00
Dmitry Stogov 8cda420ff4 Fixed ext/pdo_*/tests/pdo_005.phpt tests failure 2014-08-20 23:28:32 +04:00
Anatol Belski 4b337a898b fix directory separator in test 2014-08-20 21:27:39 +02:00
Dmitry Stogov cf09bc7825 Fixed bug #67874 (Crash in array_map()) 2014-08-20 22:06:15 +04:00
Dmitry Stogov 9507aa99fc Fixed immutable array support 2014-08-20 21:42:49 +04:00
Anatol Belski 49b65d0d65 fixed sysvshm 2014-08-20 09:44:43 -07:00
Anatol Belski be1b1e7b41 fix index type 2014-08-20 18:21:57 +02:00
Anatol Belski 66e7090e61 Merge remote-tracking branch 'php/master' 2014-08-20 18:19:37 +02:00
Anatol Belski 4498f93c0e more fixes to ext/spl 2014-08-20 18:06:01 +02:00
Anatol Belski 8e8a30654e fix zpp 2014-08-20 17:56:07 +02:00
Anatol Belski 5eefbce083 fix types in virtual cwd 2014-08-20 17:49:52 +02:00
Dmitry Stogov d37820ff5b Introduced get_resources() function.
It may be used for debugging and testing to identify resource leaks.
Changed ext/standard/tests/http/bug60570.phpt to use this function instead of unsafe attempt to catch resource leaks using get_memory_usage()
2014-08-20 18:29:44 +04:00
Anatol Belski e08fa78a54 fixed count_chars() 2014-08-20 15:51:45 +02:00
Anatol Belski 38c4db54dd fixed nl2br 2014-08-20 15:32:24 +02:00
Remi Collet 634d6ab142 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
2014-08-20 15:17:30 +02:00
Anatol Belski 33d2442a32 fix php_sapi_filter 2014-08-20 15:14:25 +02:00
Remi Collet 28f71e18d1 Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed variable corruption under win x64
2014-08-20 15:11:19 +02:00
Anatol Belski 745a71be33 yet more fixes to zpp 2014-08-20 14:46:14 +02:00
Dmitry Stogov 04aa96d28d Removed a hack that allowed passing of function return value by reference depending on value of reference-counter (Fixed Zend/tests/bug35393.phpt test failure) 2014-08-20 15:04:40 +04:00
Dmitry Stogov 3d90fdf79c Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  phpdbg doesn't build due to the phpng merge, distable its build & test runs
  phpdbg doesn't build due to the phpng merge, distable it
2014-08-20 15:04:03 +04:00
Lior Kaplan a43ddea897 phpdbg doesn't build due to the phpng merge, distable its build & test runs 2014-08-20 13:33:37 +03:00
Lior Kaplan d91b1ef7b8 phpdbg doesn't build due to the phpng merge, distable it 2014-08-20 12:13:36 +03:00
Dmitry Stogov c1b5fde606 Reverted incorrectly changed test. Now it's the same as in PHP-5.6. 2014-08-20 12:03:47 +04:00
Anatol Belski fdbbe5fa30 fixed some incompatible types 2014-08-20 09:52:23 +02:00
Anatol Belski f27c52d846 fixed incompatible types usage 2014-08-20 09:15:00 +02:00
Anatol Belski 07359785c3 Merge remote-tracking branch 'php/master' 2014-08-20 08:48:43 +02:00
Dmitry Stogov 8ea7e4e4e2 fixed memory leak 2014-08-20 10:43:37 +04:00
Tjerk Meesters 285934a4c9 Fixed off-by-one memory allocation that could lead to invalid memory reads on strlen()
Always properly null terminate strings before ini parsing
Remove unnecessary memset() statements
2014-08-20 12:13:19 +08:00
Andrea Faulds 90ed6d0ec6 NEWS and UPGRADING 2014-08-20 00:38:33 +01:00
Andrea Faulds 115698d832 Merge branch 'master' of git.php.net:php-src 2014-08-20 00:34:12 +01:00
Andrea Faulds 376e545b01 Merge branch 'fpmConfFix' of github.com:DaveRandom/php-src 2014-08-20 00:28:43 +01:00
Lior Kaplan 7cba6e0e82 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add NEWS entry for bug #67730
  Add CVE ID for bug #67539
  Add NEWS entry for bug #67492
  Add NEWS entry for bug #67730
  Add NEWS entry for bug #67730
  Add CVE ID for bug #67539
2014-08-20 01:36:56 +03:00
Anatol Belski 53a8d8e627 Merge remote-tracking branch 'php/master' 2014-08-20 00:34:17 +02:00
Anatol Belski 476bdbf85b ported opcache 2014-08-20 00:23:37 +02:00
Anatol Belski 61c8af6a9d ported apache handler 2014-08-19 23:39:22 +02:00
Anatol Belski 21f623e945 ported fcgi 2014-08-19 23:12:17 +02:00
Anatol Belski 063079b62e ported ext/intl, bugfixes to go 2014-08-19 22:57:17 +02:00
Anatol Belski 729bce4321 fix hash 2014-08-19 22:57:07 +02:00
Sara Golemon 1ec93f8069 Merge branch 'PHP-5.6'
* PHP-5.6:
  Switch use of strtok() to gd_strtok_r()
2014-08-19 13:24:49 -07:00
Anatol Belski 074172061e ported ext/com_dotnet 2014-08-19 22:23:03 +02:00
Anatol Belski 919b996527 ported ext/gmp 2014-08-19 22:10:20 +02:00
Anatol Belski 0ccc2f5d66 ported ext/gettext 2014-08-19 22:05:37 +02:00
Anatol Belski 48ba0a7962 ported ext/gd 2014-08-19 22:03:57 +02:00
Dmitry Stogov 14439b79b4 Fixed referenced value separation 2014-08-20 00:00:59 +04:00
Anatol Belski 6719106257 ported ext/ftp 2014-08-19 21:49:34 +02:00
Anatol Belski bfc703bfb7 ported ext/filter 2014-08-19 21:43:22 +02:00
Anatol Belski ac6d6aebd8 ported ext/fileinfo 2014-08-19 21:35:13 +02:00
Anatol Belski 7eba90705a fixed exif 2014-08-19 21:26:31 +02:00
Anatol Belski 3ebf5bf99c ported ext/enchant 2014-08-19 21:24:15 +02:00
Anatol Belski 49a78cc6b3 ported ext/dom 2014-08-19 21:22:07 +02:00
Anatol Belski 1958857225 ported ext/json 2014-08-19 20:15:59 +02:00
Anatol Belski 7c7767853b ported ext/ldap 2014-08-19 20:09:16 +02:00
Anatol Belski 6428b49851 ported ext/mbstring 2014-08-19 19:42:16 +02:00
Anatol Belski e8fcd52ef1 ported ext/odbc 2014-08-19 19:35:29 +02:00
Anatol Belski 1899e6f9b9 ported ext/openssl 2014-08-19 19:27:37 +02:00
Anatol Belski 1a5a113f95 ported pcntl 2014-08-19 19:08:41 +02:00
Anatol Belski 4ed156d4df ported from pdo - pgsql, odbc, mysql, firebirt, dblib 2014-08-19 19:02:07 +02:00
Anatol Belski 92269d25a3 ported pdo and pdo_sqlite 2014-08-19 18:32:08 +02:00
Anatol Belski c517d6d853 ported ext/mysqli 2014-08-19 17:08:15 +02:00
Anatol Belski bdbf47df18 ported mysql and mysqlnd 2014-08-19 16:51:06 +02:00
Anatol Belski 1d8bc9a274 ported ext/pgsql 2014-08-19 16:11:28 +02:00
Anatol Belski 8704e392a1 ported ext/phar 2014-08-19 15:12:13 +02:00
Anatol Belski 398a1cc655 added php_off_t alias 2014-08-19 14:39:24 +02:00
Anatol Belski 6974d36d01 ported ext/posix 2014-08-19 14:30:33 +02:00
Anatol Belski 179040ead0 partially ported ext/pspell, should be more for zend_string usage 2014-08-19 14:28:03 +02:00
Anatol Belski f07b41b465 fix incompatible types 2014-08-19 14:20:56 +02:00
Anatol Belski 48e6adeee2 ported ext/session 2014-08-19 14:18:24 +02:00
Anatol Belski 64d54461bf ported ext/shmop 2014-08-19 14:05:39 +02:00
Anatol Belski e41ec2cfeb ported ext/simplexml 2014-08-19 14:01:16 +02:00
Anatol Belski 0606e4bcb6 fixes to ext/skeleton 2014-08-19 13:53:44 +02:00
Anatol Belski ecbce817eb fixes to ext/snmp 2014-08-19 13:53:02 +02:00
Anatol Belski 094441f102 ported ext/soap 2014-08-19 13:49:48 +02:00
Anatol Belski 2da1c805ec ported ext/sockets 2014-08-19 13:22:27 +02:00
Anatol Belski 5491d01a92 port sysvshm, sysvsem and sysvmsg 2014-08-19 13:11:32 +02:00
Anatol Belski 58aa0f8df8 fixes to tokenizer 2014-08-19 13:05:20 +02:00
Anatol Belski 40912abf1d Merge remote-tracking branch 'php/master'
Conflicts:
	ext/xsl/xsltprocessor.c
2014-08-19 12:56:29 +02:00
Anatol Belski 168ea67b2d ported xsl, xml reader and writer 2014-08-19 12:55:03 +02:00
Anatol Belski 0e8c20edc9 Merge branch 'master' of git.php.net:php-src
# By Stanislav Malyshev (5) and Remi Collet (1)
# Via Stanislav Malyshev
* 'master' of git.php.net:php-src:
  5.4.32
  fix potentially missing NUL termination
  Fix bug #67730 - Null byte injection possible with imagexxx functions
  Fixed bug #67717 - segfault in dns_get_record
  Fix bug #67716 - Segfault in cdf.c
  5.4.32 RC1
2014-08-19 12:51:05 +02:00
Anatol Belski fa0cca85e5 fix uninitialized args usage 2014-08-19 12:50:27 +02:00
Anatol Belski acdda1093b ported ext/sqlite3 2014-08-19 12:04:15 +02:00
Anatol Belski 094a78eb69 ported ext/zip 2014-08-19 11:47:21 +02:00
Anatol Belski beec26b5fe ported ext/zlib 2014-08-19 11:33:51 +02:00
Anatol Belski b9c44ce85e fixes to ext/dba 2014-08-19 11:28:42 +02:00
Anatol Belski 3e9bab4d83 add credits 2014-08-19 11:24:54 +02:00
Anatol Belski 3bcb168662 ported ext/curl 2014-08-19 11:24:24 +02:00
Anatol Belski fd279836cf ported ext/calendar 2014-08-19 10:42:01 +02:00
Stanislav Malyshev ff6b30c818 Merge branch 'PHP-5.6'
* PHP-5.6:
  5.4.32
  fix potentially missing NUL termination
  Fix bug #67730 - Null byte injection possible with imagexxx functions
  Fixed bug #67717 - segfault in dns_get_record
  Fix bug #67716 - Segfault in cdf.c
  5.4.32 RC1
2014-08-19 01:34:38 -07:00
Anatol Belski 29dc15b0bb fixes to ext/bz2 2014-08-19 10:33:32 +02:00
Anatol Belski ae470a8e82 fixes to ext/bcmath 2014-08-19 10:30:43 +02:00
Anatol Belski 5dc4f44f3e Merge remote-tracking branch 'php/master'
Conflicts:
	ext/standard/dns.c
2014-08-19 09:58:35 +02:00
Anatol Belski 6070757c77 Merge branch 'master' of git.php.net:php-src
# By Remi Collet
# Via Remi Collet
* 'master' of git.php.net:php-src:
  fix merge issue in previous (again)
  fix merge issue in previous
  NEWS
  NEWS
  NEWS
  Fixed Sec Bug #67717 segfault in dns_get_record CVE-2014-3597
2014-08-19 09:38:13 +02:00
Anatol Belski d4f463cf08 brought back that vs2012 fix 2014-08-19 09:37:38 +02:00
Remi Collet 633cc42018 fix merge issue in previous (again) 2014-08-19 09:16:24 +02:00
Remi Collet ddd1e2a8b7 fix merge issue in previous 2014-08-19 09:10:34 +02:00
Anatol Belski 30e0aa5b6b fixes to iconv 2014-08-19 09:09:43 +02:00
Remi Collet 14e656f81d fix merge for #67717 2014-08-19 08:56:43 +02:00
Anatol Belski 97c5172ac7 Merge remote-tracking branch 'php/master'
Conflicts:
	ext/date/lib/parse_date.c
2014-08-19 08:27:43 +02:00
Anatol Belski 53c4c571b3 C89 compat 2014-08-19 08:16:34 +02:00
Anatol Belski 63d3f0b844 basic macro replacements, all at once 2014-08-19 08:07:31 +02:00
Anatol Belski 5fe1e5fefd c89 compat 2014-08-19 08:05:31 +02:00
Anatol Belski e83f3e7f03 added missing define 2014-08-19 08:00:52 +02:00
Anatol Belski 6bb3d049e8 Merge branch 'master' of git.php.net:php-src
# By Dmitry Stogov
# Via Dmitry Stogov
* 'master' of git.php.net:php-src:
  Fixed encoding support
2014-08-19 07:45:28 +02:00
Anatol Belski 56c7b27d6b fix wrong pointer indirection 2014-08-19 07:44:03 +02:00
Dmitry Stogov 7dbb8117e4 Fixed encoding support 2014-08-19 09:28:13 +04:00
Lior Kaplan dd16f4f716 Bump version to 7.0.0
Follow up for d9f3eac
2014-08-19 00:20:50 +03:00
Anatol Belski 04b5db1fb2 Merge branch 'master' of git.php.net:php-src
# By Derick Rethans (3) and Dmitry Stogov (1)
# Via Derick Rethans (3) and Dmitry Stogov (1)
* 'master' of git.php.net:php-src:
  Improved error message
  BFN.
  Fixed bug #67109: First uppercase letter breaks date string parsing.
  Fixed bug #66985: Some timezones are no longer valid in PHP 5.5.10.
2014-08-18 22:36:57 +02:00
Anatol Belski de707df5e6 C89 compat 2014-08-18 22:36:38 +02:00
Derick Rethans 919b6447a2 Merge branch 'PHP-5.6' 2014-08-18 20:27:51 +01:00
Anatol Belski 1e8273964f more fixes to ext/standard 2014-08-18 20:57:21 +02:00
Anatol Belski dc40a5c450 refix the dump stuff again 2014-08-18 20:57:00 +02:00
Anatol Belski a5ffd245bd fixed splfixedarray 2014-08-18 19:55:05 +02:00
Dmitry Stogov f3106998b0 Improved error message 2014-08-18 21:47:30 +04:00
Dmitry Stogov 0f5bad93fd Fixed bug #67856 (Leak when using array_reduce with by-ref function) 2014-08-18 21:08:50 +04:00
Anatol Belski e49e163a9e fixes to date 2014-08-18 18:57:55 +02:00
Ferenc Kovacs 29a8701389 Merge branch 'PHP-5.6'
* PHP-5.6:
  improve the grammar for my recent UPGRADING note
2014-08-18 18:48:06 +02:00
Nikita Popov 26a9dc3e04 Fix bug #67858: Leak when $php_errormsg already set 2014-08-18 18:14:19 +02:00
Ferenc Kovacs eda5d30be9 Merge branch 'PHP-5.6'
* PHP-5.6:
  mention the changes regarding ReflectionClass::newInstanceWithoutConstructor in UPGRADING see the discussion on the mailing list and in the pull request for details: https://github.com/php/php-src/pull/733
2014-08-18 17:04:17 +02:00
Anatol Belski b8324e6d63 further fixes to ext/standard 2014-08-18 16:50:54 +02:00
Anatol Belski 97e9d058f0 fixes to string functions 2014-08-18 15:39:38 +02:00
Anatol Belski 22dbb38d5e fix typo 2014-08-18 10:37:38 +02:00
Anatol Belski 59ec8329f4 renamed _z_param_long 2014-08-18 10:35:46 +02:00
Anatol Belski 483a800c98 Merge remote-tracking branch '64bit_ng/master'
Conflicts:
	Zend/zend_API.h
2014-08-18 10:34:29 +02:00
Anatol Belski c586133d07 rename zval_get_long and fixes to some string functions 2014-08-18 08:39:39 +02:00
Dmitry Stogov 35189d2dd6 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Change to ext/reflection should be in its own category
2014-08-18 10:09:25 +04:00
Dmitry Stogov f3dc4421ff Fixed parameter parsing 2014-08-18 10:08:48 +04:00
Tjerk Meesters 61e81c714d Change to ext/reflection should be in its own category 2014-08-18 13:07:34 +08:00
Dmitry Stogov 8b3c2cc47e Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Updated NEWS for d790ec
  Correct typo in comments: 'initialized'
  typofixes
  typofixes
  Fixes missing Reflector interface constraints being enforced by the engine
  Fixed version id
  Update NEWS
  Update NEWS
  Fix another failing test
  Add NEWS
  Better version checking
  Better version checking
  Better version checking
  Fix failing tests
  Patch for bug #67839 (mysqli does not handle 4-byte floats correctly)
2014-08-18 09:05:16 +04:00
Tjerk Meesters 3e79907b0a Updated NEWS for d790ec 2014-08-18 06:54:50 +08:00
Anatol Belski 6ed220cbf3 fixed strspn 2014-08-17 22:56:26 +02:00
Anatol Belski a3b0cafc01 more fixes to var_dump and co. 2014-08-17 22:34:18 +02:00
Anatol Belski 77eb6e7278 Merge branch 'master' of git.php.net:php-src
# By Veres Lajos (2) and Lior Kaplan (1)
# Via Lior Kaplan
* 'master' of git.php.net:php-src:
  Correct typo in comments: 'initialized'
  typofixes
  typofixes
2014-08-17 21:40:39 +02:00
Anatol Belski f2182ab845 some more pure naming replacements 2014-08-17 21:16:27 +02:00
Anatol Belski 41115d3d9d regenerated parser files 2014-08-17 21:05:20 +02:00
Anatol Belski 025a7c304e fix THIS_HASHVAL 2014-08-17 21:04:52 +02:00
Lior Kaplan 741605da73 Merge branch 'PHP-5.6'
* PHP-5.6:
  Correct typo in comments: 'initialized'

Conflicts:
	ext/dom/php_dom.c
	ext/spl/php_spl.c
2014-08-17 21:37:22 +03:00
Veres Lajos 1e3452992f typofixes 2014-08-17 16:00:39 +03:00
Lior Kaplan 543d5eb495 Merge branch 'PHP-5.6'
* PHP-5.6:
  typofixes

Conflicts:
	ext/spl/php_spl.c
2014-08-17 15:53:33 +03:00
Anatol Belski 90d6f60bc1 mostly fixes to spl, but also some other 2014-08-17 13:31:39 +02:00
Anatol Belski 977cf1dc11 Merge branch 'master' of git.php.net:php-src
# By Tjerk Meesters
# Via Tjerk Meesters
* 'master' of git.php.net:php-src:
  Fixes missing Reflector interface constraints being enforced by the engine
2014-08-17 12:04:05 +02:00
Anatol Belski 864172d9a4 further fixes to ext/standard and zend 2014-08-16 17:31:40 +02:00
Anatol Belski 54906c760f increase the stack size for cli and cgi 2014-08-16 16:45:05 +02:00
Anatol Belski 5bb25776a0 further fixes on core 2014-08-16 15:34:04 +02:00
Anatol Belski 7534bf125a fix set_time_limit, substr and some more 2014-08-16 14:46:31 +02:00
Anatol Belski 1169de3e61 fix some cases with fast zpp 2014-08-16 14:00:02 +02:00
Anatol Belski b7e7a89541 several fixes -
- param parsing Z_PARAM_STR vs Z_PARAM_STRING
- some functions for new params
- etc
2014-08-16 12:55:13 +02:00
Anatol Belski cb25136f4e fix macros in the 5 basic extensions 2014-08-16 11:37:14 +02:00
Tjerk Meesters 87afa6bdc9 Fixes missing Reflector interface constraints being enforced by the engine 2014-08-16 17:34:56 +08:00
Anatol Belski f790043e30 Merge branch 'master' of git.php.net:php-src
# By Keyur Govande (6) and Xinchen Hui (4)
# Via Keyur Govande (5) and Xinchen Hui (2)
* 'master' of git.php.net:php-src:
  Fixed version id
  Update NEWS
  Update NEWS
  Fix another failing test
  Add NEWS
  Better version checking
  Better version checking
  Better version checking
  Fix failing tests
  Patch for bug #67839 (mysqli does not handle 4-byte floats correctly)
2014-08-16 11:16:56 +02:00
Anatol Belski 8ee2a4a9b5 first shot on merging the core fro the int64 branch 2014-08-16 11:16:11 +02:00
Xinchen Hui d790eceb01 Fixed version id 2014-08-16 16:44:02 +08:00
Xinchen Hui c8250fa3e3 Merge branch 'master' of https://git.php.net/repository/php-src 2014-08-16 16:43:57 +08:00
Keyur Govande bbd107f7b3 Merge branch 'PHP-5.6'
* PHP-5.6:
  Update NEWS
2014-08-15 23:49:17 +00:00
Keyur Govande 603e3ddfc0 Merge branch 'PHP-5.6'
* PHP-5.6:
  Update NEWS
  Fix another failing test
  Add NEWS
  Fix failing tests
  Patch for bug #67839 (mysqli does not handle 4-byte floats correctly)
2014-08-15 23:47:31 +00:00
Anatol Belski 735ec33b82 Merge remote-tracking branch 'origin/str_size_and_int64'
* origin/str_size_and_int64: (614 commits)
  fix macro
  fix macro
  fix zpp
  fix zpp
  fix macros
  some more after merge fixes
  fixed macro names
  fixed signatures
  fix datatypes
  fix zpp
  fixed prototype
  fix prototype
  fix signature
  fix macros
  fix macros
  reorder the struct members which reduces its size by at least 112 bytes
  arg count is zend_size_t now, fix type
  fix declarations
  fix array types for pass by ref
  fix macro
  ...
2014-08-15 21:34:21 +02:00
Dmitry Stogov b1c2e14954 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fixed version checking
  Fixed version check
2014-08-15 16:13:00 +04:00
Xinchen Hui bde56debe5 Better version checking 2014-08-15 18:41:01 +08:00
Xinchen Hui 7af24dcb47 Better version checking 2014-08-15 18:39:45 +08:00
Xinchen Hui 617b1759c4 Better version checking 2014-08-15 18:38:31 +08:00
Xinchen Hui 0583b3bd6a Fixed version checking 2014-08-15 18:28:41 +08:00
Xinchen Hui 7ace092abf Fixed version check 2014-08-15 18:21:23 +08:00
Dmitry Stogov f281e0cf53 Fixed PHP6 unicode related tests 2014-08-15 13:35:52 +04:00
Dmitry Stogov 29893a88e7 Fixed PHP6 unicode related tests 2014-08-15 13:22:13 +04:00
Dmitry Stogov e3de409eac Fixed PHP6 unicode related tests 2014-08-15 13:08:53 +04:00
Xinchen Hui d1b48a8b02 Merge branch 'master' of https://git.php.net/repository/php-src
Conflicts:
	ext/mysqli/mysqli_api.c
2014-08-15 16:58:22 +08:00
Xinchen Hui 101c055396 Add copyright header 2014-08-15 16:47:54 +08:00
Xinchen Hui e2522b4f1d Remove old version PHP supports 2014-08-15 16:40:07 +08:00
Xinchen Hui 89b8c7b3ee Fixed build after version number bumped 2014-08-15 16:39:51 +08:00
Dmitry Stogov b01b971ec0 Parameters with duplicate names are not allowed anymore in PHP7. 2014-08-15 11:46:04 +04:00
Dmitry Stogov 3bd32efb3e Behavoir of func_get_arg() and func_get_args() was changed in PHP7.
Now they show current values of variables corresponded to passed arguments instead of originally passed values.
2014-08-15 11:39:50 +04:00
Dmitry Stogov 0d57a7bf34 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Update Version Number :)
  Fixed initializing
  Unused variable

Conflicts:
	main/php_version.h
2014-08-15 11:13:42 +04:00
Dmitry Stogov d9f3eac12f Bump version to 7.0.0-dev 2014-08-15 11:10:41 +04:00
Xinchen Hui 3ab892eb75 Update Version Number :) 2014-08-15 15:06:26 +08:00
Xinchen Hui d7f12b9b9c Fixed initializing 2014-08-15 13:52:52 +08:00
Xinchen Hui 27c2fa691b Unused variable 2014-08-15 13:47:38 +08:00
Dmitry Stogov 8b66d64b23 Merge branch 'master' into phpng
* master:
  add NEWS for 5.6 too
  Fix bug #67716 - Segfault in cdf.c
  Fix bug #67716 - Segfault in cdf.c
  fix test
  split the glob() test to test different basedir
  fixed glob() edge case on windows, ref bug #47358
  - fix bug #47358, glob returns error, should be empty array()
  Add NEWS entry for log() improvements
2014-08-15 08:10:08 +04:00
Stanislav Malyshev e9dac4cf71 Merge branch 'PHP-5.6'
* PHP-5.6:
  add NEWS for 5.6 too
2014-08-14 18:16:49 -07:00
Stanislav Malyshev 65a840072b Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #67716 - Segfault in cdf.c
  Fix bug #67716 - Segfault in cdf.c
2014-08-14 17:22:15 -07:00
Stanislav Malyshev 41177c1b65 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test
  split the glob() test to test different basedir
  fixed glob() edge case on windows, ref bug #47358
  - fix bug #47358, glob returns error, should be empty array()
2014-08-14 17:09:09 -07:00
Sara Golemon 50499fe6d7 Add NEWS entry for log() improvements 2014-08-14 13:34:06 -07:00
Dmitry Stogov 6463bc5b55 Fixed mode 2014-08-14 23:54:32 +04:00
Dmitry Stogov c78a1734c2 Fixed compilation warnings 2014-08-14 23:53:27 +04:00
Dmitry Stogov 243383a811 Fixed windows build 2014-08-14 23:31:01 +04:00
Dmitry Stogov 7497c8793d Merge branch 'master' into phpng
* master: (51 commits)
  Update Git rules
  Back to -dev (with EOL notice in NEWS)
  new NEWS block for the next release
  It's 2014 already, fix copyright year where user visible
  PHP 5.3.29
  Some changes were lost in the merge commit of #66091
  Updated NEWS for #66091
  Fixed #66091
  Updated NEWS for #66091
  Updated NEWS for #66091
  Fixed #66091
  updated NEWS
  updated NEWS
  updated NEWS
  backported the fix for bug #41577
  NEWS entry for e6d93a1 / d73d44c
  restore FPM compatibility with mod_fastcgi broken since #694 / 67541, fixes bug 67606
  Revert "Merge branch 'pull-request/694' into PHP-5.6"
  PHP 5.3.29RC1
  Fix missing type checks in various functions
  ...

Conflicts:
	ext/date/php_date.c
	ext/standard/math.c
2014-08-14 23:30:49 +04:00
Dmitry Stogov 773d80c6df Fixed support for references 2014-08-14 22:44:25 +04:00
Dmitry Stogov e7ffdb2654 Fixed support for references 2014-08-14 21:54:57 +04:00
Sara Golemon 37e91cc5d3 Merge branch 'pull-request/658' 2014-08-14 09:44:14 -07:00
Johannes Schlüter e644e6634d Merge branch 'PHP-5.6' 2014-08-14 17:27:12 +02:00
Dmitry Stogov 05ca575bbb Fixed reference support (references to references are not allowed) 2014-08-14 17:00:01 +04:00
Dmitry Stogov e430948581 Fixed reference handling 2014-08-14 15:07:39 +04:00
Dmitry Stogov 2ece977c80 Fixed conversion of empty packed array into hash 2014-08-14 13:44:37 +04:00
Dmitry Stogov 25bda5ae3c Fixed assignment of reference to itself 2014-08-14 12:01:28 +04:00
Dmitry Stogov 753813e542 Restored "???" mark in the place that might be changed later 2014-08-14 10:46:17 +04:00
Xinchen Hui f7f411e4e2 It's okey for use a stack value here (deleted immediately after use) 2014-08-14 12:26:45 +08:00
Xinchen Hui c749fe2067 cleanup 2014-08-14 12:15:24 +08:00
Xinchen Hui bfc1ae07be Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-08-14 11:52:46 +08:00
Ferenc Kovacs 0bad99bf99 Merge branch 'PHP-5.6'
* PHP-5.6:
  new NEWS block for the next release
2014-08-14 02:18:27 +02:00
Dmitry Stogov 73fe418637 Avoid reallocation 2014-08-13 23:30:07 +04:00
Dmitry Stogov 8296129e50 cleanuo (use zend_string instead of char*) 2014-08-13 22:26:07 +04:00
Dmitry Stogov bb7d9005b5 cleanup 2014-08-13 22:21:51 +04:00
Dmitry Stogov 01c8aee7d2 cleanup 2014-08-13 22:18:05 +04:00
Dmitry Stogov a08b7b7701 cleanup 2014-08-13 19:43:34 +04:00
Dmitry Stogov c1c913c5f1 cleanup (we don't have to duplicate elements of module_registry) 2014-08-13 17:05:18 +04:00
Dmitry Stogov b59cc8de23 cleanup (we don't have to duplicate elements of stream_filters_hash) 2014-08-13 17:00:13 +04:00
Dmitry Stogov 9fea4348fd cleanup 2014-08-13 16:55:21 +04:00
Tjerk Meesters b695341e62 Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated NEWS for #66091
  Updated NEWS for #66091
  Fixed #66091
2014-08-13 20:21:30 +08:00
Dmitry Stogov 5a06ac88da cleanup (use zend_string* instead of char*) 2014-08-13 14:51:48 +04:00
Xinchen Hui 35dd200430 clean up - remove checked questions 2014-08-13 16:44:22 +08:00
Dmitry Stogov b8517e410c cleanup 2014-08-13 12:36:10 +04:00
Xinchen Hui da3aeeed39 clean up - avoid realloc 2014-08-13 15:51:43 +08:00
Ferenc Kovacs 86aa8d2523 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS entry for e6d93a1 / d73d44c
  restore FPM compatibility with mod_fastcgi broken since #694 / 67541, fixes bug 67606
  Revert "Merge branch 'pull-request/694' into PHP-5.6"
2014-08-12 14:48:48 +02:00
Dmitry Stogov 05eaed4345 Merge branch 'master' into phpng
* master:
  fix the failing date tests introduced with the latest timezonedb update Derick confirmed on irc that the new/current behavior is the correct and that the tests should be updated to reflect it
  Fixed bug #67813 (CachingIterator::__construct InvalidArgumentException wrong message)
2014-08-12 14:46:38 +04:00
Anatol Belski 91351d4bf5 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  updated NEWS
  updated NEWS
  backported the fix for bug #41577
2014-08-12 11:53:10 +02:00
Anatol Belski b3860f4224 Merge branch 'pull-request/681' 2014-08-12 11:45:05 +02:00
Ferenc Kovacs b3468662de Merge branch 'PHP-5.6'
* PHP-5.6:
  fix the failing date tests introduced with the latest timezonedb update Derick confirmed on irc that the new/current behavior is the correct and that the tests should be updated to reflect it
2014-08-12 10:44:09 +02:00
Dmitry Stogov 06476e5291 Fixed ext/odbc 2014-08-12 11:27:30 +04:00
Dmitry Stogov 8210b3b8c4 ext/pdo_odbc support for phpng (tested with unixODBC and mysql driver) 2014-08-12 11:00:06 +04:00
Dmitry Stogov c4fc99ff82 ext/odbc support for phpng (incomplete) 2014-08-12 02:10:30 +04:00
Dmitry Stogov 7435fc88a6 Fixed pdo_firebird tests failures 2014-08-11 23:56:34 +04:00
Dmitry Stogov 3ae802508a Fixed mode 2014-08-11 18:38:36 +04:00
Dmitry Stogov 8013a27ad9 Implemented ext/com_dotnet support for phpng 2014-08-11 18:37:26 +04:00
Xinchen Hui dc06b4f941 Merge branch 'PHP-5.6' 2014-08-11 17:47:47 +08:00
Dmitry Stogov 4c716e8b51 Merge branch 'master' into test
* master: (39 commits)
  Add __debugInfo() to UPGRADING.
  fix TS build
  Update NEWS
  Update NEWS
  Update NEWS
  Small tidy ups and raise visibility of GitHub PR process
  Bug #41631: Observe socket read timeouts in SSL streams
  wrap int8_t and int16_t with #ifdef to avoid possible clashes
  - Updated to version 2014.6 (2014f)
  Removed Countable::count() change info from UPGRADE.INTERNALS too
  NEWS and UPGRADING for intdiv()
  Revert "Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option"
  Fixed skip case for intdiv 64-bit test
  Use callback structure
  Add EXPECTF
  Fix handling of multi-result sets with PS...used to clean not only the result set but the whole PS.
  5.5.17 now
  5.4.33-dev now
  Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option
  Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option
  ...

Conflicts:
	ext/fileinfo/libmagic/softmagic.c
	main/streams/xp_socket.c
2014-08-11 11:38:41 +04:00
Dmitry Stogov 0ae305e62d Fixed compilation warnings about unused labels 2014-08-11 10:17:06 +04:00
krakjoe 1d01e2334c fix incorrect cast of comparison function and signature of function 2014-08-11 06:47:09 +01:00
krakjoe dc70139d85 update zend_make_printable_zval to take TSRM context 2014-08-11 06:09:46 +01:00
krakjoe 4513475a41 fix ZTS build 2014-08-10 09:31:02 +01:00
Adam Harvey 97bb078bdd Merge branch 'PHP-5.6'
* PHP-5.6:
  Add __debugInfo() to UPGRADING.
2014-08-08 12:02:56 -07:00
Dmitry Stogov 4a3e501fb3 cleanup 2014-08-08 13:47:34 +04:00
Anatol Belski 6936c7a1bb Merge branch 'PHP-5.6'
* PHP-5.6:
  fix TS build
2014-08-07 19:51:04 +02:00
Daniel Lowrey 5542e60c79 Merge branch 'PHP-5.6' 2014-08-07 12:45:50 -04:00
Christopher Jones a7ecfb50c1 Merge branch 'PHP-5.6'
* PHP-5.6:
  Small tidy ups and raise visibility of GitHub PR process
2014-08-07 09:30:19 -07:00
Christopher Jones 45caa88c29 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Small tidy ups and raise visibility of GitHub PR process

Conflicts:
	README.SUBMITTING_PATCH
2014-08-07 09:29:47 -07:00
Christopher Jones 1d16d8f6ff Small tidy ups and raise visibility of GitHub PR process 2014-08-07 09:27:53 -07:00
Daniel Lowrey 217c8edd00 Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug #41631: Observe socket read timeouts in SSL streams
2014-08-07 12:17:29 -04:00
Dmitry Stogov 50a76860bd Fixed GC for inner-loops (ext/standard/tests/array/compact_variation1.phpt).
Fixed bug #63734.
2014-08-07 18:50:03 +04:00
Anatol Belski 898b5e5d52 Merge branch 'PHP-5.6'
* PHP-5.6:
  wrap int8_t and int16_t with #ifdef to avoid possible clashes
2014-08-07 15:23:03 +02:00
Dmitry Stogov 417ed16d11 Make stream->context indirect trough zend_resource (stream->ctx->ptr).
Fixed ext/standard/tests/streams/bug61115.phpt
2014-08-07 15:55:37 +04:00
Derick Rethans 3fd379e196 Merge branch 'PHP-5.6'
Not sure what's going wrong here for UPGRADING.INTERNALS...

Conflicts:
	UPGRADING.INTERNALS
2014-08-07 10:25:05 +01:00
Ferenc Kovacs 3b7c58ecd8 Merge branch 'PHP-5.6'
* PHP-5.6:
  Revert "Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option"

  Didn't actually merged the revert as we wan't to keep this in master, but merged it with -s ours.
2014-08-06 21:11:02 +02:00
Andrea Faulds 64534830b1 NEWS and UPGRADING for intdiv() 2014-08-06 19:56:32 +01:00
Andrea Faulds 6c47f50137 Merge branch 'master' of git.php.net:php-src 2014-08-06 16:02:38 +01:00
Andrea Faulds 54e663626d Fixed skip case for intdiv 64-bit test 2014-08-06 16:02:02 +01:00
Andrey Hristov f6b96d4c4c Merge branch 'PHP-5.6'
Conflicts:
	NEWS
2014-08-06 17:04:30 +03:00
Andrey Hristov 771a2e0614 Merge branch 'master' of git.php.net:php-src 2014-08-06 16:58:30 +03:00
Andrey Hristov fa19a22279 Merge branch 'PHP-5.6' 2014-08-06 16:52:44 +03:00
Andrea Faulds 8e964fe665 Merge branch 'intdiv'
* intdiv:
  Added -1 safety check, fixed test
  php_error_docref
  Fixed testcase
  Implemented intdiv()
2014-08-06 13:59:23 +01:00
Dmitry Stogov 414762fc12 Fixed GC (Zend/tests/bug63635.phpt) 2014-08-06 15:31:07 +04:00
Stanislav Malyshev e0456bfd29 Merge branch 'PHP-5.6'
* PHP-5.6:
  5.4.33-dev now
  Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option

Conflicts:
	main/streams/xp_socket.c
2014-08-05 21:30:56 -07:00
Daniel Lowrey f6b530bd54 Merge branch 'PHP-5.6' 2014-08-05 22:58:45 -04:00
Daniel Lowrey 60552a8871 Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option 2014-08-05 22:43:12 -04:00
Dmitry Stogov e677e8cc87 Fixed ext/wddx/tests/bug48562.phpt 2014-08-05 23:48:27 +04:00
Dmitry Stogov e3b610c245 typo 2014-08-05 20:55:15 +04:00
Dmitry Stogov da2097b349 Fixed argument numbering 2014-08-05 18:17:05 +04:00
Michael Wallner 1b5569eb16 Merge branch 'PHP-5.6'
* PHP-5.6:
  BFN
  BFN
  Fixed Bug #67724
2014-08-05 15:48:50 +02:00
Dmitry Stogov ce1af1e47b Fixed bug #67725 (now we create immutable arrays only in SHM) 2014-08-05 15:38:43 +04:00
Dmitry Stogov 3700364ca5 Don't waste SHM for unused Buckets 2014-08-04 22:51:41 +04:00
Dmitry Stogov b5590a2f87 Fixed incorrect arguments handling 2014-08-04 21:31:13 +04:00
Dmitry Stogov 415482ac0a Delete immutable arrays copied into SHM (related to bug #67725) 2014-08-04 20:20:12 +04: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
Remi Collet 6f9ed6b01c Merge branch 'PHP-5.6'
* PHP-5.6:
  typo
  typo
  typo
2014-08-04 11:09:25 +02:00
Remi Collet 3e176e0166 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fixed Bug #66901 php-gd 'c_color' NULL pointer dereference
2014-08-04 10:51:19 +02:00
Anatol Belski c3c83bb078 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Patches #67739
  PHP_INT_MIN and _MAX tests
  NEWS and UPGRADING
  Added PHP_INT_MIN

Conflicts:
	main/main.c
2014-08-04 10:34:07 +02:00
Anatol Belski 616275859e Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport: (51 commits)
  backport the fix for bug #67739
  fix macro
  Fix bug #67705 (extensive backtracking in rule regular expression)
  add test
  Fix bug #67705 (extensive backtracking in rule regular expression)
  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
  ...
2014-08-04 10:28:03 +02:00
Anatol Belski 38a4b934ca Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  backport the fix for bug #67739
  Fix bug #67705 (extensive backtracking in rule regular expression)
  add test
  Fix bug #67705 (extensive backtracking in rule regular expression)
2014-08-04 10:04:02 +02:00
Anatol Belski eee03852b6 Merge branch 'PHP-5.6'
* PHP-5.6:
  backport the fix for bug #67739
2014-08-04 09:59:06 +02:00
Anatol Belski 8eeacd3364 Merge branch 'pull-request/756' 2014-08-04 09:47:11 +02:00
Anatol Belski dccbb79445 fix macro 2014-08-04 09:28:36 +02:00
Anatol Belski 860f0ca1aa Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (46 commits)
  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
  add missing entries to NEWS
  add NEWS block for the next RC
  NEWS entry for #67713
  ...

Conflicts:
	Zend/zend_language_parser.y
	ext/odbc/php_odbc.c
	ext/openssl/openssl.c
	ext/spl/spl_directory.c
	ext/spl/spl_iterators.c
	ext/sqlite3/sqlite3.c
	ext/standard/array.c
2014-08-04 09:18:42 +02:00
Stanislav Malyshev fa42a513a4 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #67705 (extensive backtracking in rule regular expression)
  add test
  Fix bug #67705 (extensive backtracking in rule regular expression)
2014-08-04 00:15:38 -07:00
Christian Wenz 513d48f2ef Patches #67739
Fixes #67739: Windows 8.1/Server 2012 R2 OS build number reported as 6.2 (instead of 6.3)
2014-08-01 22:38:18 +02:00
Andrea Faulds fe894c2154 PHP_INT_MIN and _MAX tests 2014-08-01 17:01:17 +01:00
Andrea Faulds a2bbc6f985 Merge branch 'PHP_INT_MIN' 2014-08-01 16:29:34 +01:00
Andrea Faulds d6cf8be094 NEWS and UPGRADING 2014-08-01 16:28:20 +01:00
Andrea Faulds 24d7fc2bbc Added PHP_INT_MIN 2014-08-01 14:29:50 +01:00
Andrey Hristov 1d609d2d26 Merge branch 'PHP-5.6' 2014-07-31 21:28:19 +03:00
Peter Cowburn d5542c4a17 Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug #51096 - Remove unnecessary ? for first/last day of
2014-07-31 14:35:13 +01:00
Xinchen Hui 863a603fad Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-07-31 18:16:08 +08:00
Xinchen Hui 238a3167e6 Fixed valgrind issues 2014-07-31 18:15:47 +08:00
Dmitry Stogov 534dfa84a1 Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  Fixed getDefaultProperties (it should not return reference)
  Fixed invalid free
  Fixed segfault
2014-07-31 10:55:39 +04:00
Dmitry Stogov 449f3e6452 Fixed resource leak 2014-07-31 10:53:31 +04:00
Dmitry Stogov 7275306887 Fixed check for eval() 2014-07-31 10:52:48 +04:00
Dmitry Stogov c201ba8fff execute_data->return_value should be initialized when call internal constructors 2014-07-31 10:51:49 +04:00
Dmitry Stogov f693cf8e66 EA must be initialized 2014-07-31 10:50:27 +04:00
Xinchen Hui cf5b3ed31c Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-07-31 12:57:37 +08:00
Xinchen Hui be010e26c4 Fixed getDefaultProperties (it should not return reference) 2014-07-31 12:55:53 +08:00
Tjerk Meesters a41a16c5cd Merge branch 'PHP-5.6'
* PHP-5.6:
  Moved streams related functions to xp_ssl.c
2014-07-31 12:18:19 +08:00
Keyur Govande 33ce329f57 Merge branch 'PHP-5.6'
* PHP-5.6:
  Remove duplicate NEWS
  Update NEWS
  Update NEWS
  Update NEWS
2014-07-30 18:50:07 +00:00
Michael Wallner 03f56152e5 Merge branch 'PHP-5.6'
* PHP-5.6:
  BFN
  BFN
  Fixed bug #67715 (php-milter does not build and crashes randomly).
2014-07-30 20:14:40 +02:00
Rasmus Lerdorf e7d921fd0b Merge commit '8b9719d'
* commit '8b9719d':
  We need to turn off any strict mode here for this warning to show up
2014-07-30 12:23:46 -04:00
Bob Weinand 3c0adf2dcd Merge branch 'PHP-5.6' 2014-07-30 18:07:01 +02:00
Tjerk Meesters 0dc88c45b8 Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated NEWS for #67693
  Fixed bug #67693 - incorrect push to the empty array
2014-07-30 18:28:23 +08:00
Ferenc Kovacs ff5a934f21 Merge branch 'PHP-5.6'
* PHP-5.6:
  add missing entry to NEWS
2014-07-30 11:47:29 +02:00
Ferenc Kovacs 83c8cd591c Merge branch 'PHP-5.6'
* PHP-5.6:
  add missing entries to NEWS
2014-07-30 11:27:13 +02:00
Ferenc Kovacs 3c8cee0171 Merge branch 'PHP-5.6'
* PHP-5.6:
  add NEWS block for the next RC
2014-07-30 10:51:44 +02:00
Ferenc Kovacs f893b18544 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS entry for #67713
  update the exception message to better match the actual check
  ReflectionClass::newInstanceWithoutConstructor() should be allowed to instantiate every class except those internal classes with a final __construct()
2014-07-30 10:46:31 +02:00
Dmitry Stogov 8ad3445713 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed usage after free
2014-07-30 10:40:32 +04:00
Xinchen Hui 1f10013ac4 Fixed invalid free 2014-07-30 11:21:40 +08:00
Keyur Govande 0e04d542e9 Merge branch 'PHP-5.6'
* PHP-5.6:
  Undo inadvertent commit of php_version
  Corrected patch for bug #60616
2014-07-30 02:47:44 +00:00
Xinchen Hui 2147799524 Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-07-30 10:47:03 +08:00
Dmitry Stogov 70fb0e7519 Fixed incinsitency in passing arguments by reference to call_user_func() 2014-07-29 20:27:48 +04:00
Dmitry Stogov dda7e84f10 Fixed ext/standard/tests/array/unexpected_array_mod_bug.phpt 2014-07-29 18:19:41 +04:00
Dmitry Stogov 46fcd3fc08 Fixed callback registraion order in spl_autoload_register() 2014-07-29 16:23:56 +04:00
Dmitry Stogov 507e3b9193 fixed support for references 2014-07-29 15:29:22 +04:00
Tjerk Meesters 0120a9ca4b Merge branch 'PHP-5.6'
* PHP-5.6:
  Wildcards should only be used in the first name component; fixed comment style
2014-07-29 19:15:20 +08:00
Dmitry Stogov cad6408a3f Fixed Zend/tests/bug54265.phpt 2014-07-29 14:34:43 +04:00
Dmitry Stogov 046db57049 Fixed incorrect destruction (it might lead to crash) 2014-07-29 12:13:47 +04:00
Dmitry Stogov 21dec5f511 ext/interbase support (incomplete) 2014-07-29 10:15:01 +04:00
Xinchen Hui a0a4eb23ee Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-07-29 14:14:45 +08:00
Keyur Govande e7df0af6bd Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #60616 (odbc_fetch_into returns junk at end of multi-byte char fields)
2014-07-28 23:17:23 +00:00
Stanislav Malyshev fcd195aa64 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix SOAP for uninitialzed object
2014-07-28 11:38:20 -07:00
Stanislav Malyshev f281a315f7 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix NEWS
  Fix missing type checks in various functions
2014-07-28 00:39:24 -07: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 faaa0ffdc4 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add object initialization checks for sqlite3 classes
2014-07-26 16:58:09 -07:00
Xinchen Hui 55cc812fc7 Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-07-26 10:46:12 +08:00
Ferenc Kovacs 03dcdf5742 Merge branch 'PHP-5.6'
* PHP-5.6:
  Revert "Fix bug #66568: the second arg for unserialize is optional." as we already reverted the introduction of the second arg.
2014-07-25 13:16:31 +02:00
Stanislav Malyshev 7abaac41fd Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS
  Fixed bug #67539 (ArrayIterator use-after-free due to object change during sorting)
  Fixed Bug #67538 (SPL Iterators use-after-free)
2014-07-24 22:59:01 -07:00
Xinchen Hui ec441ff4ed Merge branch 'PHP-5.6' 2014-07-25 10:52:57 +08:00
Johannes Schlüter 0ac3d8d4f4 Merge branch 'PHP-5.6' 2014-07-24 18:02:00 +02:00
Johannes Schlüter 6fdbb4601f Merge branch 'PHP-5.6' 2014-07-24 16:59:37 +02:00
Dmitry Stogov 466816d4ef Fixed string destruction (class_name might be reused and stored somewhere in __autoload()). 2014-07-24 14:11:21 +04:00
Tjerk Meesters 4b41009064 Merge branch 'PHP-5.6' 2014-07-24 14:40:30 +08:00
Dmitry Stogov 7c6477ce37 Merge branch 'master' into phpng
* master:
  Removed second zval_copy_ctor()
  Fixed crash on self-referencing constant expression (part of a constant AST)
  Fixed support for constant arrays in context of "const" statement (Zend/tests/constant_expressions_arrays.phpt failed when opcache.protect_memort was set)

Conflicts:
	Zend/zend_ast.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/reflection/php_reflection.c
2014-07-24 01:54:21 +04:00
Dmitry Stogov 8fb7c4dc08 Merge branch 'PHP-5.6'
* PHP-5.6:
  Removed second zval_copy_ctor()
2014-07-24 01:16:28 +04:00
Dmitry Stogov 39740a33e5 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed crash on self-referencing constant expression (part of a constant AST)
2014-07-24 00:59:42 +04:00
Dmitry Stogov 4c37e69957 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed support for constant arrays in context of "const" statement (Zend/tests/constant_expressions_arrays.phpt failed when opcache.protect_memort was set)
2014-07-23 22:49:46 +04:00
Xinchen Hui 6b29880860 Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-07-23 11:05:29 +08:00
Xinchen Hui 5fb31215cb Fixed segfault 2014-07-23 11:05:03 +08:00
Dmitry Stogov 9583a14e75 Fixed potential memory leaks 2014-07-22 20:55:54 +04:00
Lior Kaplan ca273c31dd ZVAL_STRINGL takes only three variables
Follow up for commit f4cfaf36
2014-07-22 19:38:35 +03:00
Lior Kaplan 2334785f98 RETVAL_STRINGL takes only two variables
Follow up for commit f4cfaf36
2014-07-22 19:38:35 +03:00
Lior Kaplan 1953438ca0 RETVAL_STRING takes only one variable
Follow up for commit f4cfaf36
2014-07-22 19:38:35 +03:00
Lior Kaplan da81873a46 RETURN_STRINGL takes only two variables
Follow up for commit f4cfaf36
2014-07-22 19:38:35 +03:00
Dmitry Stogov f163f625e8 fixed "isset($array[true]);" 2014-07-22 18:40:29 +04:00
Dmitry Stogov f81956cb3e Fixed GC bug 2014-07-22 18:39:58 +04:00
Dmitry Stogov 5fe7f799e0 Fixed compatibility 2014-07-22 17:14:43 +04:00
Dmitry Stogov f2a2fccece Merge branch 'master' into phpng
* master:
  fix nmake snap when ext name is different in target dll
  force atoll macro usage on windows
  Enable $ replacement in exif, ldap, pdo_pgsql and tidy
  See bug #67635
  NEWS
  NEWS
  improve previous, add message during configure
  Fixed bug #67635 php links to systemd libraries without using pkg-config
  Improve fix for #66608
  Fixed segfault with empty break
  New added opcodes don't need to be resloved
  Update NEWS
  Update NEWS
  Update NEWS
  Fixed bug #66827 Session raises E_NOTICE when session name variable is array
  implemented copy libs of core exts in phpize mode
  fix copy the ext dll into the prefix path in phpize mode
  fix default prefix in phpize mode
  fix file with zero size usage in phpize mode

Conflicts:
	Zend/zend_opcode.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/session/session.c
2014-07-22 15:42:17 +04:00
Dmitry Stogov 821b8bbb39 Fixed support for executor override 2014-07-22 11:24:16 +04:00
Dmitry Stogov ea17b018d8 Fixed dtrace support 2014-07-22 11:12:49 +04:00
Anatol Belski 5cadd9d6d0 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-07-21 14:57:56 +02:00
Anatol Belski 222d59aeaa Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fix nmake snap when ext name is different in target dll
2014-07-21 14:57:51 +02:00
Anatol Belski be8f557e77 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix nmake snap when ext name is different in target dll
2014-07-21 14:57:19 +02:00
Anatol Belski b39f98cf81 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix nmake snap when ext name is different in target dll
2014-07-21 14:48:06 +02:00
Anatol Belski 457f1a3ad5 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  This test depends on expose_php being on
  fixed broken merged code
  Fixed a bug that cannot access custom request header stored in apache_request_headers() though array index.
  Test output relies on expose_php being on
  1.2 is a problematic float to print out Lower the default display precision for this test
  The test output is dependent on expose_php ini
  cleanup file headers.
  Do not kill children process in pre-fork mode when parent process quit.
  update year & copyright
  Fix bug #67587: Redirection loop on nginx with FPM
  Fix still broken session test.  Only return true/false.
  Followup fix to custom session save handlers
  Fix handling of session user module custom handlers.
  Update info.c

Conflicts:
	ext/session/mod_user.c
	main/php_content_types.c
2014-07-21 11:35:22 +02:00
Anatol Belski 6ac9e106af Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport: (132 commits)
  force atoll macro usage on windows
  Enable $ replacement in exif, ldap, pdo_pgsql and tidy
  See bug #67635
  NEWS
  NEWS
  improve previous, add message during configure
  Fixed bug #67635 php links to systemd libraries without using pkg-config
  Improve fix for #66608
  Fixed segfault with empty break
  New added opcodes don't need to be resloved
  Update NEWS
  Update NEWS
  Update NEWS
  Fixed bug #66827 Session raises E_NOTICE when session name variable is array
  implemented copy libs of core exts in phpize mode
  fix copy the ext dll into the prefix path in phpize mode
  fix default prefix in phpize mode
  fix file with zero size usage in phpize mode
  Update NEWS
  Fixed bug #66608 (Incorrect behavior with nested "finally" blocks)
  ...

Conflicts:
	main/php_content_types.c
2014-07-21 11:33:09 +02:00
Anatol Belski 6696cbcc9a Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  force atoll macro usage on windows
2014-07-21 10:07:39 +02:00
Anatol Belski 833e466983 Merge branch 'PHP-5.6'
* PHP-5.6:
  force atoll macro usage on windows
2014-07-21 10:01:48 +02:00
Anatol Belski 0ff7fb02e1 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (131 commits)
  Enable $ replacement in exif, ldap, pdo_pgsql and tidy
  See bug #67635
  NEWS
  NEWS
  improve previous, add message during configure
  Fixed bug #67635 php links to systemd libraries without using pkg-config
  Improve fix for #66608
  Fixed segfault with empty break
  New added opcodes don't need to be resloved
  Update NEWS
  Update NEWS
  Update NEWS
  Fixed bug #66827 Session raises E_NOTICE when session name variable is array
  implemented copy libs of core exts in phpize mode
  fix copy the ext dll into the prefix path in phpize mode
  fix default prefix in phpize mode
  fix file with zero size usage in phpize mode
  Update NEWS
  Fixed bug #66608 (Incorrect behavior with nested "finally" blocks)
  Enable build without atoll (e.g old AIX flavours)
  ...

Conflicts:
	Zend/zend_opcode.c
	ext/date/php_date.c
	ext/mysqli/mysqli.c
	ext/pgsql/pgsql.c
	ext/session/session.c
	ext/spl/spl_array.c
	ext/standard/http_fopen_wrapper.c
	ext/standard/string.c
	sapi/litespeed/lsapi_main.c
2014-07-21 09:26:43 +02:00
Lior Kaplan 128eda843f Merge branch 'PHP-5.6'
* PHP-5.6:
  Enable $ replacement in exif, ldap, pdo_pgsql and tidy
  Update NEWS
2014-07-21 01:50:51 +03:00
Remi Collet a9c8499d4b Merge branch 'PHP-5.6'
* PHP-5.6:
  See bug #67635
2014-07-20 11:16:09 +02:00
Remi Collet 6055a53d34 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  improve previous, add message during configure
  Fixed bug #67635 php links to systemd libraries without using pkg-config
2014-07-19 18:47:32 +02:00
Xinchen Hui 1c0e22f50c Merge branch 'PHP-5.6' 2014-07-19 17:19:57 +08:00
Xinchen Hui a3e8a10918 Merge branch 'PHP-5.6' 2014-07-19 13:12:56 +08:00
Yasuo Ohgaki 5ed63b3bfc Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66827 Session raises E_NOTICE when session name variable is array
2014-07-19 10:00:10 +09:00
Anatol Belski af676be066 Merge branch 'PHP-5.6'
* PHP-5.6:
  implemented copy libs of core exts in phpize mode
2014-07-18 18:41:31 +02:00
Anatol Belski 78f2496f8c Merge branch 'PHP-5.6'
* PHP-5.6:
  fix copy the ext dll into the prefix path in phpize mode
  fix default prefix in phpize mode
  fix file with zero size usage in phpize mode
2014-07-18 11:43:43 +02:00
Xinchen Hui 6cc487df2c Revert "stash" (pushed by accident)
This reverts commit a18bf5fc93.
2014-07-18 16:27:31 +08:00
Xinchen Hui 110bf9c720 Merge remote-tracking branch 'origin/master' into phpng
Conflicts:
	Zend/zend_compile.h
	ext/openssl/xp_ssl.c
2014-07-18 16:25:43 +08:00
Xinchen Hui f6f621ef69 Merge branch 'PHP-5.6' 2014-07-18 15:51:24 +08:00
Lior Kaplan 46dcd12d53 Merge branch 'PHP-5.6'
* PHP-5.6:
  Enable build without atoll (e.g old AIX flavours)
  Enable build without atoll (e.g old AIX flavours)
2014-07-17 23:11:33 +03:00
Anatol Belski 3690e973d2 Merge branch 'PHP-5.6'
* PHP-5.6:
  implemented usage of the non core ext deps in phpize mode
2014-07-17 21:49:23 +02:00
Anatol Belski 81c42db7b7 Merge branch 'PHP-5.6'
* PHP-5.6:
  implemented force usage of generated .h and .js deps in phpize mode
2014-07-17 09:32:44 +02:00
Xinchen Hui 4e378844ab Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-07-17 15:21:46 +08:00
Dmitry Stogov 2febfbab8e Micro optimization for the main interpreter loop 2014-07-17 11:18:44 +04:00
Anatol Belski eb10f035fc Merge branch 'PHP-5.6'
* PHP-5.6:
  basic routines for phpize mode to
  This test depends on expose_php being on
  Test output relies on expose_php being on
  1.2 is a problematic float to print out Lower the default display precision for this test
  The test output is dependent on expose_php ini
2014-07-16 21:35:18 +02:00
Andrey Hristov 24381cdeb2 Merge branch 'PHP-5.6' 2014-07-16 19:50:41 +03:00
Andrey Hristov 5d6805d498 Merge branch 'PHP-5.6'
Conflicts:
	NEWS
2014-07-16 19:25:31 +03:00
Xinchen Hui a18bf5fc93 stash 2014-07-16 16:35:48 +08:00
Daniel Lowrey a0cc25bbfb Merge branch 'PHP-5.6' 2014-07-16 00:15:05 -04:00
Andrea Faulds 7148a4cf03 Added -1 safety check, fixed test 2014-07-15 13:53:24 +01:00
Andrea Faulds 6692d15e26 php_error_docref 2014-07-15 13:48:55 +01:00
Dmitry Stogov 8217e20ddb Fixed compilation warnings 2014-07-15 15:51:40 +04:00
Dmitry Stogov b4c2bd2277 Fixed compilation on Windows 2014-07-15 15:50:42 +04:00
Andrea Faulds 97c6c48ae8 Fixed testcase 2014-07-15 02:08:26 +01:00
Andrea Faulds a521fe51d3 Implemented intdiv() 2014-07-15 00:35:26 +01:00
Anatol Belski 1fef4e87fc Merge branch 'PHP-5.6'
* PHP-5.6:
  fix C89 compat
  This test depends on expose_php being on
  The test output is dependent on expose_php ini
  1.2 is a problematic float to print out Lower the default display precision for this test
  Test output relies on expose_php being on
2014-07-14 20:28:23 +02:00
Rasmus Lerdorf 40955e27f7 This test depends on expose_php being on 2014-07-14 08:21:27 -07:00
Dmitry Stogov bcc677789c Fixed ZTS build 2014-07-14 15:46:09 +04:00
Dmitry Stogov af7cb16907 Implemented builtin instruction for strlen() 2014-07-14 15:43:11 +04:00
Dmitry Stogov 42c4bcaed1 Fixed ZTS build 2014-07-14 14:25:04 +04:00
Anatol Belski 61b91ee7db Merge branch 'PHP-5.6'
* PHP-5.6:
  added headers install to phpize mode
2014-07-14 09:53:47 +02:00
Dmitry Stogov 32e477c98c Merge branch 'master' into phpng
* master: (40 commits)
  Bug #67609: TLS connections fail behind HTTP proxy
  Updated NEWS for #67594
  Updated NEWS for #67594
  Fix #67594 - invisible colon should be stripped off header name
  Updated NEWS for 34407
  Updated NEWS for 34407
  Updated NEWS for 34407
  Fix for bug #34407 - ucwords and title case
  fixed broken merged code
  Fixed a bug that cannot access custom request header stored in apache_request_headers() though array index.
  fixed broken merged code
  Fixed a bug that cannot access custom request header stored in apache_request_headers() though array index.
  Fixed a bug that cannot access custom request header stored in apache_request_headers() though array index.
  Fixed a bug that cannot access custom request header stored in apache_request_headers() though array index.
  Test output relies on expose_php being on
  1.2 is a problematic float to print out Lower the default display precision for this test
  The test output is dependent on expose_php ini
  fix makefile in phpize mode
  fixe output_as_table() when no ext was enabled
  fix end of stream exception when generating makefile
  ...

Conflicts:
	ext/standard/http_fopen_wrapper.c
	ext/standard/string.c
	sapi/cli/php_cli_server.c
2014-07-14 11:44:53 +04:00
Xinchen Hui 0ef6f729c9 Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-07-14 14:34:51 +08:00
Dmitry Stogov 7dfb4f6b38 Implemented builtin instruction for type check functions - is_*() 2014-07-14 10:33:11 +04:00
Xinchen Hui b7ff8f28b2 Temporary fixed the invalid read warning 2014-07-14 14:01:53 +08:00
Daniel Lowrey 4bdb0120dc Merge branch 'PHP-5.6' 2014-07-12 10:57:30 -04:00
Tjerk Meesters 3a9bdafeff Merge branch 'PHP-5.6' 2014-07-12 15:11:18 +08:00
Tjerk Meesters 7de82eaeef Merge branch 'PHP-5.6' 2014-07-12 11:15:03 +08:00
George Wang e05fb6ee01 fixed broken merged code 2014-07-11 15:02:02 -04:00
George Wang 2d7625a1b8 Fixed a bug that cannot access custom request header stored in apache_request_headers() though array index. 2014-07-11 15:00:36 -04:00
Rasmus Lerdorf cf23a2efc5 Test output relies on expose_php being on 2014-07-11 10:59:02 -07:00
Rasmus Lerdorf a6d27b80b3 1.2 is a problematic float to print out
Lower the default display precision for this test
2014-07-11 10:29:40 -07:00
Rasmus Lerdorf e6fae4ca4f The test output is dependent on expose_php ini 2014-07-11 09:12:32 -07:00
Dmitry Stogov 6c8db864e0 Implemented builtin instruction for strlen() 2014-07-11 18:52:27 +04:00
Anatol Belski 7eaac0f605 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix makefile in phpize mode
2014-07-11 15:07:39 +02:00
Dmitry Stogov 27f38798a1 Fast parameter parsing API
This API is experemental. It may be changed or removed.
It should be used only for really often used functions.
(Keep the original parsing code and wrap usage with #ifndef FAST_ZPP)
2014-07-11 16:32:20 +04:00
Dmitry Stogov 8f229b2855 Optimized array_map() and array_combine() 2014-07-11 12:28:36 +04:00
Anatol Belski 646f0f4e47 Merge branch 'PHP-5.6'
* PHP-5.6:
  fixe output_as_table() when no ext was enabled
2014-07-11 09:38:59 +02:00
Anatol Belski efea4cc3e0 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix end of stream exception when generating makefile
2014-07-10 22:35:41 +02:00
Dmitry Stogov de306e7088 Implement call_user_func() and call_user_func_array() using special opcodes.
In some rare cases it leads to insignificant changes in error messages.
2014-07-11 00:32:18 +04:00
Anatol Belski 2f1c11b3e2 Merge branch 'PHP-5.6'
* PHP-5.6:
  cleanup file headers.
  Do not kill children process in pre-fork mode when parent process quit.
  update to LSAPI 6.6
2014-07-10 22:17:46 +02:00
Anatol Belski af994df812 Merge branch 'PHP-5.6'
* PHP-5.6:
  force ext_dep.js prepend to configure.js in phpize mode
  cleanup file headers.
  Do not kill children process in pre-fork mode when parent process quit.
  update to LSAPI 6.6
  Update LiteSpeed SAPI code to V6.4
  cleanup file headers.
  Do not kill children process in pre-fork mode when parent process quit.
  update to LSAPI 6.6
  Update LiteSpeed SAPI code to V6.4
  update year & copyright

Conflicts:
	sapi/litespeed/lsapilib.h
2014-07-10 22:05:15 +02:00
George Wang cf78e8324e cleanup file headers. 2014-07-10 15:12:43 -04:00
George Wang 942d64c1c3 Do not kill children process in pre-fork mode when parent process quit. 2014-07-10 14:59:25 -04:00
George Wang dd29cfed0a update year & copyright
Conflicts:
	sapi/litespeed/lsapi_main.c
2014-07-10 14:18:08 -04:00
Dmitry Stogov 4e291fab81 Fixed usage after free() 2014-07-10 21:45:09 +04:00
Anatol Belski e00a4b92a3 Merge branch 'PHP-5.6'
* PHP-5.6:
  turn off PGO in phpize mode
  Fixed typo in Makefile.frag
  Fixed typo in Makefile.frag
2014-07-10 19:37:36 +02:00
Dmitry Stogov d81b287ce1 Fixed delayed closure destruction and reference support 2014-07-10 18:36:11 +04:00
Anatol Belski e40ecb937e Merge branch 'PHP-5.6'
* PHP-5.6:
  explicitly PHP_ANALYZER=no when no known keyword was passed
2014-07-10 15:21:24 +02:00
Dmitry Stogov c85c795e46 Imporoved EXPECTED/UNEXPECTED macros to support not boolean expressions.
Fixed invalid EXPECTED() usage.
2014-07-09 19:32:09 +04:00
Dmitry Stogov 19729aa7fe Use data stored in current call frame instead of EG() if possible 2014-07-09 17:07:41 +04:00
Dmitry Stogov 9d6e45a0ee Changed zend_make_printable_zval() to return "use_copy" instead of additional reference argument.
Improved branch prediction.
2014-07-09 16:05:55 +04:00
Xinchen Hui d085f79aea Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-07-09 18:37:49 +08:00
Xinchen Hui d8431ba09c Merge branch 'master' into phpng 2014-07-09 18:35:30 +08:00
Xinchen Hui 674af28607 Merge branch 'PHP-5.6' 2014-07-09 18:35:13 +08:00
Xinchen Hui 2c71ea1a99 Merge branch 'PHP-5.5' into PHP-5.6 2014-07-09 18:35:01 +08:00
Dmitry Stogov f2a12d65fd Merge branch 'master' into phpng
* master:
  5.4.31
  update NEWS
  fix unstable test
  5.5.16 now
  fix unstable test
  Fix bug #67587: Redirection loop on nginx with FPM
  Fix bug #67587: Redirection loop on nginx with FPM
  Fix bug #67587: Redirection loop on nginx with FPM
  updated NEWS
  updated NEWS
  updated NEWS
  Backported the patch from bug #67407 into 5.5+
  Backported the patch from bug #67407 into 5.4
  NEWS
  5.6 have fpm_globals.force_stderr
  Fix Bug #67530 	error_log=syslog ignored
  NEWS
  NEWS
  Fix Bug #67530 	error_log=syslog ignored
  Update info.c
2014-07-09 14:07:37 +04:00
Dmitry Stogov d87140d8d8 Added missed warning (ext/spl/tests/iterator_035.phpt) 2014-07-09 13:30:47 +04:00
Dmitry Stogov 1dd07d6bf4 Partial fix that allows internal constructors to set $this to null.
The address of $this passed to drectly called internal constructor in execute_data->return_value.
Internal constructors should use ZEND_CTOR_MAKE_NULL() macro (insted of previous ZEND_NULL(EG(This))) to do the work.

This patch doesn't fix the problem for indirectly called constructors. e.g. parant::__construct().
2014-07-09 11:57:42 +04:00
Xinchen Hui fa82e05e4c Use ZEND_HASH_FOREACH_* macros 2014-07-09 15:13:56 +08:00
Stanislav Malyshev 25fe17bdcd Merge branch 'PHP-5.6'
* PHP-5.6:
  5.4.31
  fix unstable test
  5.5.16 now
2014-07-08 21:42:38 -07:00
Stanislav Malyshev 3119b884db Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS
2014-07-08 15:05:24 -07:00
Stanislav Malyshev b19c30c1fa Merge branch 'PHP-5.6'
* PHP-5.6:
  fix unstable test
2014-07-08 14:32:45 -07:00
Dmitry Stogov ca414c6904 Typo 2014-07-09 00:15:27 +04:00
Stanislav Malyshev 1632fbbd14 Merge branch 'pull-request/712'
* pull-request/712:
  Fix bug #67587: Redirection loop on nginx with FPM
2014-07-08 12:55:53 -07:00
Stanislav Malyshev ef2f12ec84 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #67587: Redirection loop on nginx with FPM
  Fix bug #67587: Redirection loop on nginx with FPM
2014-07-08 12:55:35 -07:00
Christian Weiske e76d3cba96 Fix bug #67587: Redirection loop on nginx with FPM
Redirection will work correctly as long as PATH_INFO is available,
e.g. via the following nginx configuration:

    set $path_info $fastcgi_path_info;
    fastcgi_param PATH_INFO $path_info;
2014-07-08 19:03:26 +02:00
Nikita Popov b5e36ec236 Make gdb dumpbt work again (at least partially) 2014-07-08 15:33:03 +02:00
Dmitry Stogov 3c4e64d633 Fixed IntlCalendar::toDateTime() 2014-07-08 17:28:09 +04:00
Dmitry Stogov 3ad4a8a5fa Separate argument passed by reference 2014-07-08 16:40:26 +04:00
Dmitry Stogov 7edb66c4ae Separate argument 2014-07-08 15:43:48 +04:00
Dmitry Stogov 31faac3250 Fixed attempt to modify immutable array 2014-07-08 15:24:08 +04:00
Xinchen Hui 549c5a5c1b Mismatched folder marks 2014-07-08 17:53:13 +08:00
Dmitry Stogov 9b9d60a480 Specify HashTable size and optimize inserts that may not conflict 2014-07-08 13:46:03 +04:00
Dmitry Stogov 0abd626269 code cleanup 2014-07-08 13:24:23 +04:00
Dmitry Stogov 73679bf6db Another fix for uninitialized execute_data->symbol_table 2014-07-08 12:17:52 +04:00
Anatol Belski 36644cc71e Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  updated NEWS
  updated NEWS
2014-07-08 10:08:40 +02:00
Anatol Belski 5391c23511 Merge branch 'PHP-5.6'
* PHP-5.6:
  Backported the patch from bug #67407 into 5.5+
  Backported the patch from bug #67407 into 5.4
  NEWS
  NEWS
  Fix Bug #67530 	error_log=syslog ignored
2014-07-08 09:57:56 +02:00
Anatol Belski 4883a60bb3 Merge branch 'pull-request/691' 2014-07-08 09:48:59 +02:00
Dmitry Stogov 7ba7dd1943 Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  Fixed uninitialized symbol_table
2014-07-08 11:33:18 +04:00
Dmitry Stogov 8ce2f2caac Merge branch 'master' into phpng
* master:
  Fix still broken session test.  Only return true/false.
  Fixed bug #66830 (Empty header causes PHP built-in web server to hang).
  Followup fix to custom session save handlers
  create locales and re-add test
  rm test for now

Conflicts:
	ext/session/tests/session_set_save_handler_class_012.phpt
2014-07-08 11:32:29 +04:00
Xinchen Hui e5fed097cc Fixed uninitialized symbol_table 2014-07-08 14:43:20 +08:00
Remi Collet b26c97b1a2 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  5.6 have fpm_globals.force_stderr
  Fix Bug #67530 	error_log=syslog ignored
2014-07-08 08:34:15 +02:00
Dmitry Stogov b36aaea6ed ZEND_SEND_VAR and ZEND_SEND_VAL specialization 2014-07-08 02:13:53 +04:00
Sara Golemon 6e9bc95f67 Fix still broken session test. Only return true/false. 2014-07-07 14:30:28 -07:00
Adam Harvey 1a43eac259 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66830 (Empty header causes PHP built-in web server to hang).
2014-07-07 20:49:00 +00:00
Sara Golemon 7c2489751c Followup fix to custom session save handlers
2d9885c introduced some regressions.  This addresses those.

  * Don't throw return type notice or session write failure when in an exception
  * Fix tests to properly return true/false since null is no longer falsy/successy
  * Rerecord a few tests to accomodate difference in raised warnings
2014-07-07 12:59:54 -07:00
Dmitry Stogov d9585f019f Skip useless ZEND_RECV opcodes 2014-07-07 22:18:48 +04:00
Stanislav Malyshev 888fb3323e Merge branch 'PHP-5.6'
* PHP-5.6:
  create locales and re-add test
2014-07-07 10:42:36 -07:00
Dmitry Stogov 21acbd5b75 Avoid useless check 2014-07-07 21:33:53 +04:00
Dmitry Stogov 7d0b21d3bc Function can't be "interactive" 2014-07-07 21:33:09 +04:00
Dmitry Stogov 2ed8a17045 Refactored run_time_cache usage in object handlers 2014-07-07 20:54:31 +04:00
Stanislav Malyshev fc56aa6829 Merge branch 'PHP-5.6'
* PHP-5.6:
  rm test for now
2014-07-07 09:34:03 -07:00
Dmitry Stogov bce6a36c8a Merge branch 'master' into test
* master: (48 commits)
  change locale - looks like not everybody has sl_SI
  Fix bug #66921 - Wrong argument type hint for function intltz_from_date_time_zone
  fix format
  Fix bug #67052 (NumberFormatter::parse() resets LC_NUMERIC setting)
  Make sure the generator script also creates a newline at the end of file
  Add newline at end of file to prevent compilation warning
  Fix handling of session user module custom handlers.
  Reference bug report instead of github issue in NEWS file
  add more exts for Travis
  Update NEWS
  Fix phpdbg.1 man page installation when build != src directory
  BFN for bug #67551 (php://input temp file will be located in sys_temp_dir instead of upload_tmp_dir)
  reorder
  restore API compatibility
  finish
  refactor php_stream_temp_create{,_ex} and use it for the php://input stream
  refactor _php_stream_fopen_{temporary_,tmp}file()
  fix length overflow of HTTP_RAW_POST_DATA
  Update NEWS
  Fixed bug #67215 (php-cgi work with opcache, may be segmentation fault happen)
  ...

Conflicts:
	ext/opcache/zend_accelerator_util_funcs.c
	ext/session/mod_user.c
	ext/spl/spl_array.c
	ext/spl/spl_dllist.c
	ext/standard/file.c
	ext/standard/streamsfuncs.c
	ext/standard/string.c
	main/streams/memory.c
2014-07-07 19:21:23 +04:00
Dmitry Stogov 477bd49cca Wrong expectation in tests (for some reason backtraces contained invlalid extra frame at the top) 2014-07-07 18:09:17 +04:00
Dmitry Stogov 4dd7c63d1e Wrong expectation in test (The error "Non-static method A::A_ftk() should not be called statically" is reported on caller side, so backtrace shouldn't include call to A::A_ftk()). 2014-07-07 17:27:16 +04:00
Dmitry Stogov e4450cddd4 Wrong expectation in test (for some reason error messages didn't refer to right functions) 2014-07-07 17:22:19 +04:00
Dmitry Stogov 2f316a775d Wrong expectation in test (for some reason backtrace misses gc_collect_cycles() call) 2014-07-07 17:17:42 +04:00
Dmitry Stogov 70a112e51b Wrong expectation in test (wrong line number in backtrace) 2014-07-07 16:57:05 +04:00
Dmitry Stogov 7ce2d59ad2 Merge branch 'call-frame' into phpng
* call-frame:
  Simplify call-frame handling
  Removed EG(active_symbol_table) and use corresponding value from EG(current_execute_data)
  Use values from current_execute_data instead of globals where possible
  Removed EG(called_scope) and use corresponding value from EG(current_execute_data)
  Removed EG(in_execution). If EG(currentent_execute_data) is not NULL we are executing something.
  Removed EG(opline_ptr) and use corresponding value from EG(current_execute_data)
  Removed EG(active_op_array) and use corresponding value from EG(current_execute_data)
  Uinified call frame handling for user and internal functions. Now EG(current_execute_data) always point to the call frame of the currently executed function.
  Fixed cleanup of incompleytely passed parameters
  Prohibited parameter redefinition
  Fixed support for extra arguments in conjunction with variadiv argument. Use compile time flags to check if we call constructor and result of ZEND_NEW is used or not.
  Fixed uninitialized variables
  Optimization
  Changed zend_execute_data layout to reduce memory overhead
  Help C compilet to do the better job optimizing target code
  Use fast comparison for (func->type == ZEND_USER_FUNCTION || func->type == ZEND_EVAL_CODE)
  Keep extra args in the same VM stack segment (after all CV and TMP vars)
  Refactoring: merge call_frame and end_execute_data into single data structure. Keep only single copy of each argument on VM stack (previously ZE kept two copies of each arguments for user functions)
  Refactoring: use call_frames instead of call_slots

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2014-07-07 16:19:24 +04:00
Dmitry Stogov 5aa91be509 Simplify call-frame handling 2014-07-07 15:50:44 +04:00
Stanislav Malyshev f0499b86a8 Merge branch 'PHP-5.6'
* PHP-5.6:
  change locale - looks like not everybody has sl_SI
2014-07-07 01:38:04 -07:00
Stanislav Malyshev 70c0410d3d Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #66921 - Wrong argument type hint for function intltz_from_date_time_zone
  fix format
2014-07-07 00:50:15 -07:00
Stanislav Malyshev ff52eac5f0 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #67052 (NumberFormatter::parse() resets LC_NUMERIC setting)
  Make sure the generator script also creates a newline at the end of file
  Add newline at end of file to prevent compilation warning
2014-07-07 00:38:50 -07:00
Stanislav Malyshev b3d8f4b24d Merge branch 'PHP-5.6'
* PHP-5.6:
  Reference bug report instead of github issue in NEWS file
2014-07-06 22:16:27 -07:00
Sara Golemon 2d9885c8cb Fix handling of session user module custom handlers.
According to the documentation, returning TRUE from
user based session handlers should indicate success,
while returning FALSE should indicate failure.

The existing logic relied on casting the return value
to an integer and returning that from the function.
However, the internal handlers use SUCCESS/FAILURE
where SUCCESS == 0, and FAILURE == -1, so the following
behavior map occurs:

  return false; => return 0; => return SUCCESS
  return true; => return 1; => return <undefined>

Since the session API checks against FAILURE,
both boolean responses wind up appearing like "not FAILURE".

This diff reasserts boolean responses to behave as
documented and introduces some special handling
for integer responses of 0 and -1 so that code can be
written for older and newer versions of PHP.
2014-07-06 09:40:35 -07:00
Xinchen Hui edf2f715e6 Let's rename it 2014-07-06 17:54:38 +08:00
Xinchen Hui d759ead04f Fixed convert (ext/intl finished) 2014-07-06 17:48:16 +08:00
Stanislav Malyshev 5b925824ed Merge branch 'PHP-5.6'
* PHP-5.6:
  add more exts for Travis
2014-07-05 22:34:57 -07:00
Bob Weinand 2c525b0881 Merge branch 'PHP-5.6' 2014-07-06 01:21:24 +02:00
Nikita Popov 439a95908b Fix leak when generator return value is not used 2014-07-05 15:07:25 +02:00
Nikita Popov 2d4c962c61 Fix ZTS build 2014-07-05 14:12:20 +02:00
Dmitry Stogov 6bf24f4dd0 Removed EG(active_symbol_table) and use corresponding value from EG(current_execute_data) 2014-07-04 18:03:45 +04:00
Dmitry Stogov d2890963e4 Use values from current_execute_data instead of globals where possible 2014-07-04 17:03:44 +04:00
Michael Wallner f9fda21667 Merge branch 'PHP-5.6'
* PHP-5.6:
  BFN for bug #67551 (php://input temp file will be located in sys_temp_dir instead of upload_tmp_dir)
  reorder
  restore API compatibility
  finish
  refactor php_stream_temp_create{,_ex} and use it for the php://input stream
  refactor _php_stream_fopen_{temporary_,tmp}file()
  fix length overflow of HTTP_RAW_POST_DATA

Conflicts:
	main/php_content_types.c
2014-07-03 20:43:12 +02:00
Xinchen Hui 21ccbbad7d Fixed segfault if empty POST 2014-07-03 23:58:21 +08:00
Xinchen Hui a99e7eeab9 Merge branch 'PHP-5.6' 2014-07-03 14:59:24 +08:00
Xinchen Hui 4ef8a44359 Merge branch 'PHP-5.6' 2014-07-03 10:52:03 +08:00
Dmitry Stogov c4d99ec982 Removed EG(called_scope) and use corresponding value from EG(current_execute_data) 2014-07-03 02:34:43 +04:00
Ferenc Kovacs a1c63413cd Merge branch 'PHP-5.6'
* PHP-5.6:
  also add Remi to the QA credits
  add Stas and Julient to the QA credits
2014-07-02 23:36:00 +02:00
Ferenc Kovacs f9b3494d99 Merge branch 'PHP-5.6'
* PHP-5.6:
  update the credits
2014-07-02 23:27:54 +02:00
Dmitry Stogov 0a77dcd4b9 Removed EG(in_execution). If EG(currentent_execute_data) is not NULL we are executing something. 2014-07-03 01:02:25 +04:00
Nikita Popov 99b95f3eb2 Merge branch 'PHP-5.6' 2014-07-02 22:41:04 +02:00
Ferenc Kovacs f574e69889 Merge branch 'PHP-5.6'
* PHP-5.6:
  adding a reproduce script for bug #49184
2014-07-02 22:39:19 +02:00
Nikita Popov 2d4d36d2a0 Merge branch 'PHP-5.6' 2014-07-02 22:35:19 +02:00
Adam Harvey 46055f8e99 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix ext/pgsql builds against libpq 7.3.
2014-07-02 12:30:51 -07:00
Dmitry Stogov 63c057e331 Removed EG(opline_ptr) and use corresponding value from EG(current_execute_data) 2014-07-02 23:29:53 +04:00
Dmitry Stogov 4b09dd69e6 Removed EG(active_op_array) and use corresponding value from EG(current_execute_data) 2014-07-02 22:03:21 +04:00
Dmitry Stogov 412ad4b254 Uinified call frame handling for user and internal functions.
Now EG(current_execute_data) always point to the call frame of the currently executed function.
2014-07-02 22:01:25 +04:00
Nikita Popov ac552cccc1 Merge branch 'PHP-5.6' 2014-07-02 17:37:25 +02:00
Bob Weinand 6b0beb9df1 Merge branch 'PHP-5.6' 2014-07-02 17:26:44 +02:00
Bob Weinand c01dcd325d Merge branch 'PHP-5.6' 2014-07-02 12:44:30 +02:00
Bob Weinand 0870cc8a7c Merge branch 'PHP-5.6' 2014-07-02 12:35:06 +02:00
Xinchen Hui 4cec7d479a Merge branch 'PHP-5.6' 2014-07-02 17:58:49 +08:00
Anatol Belski 4a0f06955d Merge branch 'PHP-5.6' 2014-07-02 11:36:15 +02:00
Anatol Belski df93242957 Merge branch 'PHP-5.6'
* PHP-5.6:
  backported the VC12 fix for ARG_MAX
2014-07-02 11:12:49 +02:00
Anatol Belski e98d429cc3 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master: (25 commits)
  Better fix for bug #67072 with more BC provisions
  Fix bug #67498 - phpinfo() Type Confusion Information Leak Vulnerability
  Fix bug #67492: unserialize() SPL ArrayObject / SPLObjectStorage Type Confusion
  Fix bug #67397 (Buffer overflow in locale_get_display_name->uloc_getDisplayName (libicu 4.8.1))
  Fix bug #67349: Locale::parseLocale Double Free
  Better fix for phpdbg + libedit - fix include - disable coloured prompt only with libedit
  Fix https://github.com/krakjoe/phpdbg/issues/91
  Update copyright year to 2014
  Add NEWS. This doesn't need UPGRADING (or an RFC), IMO.
  Fix broken test.
  Add a mime type map generation script and update the header.
  Move the mime type map out of php_cli_server.c for easier generation.
  Replace the CLI server's linear search for extensions with a hash table.
  fix test
  Fixed bug #67399 (putenv with empty variable may lead to crash)
  Remove superfluous echos.
  Remove usage of pointless COOKIE_SET_COOKIE constant.
  Test
  Added support for parsing ssl certificates using GeneralizedTime format.
  Fix align indentation
  ...

Conflicts:
	ext/standard/head.c
2014-07-02 10:30:36 +02:00
Anatol Belski 84876850ff Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport: (178 commits)
  fix integer overflow in {stream,file}_{get,put}_contents()
  add some missing NEWS entries
  NEWS block for 5.6.0RC3
  Fix ext/pgsql builds with libpq < 7.3.
  updated libs_version.txt
  updated libs_version.txt
  updated libmagic.patch in 5.6+
  updated libmagic.patch
  Fixed possible crash because of race conditions on modifying constants in shared memory
  remove the NEWS entry for the reverted fpm fix
  remove the NEWS entry for the reverted fpm fix
  remove the NEWS entry for the reverted fpm fix
  Revert "Fix Bug #67530 	error_log=syslog ignored"
  --enable-fpm for the travis build
  fix the last fpm NEWS entry, the other bug is related, but not the same what we fixed here
  NEWS
  NEWS
  Fix bug #67091: make install fails to install libphp5.so on FreeBSD 10.0
  adding NEWS entry for the fix for bug #65641
  Updated NEWS file for recent phpdbg fixes
  ...
2014-07-02 10:27:59 +02:00
Anatol Belski 96783bdfb7 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix integer overflow in {stream,file}_{get,put}_contents()
  add some missing NEWS entries
  NEWS block for 5.6.0RC3
  Fix ext/pgsql builds with libpq < 7.3.
  updated libs_version.txt
  updated libs_version.txt
  updated libmagic.patch in 5.6+
  updated libmagic.patch

Conflicts:
	ext/standard/file.c
	ext/standard/streamsfuncs.c
2014-07-02 10:22:09 +02:00
Michael Wallner 088eedfaa1 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix integer overflow in {stream,file}_{get,put}_contents()
2014-07-02 09:56:41 +02:00
Ferenc Kovacs ae312d1bca Merge branch 'PHP-5.6'
* PHP-5.6:
  add some missing NEWS entries
2014-07-02 02:19:12 +02:00
Ferenc Kovacs 72a182aaa8 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS block for 5.6.0RC3
2014-07-02 01:39:54 +02:00
Adam Harvey 5a99565d0e Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix ext/pgsql builds with libpq < 7.3.
2014-07-01 13:26:28 -07:00
Anatol Belski 444486c362 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libs_version.txt
  updated libs_version.txt
2014-07-01 10:35:16 +02:00
Anatol Belski 1f66da2e75 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libmagic.patch in 5.6+
  updated libmagic.patch
2014-07-01 10:29:14 +02:00
Anatol Belski 1a50c27f99 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (170 commits)
  Fixed possible crash because of race conditions on modifying constants in shared memory
  remove the NEWS entry for the reverted fpm fix
  remove the NEWS entry for the reverted fpm fix
  remove the NEWS entry for the reverted fpm fix
  Revert "Fix Bug #67530 	error_log=syslog ignored"
  --enable-fpm for the travis build
  fix the last fpm NEWS entry, the other bug is related, but not the same what we fixed here
  NEWS
  NEWS
  Fix bug #67091: make install fails to install libphp5.so on FreeBSD 10.0
  adding NEWS entry for the fix for bug #65641
  Updated NEWS file for recent phpdbg fixes
  Fixed issue krakjoe/phpdbg#94 - List behavior is inconsistent
  Fix issue krakjoe/phpdbg#97 - list now appends a newline if there is none The prompt should always ensure it is on a newline
  Fixed test
  Inform about back command existence in help - Fixes krakjoe/phpdbg#100 No way to list the current stack/frames
  Fix issue krakjoe/phpdbg#98 break if does not seem to work
  Fix issue krakjoe/phpdbg#99 register function has the same behavior as run
  Fix readline/libedit (Thanks to @remicollet)
  Replace incorrect `E` command with `ev` in watch help
  ...

Conflicts:
	Zend/zend_compile.c
	ext/standard/basic_functions.c
	ext/standard/http_fopen_wrapper.c
	ext/standard/var.c
	ext/tokenizer/tokenizer_data.c
	sapi/phpdbg/phpdbg_list.c
2014-07-01 09:10:36 +02:00
Dmitry Stogov 0b1cfdf390 Merge branch 'phpng' into call-frame
* phpng: (73 commits)
  refcount in phpng has different meanings
  Suppress warning "cast from pointer to integer of different size"
  Fixed possible crash because of race conditions on modifying constants in shared memory
  remove the NEWS entry for the reverted fpm fix
  remove the NEWS entry for the reverted fpm fix
  remove the NEWS entry for the reverted fpm fix
  Revert "Fix Bug #67530 	error_log=syslog ignored"
  Fixed compilation problems
  Refactored parameter passing mechanism.
  --enable-fpm for the travis build
  Fixed segfault while info printing
  fix the last fpm NEWS entry, the other bug is related, but not the same what we fixed here
  NEWS
  NEWS
  Fix bug #67091: make install fails to install libphp5.so on FreeBSD 10.0
  adding NEWS entry for the fix for bug #65641
  Updated NEWS file for recent phpdbg fixes
  Fixed issue krakjoe/phpdbg#94 - List behavior is inconsistent
  Fix issue krakjoe/phpdbg#97 - list now appends a newline if there is none The prompt should always ensure it is on a newline
  Fixed test
  ...
2014-07-01 10:11:13 +04:00
Xinchen Hui 96e3fd4c1d refcount in phpng has different meanings 2014-07-01 11:54:16 +08:00
Xinchen Hui 1d1226afa2 Suppress warning "cast from pointer to integer of different size" 2014-07-01 10:36:19 +08:00
Xinchen Hui 42bfa2382c Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-07-01 10:29:11 +08:00
Dmitry Stogov fd62771fe5 Merge branch 'master' into test
* master:
  Fixed possible crash because of race conditions on modifying constants in shared memory
2014-07-01 00:22:05 +04:00
Dmitry Stogov acfbb7b6dc Merge branch 'master' into test
* master: (67 commits)
  remove the NEWS entry for the reverted fpm fix
  remove the NEWS entry for the reverted fpm fix
  remove the NEWS entry for the reverted fpm fix
  Revert "Fix Bug #67530 	error_log=syslog ignored"
  --enable-fpm for the travis build
  fix the last fpm NEWS entry, the other bug is related, but not the same what we fixed here
  NEWS
  NEWS
  Fix bug #67091: make install fails to install libphp5.so on FreeBSD 10.0
  adding NEWS entry for the fix for bug #65641
  Updated NEWS file for recent phpdbg fixes
  Fixed issue krakjoe/phpdbg#94 - List behavior is inconsistent
  Fix issue krakjoe/phpdbg#97 - list now appends a newline if there is none The prompt should always ensure it is on a newline
  Fixed test
  Inform about back command existence in help - Fixes krakjoe/phpdbg#100 No way to list the current stack/frames
  Fix issue krakjoe/phpdbg#98 break if does not seem to work
  Fix issue krakjoe/phpdbg#99 register function has the same behavior as run
  Fix readline/libedit (Thanks to @remicollet)
  Replace incorrect `E` command with `ev` in watch help
  Fix typo in `finish` help
  ...

Conflicts:
	Zend/zend_ast.c
	Zend/zend_highlight.c
	Zend/zend_indent.c
	ext/spl/spl_array.c
	ext/spl/spl_observer.c
	ext/standard/info.c
2014-07-01 00:19:41 +04:00
Dmitry Stogov 8c9b3e664c Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed possible crash because of race conditions on modifying constants in shared memory
2014-07-01 00:17:55 +04:00
Ferenc Kovacs 2d26a7cf62 Merge branch 'PHP-5.6'
* PHP-5.6:
  remove the NEWS entry for the reverted fpm fix
  remove the NEWS entry for the reverted fpm fix
  remove the NEWS entry for the reverted fpm fix
  Revert "Fix Bug #67530 	error_log=syslog ignored"
2014-06-30 18:39:31 +02:00
Dmitry Stogov 424894de02 Fixed compilation problems 2014-06-30 18:08:16 +04:00
Dmitry Stogov b7715c7e8a Refactored parameter passing mechanism.
In PHP-5.6 and below each argument passed to user function was copies on VM stack twice.
Now we always have ZEND_INIT_FCALL (or simular) opcode that pushes "call frame" on top of VM stack.
"Call frame" is actually the same zend_execute_data structure.
All the following ZEND_SEND instructions push arguments on top of the stack in a way that they directly comes into corresponding CV variables of the called frame. Extra arguments are copied at the end of stack frame (after all CV and TMP variables) on function enterance.

There are two minor incompatibilities:
1) It's not allowed to decalre functions redefining arguments e.g. "function foo($a,$a) {}".
2) func_get_arg() and func_get args() return the current value of argument and not the original value that was sent.
2014-06-30 15:43:45 +04:00
Dmitry Stogov b4a7a1bacc Fixed cleanup of incompleytely passed parameters 2014-06-30 15:41:16 +04:00
Dmitry Stogov 45082daa3a Prohibited parameter redefinition 2014-06-30 15:40:28 +04:00
Ferenc Kovacs 62b45983f7 Merge branch 'PHP-5.6'
* PHP-5.6:
  --enable-fpm for the travis build
2014-06-30 12:31:25 +02:00
Dmitry Stogov 3f0ee308a0 Fixed support for extra arguments in conjunction with variadiv argument.
Use compile time flags to check if we call constructor and result of ZEND_NEW is used or not.
2014-06-30 14:17:17 +04:00
Xinchen Hui d660d7f599 Fixed segfault while info printing 2014-06-30 15:26:55 +08:00
Dmitry Stogov 6a092734ed Merge branch 'phpng' into call-frame
* phpng: (26 commits)
  Fixed reference handling in intltz_get_canonical_id
  Fixed reference handling in intltz_get_offset
  Fixed segfault in intlgregcal_create_instance
  Fixed segfault in resourcebundle
  Fixed iterators
  Fixed test
  Fixed memory leak
  Fixed retval with zend_call_method
  Fixed collator_sort
  Fixed test
  Fixed memory leaks
  Fixed segfault
  Fixed segfault temporarily (probably need to be reverted later)
  Fixed object properties init
  Fixed temporarily  un-expected object re-init
  Fixed segfault, segfault and segfault
  Fixed get_debug_info
  Intl's codes are really need more careful :<
  Fixed refernce handling
  Fixed initialize of zval
  ...
2014-06-30 10:01:16 +04:00
Xinchen Hui 9c96d966bb Fixed reference handling in intltz_get_canonical_id 2014-06-30 11:03:03 +08:00
Xinchen Hui a0b500df99 Fixed reference handling in intltz_get_offset 2014-06-30 11:01:26 +08:00
Ferenc Kovacs d9dbca8546 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix the last fpm NEWS entry, the other bug is related, but not the same what we fixed here
2014-06-30 02:32:46 +02:00
Ferenc Kovacs 6858be2e74 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  Fix bug #67091: make install fails to install libphp5.so on FreeBSD 10.0
2014-06-30 01:35:19 +02:00
Ferenc Kovacs c73e1f80f5 Merge branch 'PHP-5.6'
* PHP-5.6:
  adding NEWS entry for the fix for bug #65641
  Fix SetHandler proxy:fcgi:// incompatibilities
2014-06-30 01:03:29 +02:00
Xinchen Hui 499293449b Fixed segfault in intlgregcal_create_instance 2014-06-29 22:56:27 +08:00
Xinchen Hui f096bc4d86 Fixed segfault in resourcebundle 2014-06-29 22:30:32 +08:00
Xinchen Hui 7d492e3fd4 Fixed iterators 2014-06-29 21:54:39 +08:00
Xinchen Hui cdff5775dd Fixed test 2014-06-29 21:06:30 +08:00
Xinchen Hui f466be5e9b Fixed memory leak 2014-06-29 19:46:01 +08:00
Xinchen Hui a94ec141fe Fixed retval with zend_call_method 2014-06-29 19:07:06 +08:00
Bob Weinand ee6bab61eb Merge branch 'PHP-5.6' 2014-06-29 13:01:11 +02:00
Xinchen Hui 477f565f80 Fixed collator_sort 2014-06-29 19:01:02 +08:00
Xinchen Hui f2c83b774a Fixed test 2014-06-29 18:07:12 +08:00
Xinchen Hui fa3243a40a Merge remote branch 'origin/PHP-5.6' 2014-06-29 18:06:44 +08:00
Xinchen Hui 52c27f32fa Fixed memory leaks 2014-06-29 17:48:10 +08:00
Xinchen Hui 3b7e19ad73 Fixed segfault 2014-06-29 15:53:42 +08:00
Xinchen Hui 704e98072e Fixed segfault temporarily (probably need to be reverted later) 2014-06-29 15:45:08 +08:00
Xinchen Hui 0b12c08363 Fixed object properties init 2014-06-29 15:39:45 +08:00
Xinchen Hui 9fb8c16b6c Fixed temporarily un-expected object re-init 2014-06-29 15:28:55 +08:00
Xinchen Hui e1437022e1 Fixed segfault, segfault and segfault 2014-06-29 00:29:07 +08:00
Xinchen Hui 1d79334806 Fixed get_debug_info 2014-06-28 23:30:46 +08:00
Xinchen Hui ada2dd97d7 Intl's codes are really need more careful :< 2014-06-28 21:17:19 +08:00
Xinchen Hui d01e06e18a Fixed refernce handling 2014-06-28 21:09:07 +08:00
Xinchen Hui a1426c62d5 Fixed initialize of zval 2014-06-28 21:05:20 +08:00
Xinchen Hui 5614467c6b Fixed Calendar_objects_free 2014-06-28 20:58:50 +08:00
Xinchen Hui e328e890ac Fixed add_ref 2014-06-28 20:53:32 +08:00
Xinchen Hui b53bc5c762 Fixed segfaults 2014-06-28 20:52:41 +08:00
Xinchen Hui e4e9e80067 Fixed segfault while starting up 2014-06-28 20:14:12 +08:00
Xinchen Hui b6e9c76d67 Refactoring ext/intl (only compilerable now, far to finish :<) 2014-06-28 12:20:35 +08:00
Xinchen Hui 7614fe810e C++ doesn't allow implicitly convert void * to other pointer type 2014-06-28 11:19:38 +08:00
Dmitry Stogov 2f895de2ee Merge branch 'phpng' into call-frame
* phpng:
  Suppress warning
  Refactoring ext/intl (incompleted)
  Fixed build with libmysql
  C++ compiler doesn't allow cast a void * to other pointer type

Conflicts:
	Zend/zend_execute.h
2014-06-27 21:52:46 +04:00
Dmitry Stogov a3c8fbdd12 Fixed uninitialized variables 2014-06-27 21:13:05 +04:00
Dmitry Stogov 31087ee8b0 Optimization 2014-06-27 20:22:17 +04:00
Xinchen Hui 2f574e282e Suppress warning 2014-06-28 00:09:26 +08:00
Xinchen Hui e6338f5a62 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-06-28 00:03:26 +08:00
Xinchen Hui 4fbaddb4f8 Refactoring ext/intl (incompleted) 2014-06-28 00:02:50 +08:00
Xinchen Hui 2d67b36a92 Fixed build with libmysql 2014-06-27 23:58:55 +08:00
Ferenc Kovacs 6dc56dd8e8 Merge branch 'PHP-5.6'
* PHP-5.6:
  removing the format added by mistake, props to Solar Designer for spotting this.
2014-06-27 16:30:30 +02:00
Dmitry Stogov 7eebe22916 Changed zend_execute_data layout to reduce memory overhead 2014-06-27 16:24:29 +04:00
Dmitry Stogov 6b0c5ddcbc Help C compilet to do the better job optimizing target code 2014-06-27 15:48:25 +04:00
Dmitry Stogov d6bd21eab2 Use fast comparison for (func->type == ZEND_USER_FUNCTION || func->type == ZEND_EVAL_CODE) 2014-06-27 13:02:49 +04:00
Dmitry Stogov 032f33591a Keep extra args in the same VM stack segment (after all CV and TMP vars) 2014-06-27 12:25:36 +04:00
Remi Collet 6fa814cfc3 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fix Bug #67531 	syslog cannot be set in pool configuration
  Fix Bug #67530 	error_log=syslog ignored
2014-06-27 09:51:52 +02:00
Xinchen Hui f609d8c1c6 C++ compiler doesn't allow cast a void * to other pointer type 2014-06-27 12:35:34 +08:00
Stanislav Malyshev da7c6b6713 Merge branch 'PHP-5.6'
* PHP-5.6:
  update the date
  better explanation
  more extensive note on unserialize() change
  more extensive note on unserialize() change
2014-06-26 21:18:22 -07:00
Dmitry Stogov 04c87b9961 Merge branch 'phpng' into call-frame
* phpng:
  Reverted 387c491559 (it broke ext/standard/tests/file/bug44607.phpt)
  op2 is null terminated string
  IS_OBJECT and IS_RESOURCE is obviously exclusive
  No need to initialize it
  More optimizations
  Let's assume the name is already lowercased
  Save some strlen
  Use ZEND_HANDLE_NUMERIC
  Fixed stack usage
2014-06-27 01:28:58 +04:00
Dmitry Stogov 9af4b18b81 Reverted 387c491559 (it broke ext/standard/tests/file/bug44607.phpt) 2014-06-27 00:40:52 +04:00
Dmitry Stogov c69781393c Refactoring: merge call_frame and end_execute_data into single data structure. Keep only single copy of each argument on VM stack (previously ZE kept two copies of each arguments for user functions) 2014-06-26 23:51:14 +04:00
Xinchen Hui 387c491559 op2 is null terminated string 2014-06-26 22:13:24 +08:00
Xinchen Hui 46f4e9b56e IS_OBJECT and IS_RESOURCE is obviously exclusive 2014-06-26 18:29:25 +08:00
Xinchen Hui f75c04ac8d No need to initialize it 2014-06-26 18:10:18 +08:00
Xinchen Hui a7ce96d01f More optimizations 2014-06-26 18:09:04 +08:00
Xinchen Hui 64c5eb00b8 Let's assume the name is already lowercased 2014-06-26 17:56:55 +08:00
Xinchen Hui b8e8b3fcf4 Save some strlen 2014-06-26 16:11:24 +08:00
Bob Weinand 0b06c8f82b Merge branch 'PHP-5.6' 2014-06-25 13:57:19 +02:00
Xinchen Hui 4cdea779f9 Use ZEND_HANDLE_NUMERIC 2014-06-25 16:34:53 +08:00
Dmitry Stogov 0f9d5baba2 Merge branch 'phpng' into call-frame
* phpng:
  Remove temp file committed by accident
  Don't use zend_string for other fields (only name here is enough)
  Fixed _zend_get_parameters_array
  Fixed use of uninitialized value
  Cleanup (refactoring is finish)
  We don't need extra 1 byte anymore

Conflicts:
	Zend/zend_API.c
2014-06-25 11:12:32 +04:00
Xinchen Hui c25828e41e Fixed stack usage 2014-06-25 12:33:35 +08:00
Stanislav Malyshev b304a56685 Merge branch 'PHP-5.6'
* PHP-5.6:
  remove bug67072_2 test for 5.6+ since we'd have cleaner solution
  Fix test - because of big #67397 we don't allow overlong locales anymore
2014-06-24 11:24:40 -07:00
Stanislav Malyshev d4454ac31b Merge branch 'PHp-5.6'
* PHp-5.6:
  Better fix for bug #67072 with more BC provisions
  Fix bug #67498 - phpinfo() Type Confusion Information Leak Vulnerability
  Fix bug #67492: unserialize() SPL ArrayObject / SPLObjectStorage Type Confusion
  Fix bug #67397 (Buffer overflow in locale_get_display_name->uloc_getDisplayName (libicu 4.8.1))
  Fix bug #67349: Locale::parseLocale Double Free
  update NEWS
  5.4.30
  Better fix for bug #67072 with more BC provisions
  Fix bug #67498 - phpinfo() Type Confusion Information Leak Vulnerability
  update CVE
  Fix bug #67492: unserialize() SPL ArrayObject / SPLObjectStorage Type Confusion
  Fix bug #67397 (Buffer overflow in locale_get_display_name->uloc_getDisplayName (libicu 4.8.1))
  Fix bug #67349: Locale::parseLocale Double Free
  add CVEs
  Fix potential segfault in dns_get_record()
  Fix bug #66127 (Segmentation fault with ArrayObject unset)
  5.4.30 rc1

Conflicts:
	ext/intl/locale/locale_methods.c
2014-06-24 10:33:40 -07:00
Stanislav Malyshev 66cdd8fd76 Better fix for bug #67072 with more BC provisions 2014-06-24 10:32:33 -07:00
Stanislav Malyshev 3804c0d00f Fix bug #67498 - phpinfo() Type Confusion Information Leak Vulnerability 2014-06-24 10:32:12 -07:00
Stanislav Malyshev a374dfab56 Fix bug #67492: unserialize() SPL ArrayObject / SPLObjectStorage Type Confusion 2014-06-24 10:32:11 -07:00
Stanislav Malyshev 2a29add9e4 Fix bug #67397 (Buffer overflow in locale_get_display_name->uloc_getDisplayName (libicu 4.8.1)) 2014-06-24 10:32:11 -07:00
Stanislav Malyshev 5ecee6ebce Fix bug #67349: Locale::parseLocale Double Free 2014-06-24 10:31:55 -07:00
Xinchen Hui 58fc40d525 Remove temp file committed by accident 2014-06-25 00:52:05 +08:00
Xinchen Hui 8ce23d8f4f Don't use zend_string for other fields (only name here is enough) 2014-06-25 00:42:20 +08:00
Xinchen Hui 284141ca8f Fixed _zend_get_parameters_array
it should not decrease the refcount (spotted by
register_shutdown_function in ext/mysqli/tests/bug49442.phpt)
2014-06-25 00:39:37 +08:00
Xinchen Hui 18bde665f5 Merge branch 'PHP-5.6' 2014-06-24 13:53:43 +08:00
Stanislav Malyshev 52cdbc5c10 Merge branch 'PHP-5.6'
* PHP-5.6:
  Better fix for bug #67072 with more BC provisions
  Better fix for bug #67072 with more BC provisions
2014-06-23 22:15:21 -07:00
Dmitry Stogov 43477bc7a2 Refactoring: use call_frames instead of call_slots 2014-06-24 02:17:16 +04:00
Xinchen Hui ee30cc8a1e Fixed use of uninitialized value 2014-06-24 00:03:02 +08:00
Xinchen Hui 587923ccc8 Cleanup (refactoring is finish) 2014-06-23 23:33:38 +08:00
Xinchen Hui 305da4a88a We don't need extra 1 byte anymore 2014-06-23 22:58:09 +08:00
Dmitry Stogov ba45650d63 Fixed string destruction (ext/mysql/tests/mysql_list_fields.phpt was failed) 2014-06-23 17:18:47 +04:00
Dmitry Stogov 0c5a1b835e Fixed refcounting bug 2014-06-23 17:02:22 +04:00
Dmitry Stogov bbc508dea5 Fixed string deallocation and code cleanup 2014-06-23 17:01:59 +04:00
Xinchen Hui 56a966e88a Respect the origin behavior (fix one test: ext/pdo_mysql/tests/bug_33689.phpt) 2014-06-23 19:34:55 +08:00
Xinchen Hui 92a7089893 Use zend_string in mysqlnd 2014-06-23 19:27:24 +08:00
Xinchen Hui 64c6b9bd58 typo 2014-06-23 17:10:25 +08:00
Xinchen Hui b42f0ce5c4 Fixed segfault (we need to close it for it has referenced by somewhere) 2014-06-23 17:00:18 +08:00
Remi Collet 70e29fc24c Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  Better fix for phpdbg + libedit - fix include - disable coloured prompt only with libedit
  Fix https://github.com/krakjoe/phpdbg/issues/91
2014-06-23 10:39:22 +02:00
Xinchen Hui c84aff541f Fixed the trick.... 2014-06-23 16:29:48 +08:00
Remi Collet a52b927bf3 Merge branch 'PHP-5.6'
* PHP-5.6:
  Better fix for phpdbg + libedit - fix include - disable coloured prompt only with libedit
  Fix https://github.com/krakjoe/phpdbg/issues/91
2014-06-23 10:18:55 +02:00
Remi Collet 98d41dfc9d Better fix for phpdbg + libedit
- fix include
- disable coloured prompt only with libedit
2014-06-23 10:17:43 +02:00
Ferenc Kovacs f5defa1cf2 Merge branch 'PHP-5.6'
* PHP-5.6:
  testcase for 67468 (only for debug build, as I could not create a stable segfault without loading other exts like pgsql)
  mention 67468 fix in NEWS
  Fix Bug #67468  Segfault in highlight_file()/highlight_string() when pgsql.so module is loaded
2014-06-23 10:14:08 +02:00
Remi Collet 86bafec836 Fix https://github.com/krakjoe/phpdbg/issues/91
Enable edit feature when build with libedit.

Notice: coloured prompt only enable with READLINE
2014-06-23 10:04:40 +02:00
Xinchen Hui 2a06902488 Fixed compiler warning 2014-06-23 15:48:19 +08:00
Xinchen Hui c135ca0a9d Actually, I don't know how it works. (maybe I should re-start again :<) 2014-06-23 15:35:53 +08:00
Dmitry Stogov 87b667221e Code cleanup 2014-06-20 19:40:03 +04:00
Dmitry Stogov 3f041ff2cb Fixed compilation warnings 2014-06-20 15:04:38 +04:00
Dmitry Stogov 6ea228722b fixed memory leak 2014-06-20 15:04:25 +04:00
Dmitry Stogov 629c9d3eda Merge branch 'master' into phpng
* master:
  Fixed MarinaDB support
2014-06-20 14:02:15 +04:00
Dmitry Stogov 687fa7d63d Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed MarinaDB support
2014-06-20 14:01:22 +04:00
Dmitry Stogov 2777662694 Hide warning message after fatal errors 2014-06-20 13:31:43 +04:00
Dmitry Stogov 5152422194 Check if socket is still alive 2014-06-20 13:31:23 +04:00
Dmitry Stogov 36374ff32d Merge branch 'master' into phpng
* master:
  skip this test which fails without network
  add missing entry to NEWS
  add missing entry to NEWS
  add NEWS block for 5.6.0RC2
  Add support for gb18030/MySQL 5.7
  Fix another problem with MySQL 5.7
  new test, missing in ea466a3
  Suppress test failure with MySQL 5.7
2014-06-20 11:16:57 +04:00
Dmitry Stogov 3f11ddcfe3 Fixed compilation warning 2014-06-20 10:32:05 +04:00
Dmitry Stogov 7e9176731f Fixed compilation 2014-06-20 10:27:24 +04:00
Xinchen Hui d632870e4d Fixed memory leak 2014-06-20 13:27:56 +08:00
Xinchen Hui e091a91f43 Fixed bugs in binding result 2014-06-20 13:08:40 +08:00
Remi Collet ae9db5d0a2 Merge branch 'PHP-5.6'
* PHP-5.6:
  skip this test which fails without network
2014-06-20 06:45:36 +02:00
Xinchen Hui 80108a1607 Fixed PDO_PARAM_ZVAL 2014-06-20 11:40:53 +08:00
Xinchen Hui 73630a1fdc Fixed pdo_mysql build with mysqlnd 2014-06-19 23:00:45 +08:00
Xinchen Hui 33aa5eb6b6 Refcount may have different meaning in PHP NG 2014-06-19 22:36:48 +08:00
Xinchen Hui e2b182b24f Fixed mysqli_get_links_stats 2014-06-19 22:30:15 +08:00
Xinchen Hui d8a4b1affb Fixed paramters binding 2014-06-19 22:28:43 +08:00
Xinchen Hui 4cc3c7387b Fixed hash key in persistent hash 2014-06-19 16:24:24 +08:00
Xinchen Hui 46117aff49 Fixed releasing of hash_key 2014-06-19 16:20:21 +08:00
Xinchen Hui 82823e1e96 Fixed stat fields name 2014-06-19 16:16:41 +08:00
Xinchen Hui e0680cb170 Fixed reference handling of bind_result 2014-06-19 16:08:45 +08:00
Xinchen Hui f81498c8c8 Fixed invalid read 2014-06-19 15:56:35 +08:00
Xinchen Hui ffaf8beda7 Fixed segfault 2014-06-19 14:43:14 +08:00
Xinchen Hui 049e52f19b Fixed various bugs 2014-06-19 14:24:49 +08:00
Xinchen Hui b7b5fa111b Fixed MySQLi built with mysqlnd 2014-06-19 11:10:03 +08:00
Xinchen Hui 27e8e11ff9 unused variables 2014-06-19 10:46:23 +08:00
Ferenc Kovacs 7c20edaade Merge branch 'PHP-5.6'
* PHP-5.6:
  add missing entry to NEWS
2014-06-19 02:29:42 +02:00
Ferenc Kovacs deb650f182 Merge branch 'PHP-5.6'
* PHP-5.6:
  add missing entry to NEWS
2014-06-19 02:18:52 +02:00
Ferenc Kovacs 8bca4f0c32 Merge branch 'PHP-5.6'
* PHP-5.6:
  add NEWS block for 5.6.0RC2
2014-06-19 01:35:19 +02:00
Andrey Hristov 2eb42c953d Merge branch 'PHP-5.6'
Conflicts:
	NEWS
2014-06-18 21:54:26 +03:00
Xinchen Hui 17f35c9a29 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-06-18 23:37:47 +08:00
Xinchen Hui b38f6f3de9 Fixed various bugs (ext/mysql with mysqlnd tests pass) 2014-06-18 23:37:15 +08:00
Andrey Hristov af94a01ebe Merge branch 'master' of git.php.net:php-src 2014-06-18 18:31:07 +03:00
Andrey Hristov 29cef140ed Merge branch 'PHP-5.6' 2014-06-18 18:30:49 +03:00
Remi Collet e3b74cb168 Merge branch 'PHP-5.6'
* PHP-5.6:
  new test, missing in ea466a3
2014-06-18 16:00:07 +02:00
Dmitry Stogov b108267f2c Merge branch 'master' into phpng
* master: (41 commits)
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  NEWS
  Fix Request #67453 Allow to unserialize empty data.
  Update copyright year to 2014
  Update copyright year for re2c generated files
  Update copyright year to 2014
  Update copyright year for re2c files as well
  Fix patch for bug #67436
  fix failed test
  Fix test on modern distro where old unsecure algo are disabled in openssl config. Testing recent algo should be enough to check this function.
  Added tests for bug 67436
  Fixed wrong XFAIL test - already fixed
  Fix typo in Bug #67406 NEWS entry
  Fix typo in Bug #67406 NEWS entry
  ...

Conflicts:
	Zend/zend_compile.c
	ext/session/session.c
	ext/standard/array.c
	ext/standard/http_fopen_wrapper.c
	tests/classes/bug63462.phpt
2014-06-18 17:50:27 +04:00
Andrey Hristov ea1632d697 Merge branch 'PHP-5.6' 2014-06-18 16:45:12 +03:00
Dmitry Stogov a4f38192ec Use arena allocator for optimizer temporary data structures 2014-06-18 17:09:37 +04:00
Xinchen Hui 7032e1b96d Fixed warning message 2014-06-18 16:59:56 +08:00
Xinchen Hui d5c6816e86 Fixed memory leak while doing fetch 2014-06-18 16:10:51 +08:00
Xinchen Hui 98afbc7f75 Fixed segfaults 2014-06-18 15:43:15 +08:00
Xinchen Hui ac1d6abbef copy_data seems useless now 2014-06-18 15:13:43 +08:00
Xinchen Hui 2508d493d9 Fixed typo 2014-06-18 15:11:46 +08:00
Xinchen Hui 83d450c78d Fixed segfault of stream handling 2014-06-18 15:03:01 +08:00
Xinchen Hui 4c4dc8e239 Fixed plugin fetching 2014-06-18 14:26:17 +08:00
Xinchen Hui 2bd14a07fe Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-06-18 12:09:51 +08:00
Xinchen Hui 6288bb8ffe Refactoring mysqlnd (incompleted, only mysqlnd ext compilable) 2014-06-18 12:09:37 +08:00
Dmitry Stogov e1b18e59f7 Use arena allocator for zend_class_entry, zend_op_array and zend_property_info that live till the end of request 2014-06-18 02:47:01 +04:00
Lior Kaplan eba7c77685 Update copyright year to 2014 2014-06-18 00:22:16 +03:00
Lior Kaplan 9d047bb138 Merge branch 'PHP-5.6'
* PHP-5.6:
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
2014-06-18 00:21:20 +03:00
Dmitry Stogov 56731f68a7 Fixed HASH_FLAG_APPLY_PROTECTION flag usage 2014-06-17 13:53:23 +04:00
Remi Collet a012c2befa Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  Fix Request #67453 Allow to unserialize empty data.
2014-06-17 09:41:30 +02:00
Dmitry Stogov accaaf9d6e Don't include trailing zero into hash function 2014-06-17 02:59:00 +04:00
Dmitry Stogov a8e63d2b56 Fixed support for constants inherited from interfaces 2014-06-17 01:15:51 +04:00
Lior Kaplan 6e0a9b4588 Merge branch 'PHP-5.6'
* PHP-5.6:
  Update copyright year to 2014
  Update copyright year for re2c generated files
  Update copyright year to 2014
  Update copyright year for re2c files as well
2014-06-16 23:36:39 +03:00
Dmitry Stogov 909acec231 Avoid useles constants update 2014-06-16 23:32:58 +04:00
Dmitry Stogov 50cbd7f4ce Optimize out useles paths 2014-06-16 21:49:46 +04:00
Dmitry Stogov bd10db271c Use new zend_hash iteration API 2014-06-16 21:11:52 +04:00
Dmitry Stogov e181798405 Small call/return improvement 2014-06-16 13:25:23 +04:00
Bob Weinand b4d61c335b Merge branch 'PHP-5.6' 2014-06-16 11:20:05 +02:00
Dmitry Stogov 3b2fb7abc5 Fixed support for references 2014-06-16 13:08:48 +04:00
Remi Collet ced7f0ea12 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix failed test
2014-06-16 10:52:39 +02:00
Remi Collet 6b9fa109e0 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix test on modern distro where old unsecure algo are disabled in openssl config. Testing recent algo should be enough to check this function.
2014-06-16 09:44:58 +02:00
Xinchen Hui 17b98b6379 Refactoring imap (in progress) 2014-06-16 14:59:03 +08:00
Bob Weinand 8668f205ca Merge branch 'PHP-5.6' 2014-06-16 00:43:31 +02:00
Bob Weinand 02bea01f3d Merge branch 'PHP-5.6' 2014-06-15 23:56:14 +02:00
Bob Weinand 143cc3f0da Merge branch 'PHP-5.6' 2014-06-15 23:16:21 +02:00
Bob Weinand 1d71600394 Merge branch 'PHP-5.6' 2014-06-15 15:47:44 +02:00
Stanislav Malyshev 693535084d Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS
  update NEWS
  update NEWS
2014-06-15 01:08:16 -07:00
Derick Rethans b1a708b28c Merge branch 'PHP-5.6' 2014-06-13 23:26:50 +01:00
Matteo Beccati 7d2bcbe20c Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #67433 SIGSEGV when using count() on an object implementing Countable
2014-06-13 13:14:52 +02:00
Adam Harvey 64f85d5afa Merge branch 'PHP-5.6'
* PHP-5.6:
  Follow 308 Permanent Redirect responses.
2014-06-12 18:19:11 -07:00
Adam Harvey dd57ceb1de Merge branch 'PHP-5.6'
* PHP-5.6:
  Add 308 and 426 to the HTTP response code map in the CLI server.
2014-06-12 17:57:55 -07:00
Adam Harvey a92e3eb0fe Merge branch 'PHP-5.6'
* PHP-5.6:
  Keep 308-399 HTTP response codes when header('Location:') is called.
2014-06-12 17:42:29 -07:00
Andrea Faulds 2b5d25d1fc Merge branch 'httponly-cookies' of https://github.com/mj/php-src 2014-06-12 10:03:14 +01:00
Dmitry Stogov 83817ddb1c Fixed reference counting 2014-06-12 13:01:44 +04:00
Dmitry Stogov dd1c68e67f Merge branch 'master' into phpng
* master: (77 commits)
  NEWS entry for Fix potential segfault in dns_get_record()
  NEWS entry for "Fix potential segfault in dns_get_record()"
  NEWS entry for Fix potential segfault in dns_get_record(
  Fix potential segfault in dns_get_record()
  Revert "Add optional second arg to unserialize()"
  5.5.15 now
  update NEWS
  Fix bug #66127 (Segmentation fault with ArrayObject unset)
  5.4.31 next
  Add NEWS. This doesn't need UPGRADING (or an RFC), IMO.
  Fix broken test.
  Add a mime type map generation script and update the header.
  Move the mime type map out of php_cli_server.c for easier generation.
  Replace the CLI server's linear search for extensions with a hash table.
  fix test
  Remove unused included file
  NEWS
  NEWS
  NEWS
  Fixed Bug #67413 	fileinfo: cdf_read_property_info insufficient boundary chec
  ...

Conflicts:
	Zend/zend_closures.c
	Zend/zend_execute.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/spl/spl_array.c
	ext/standard/basic_functions.c
	ext/standard/dns.c
	ext/standard/var.c
2014-06-12 05:07:33 +04:00
Dmitry Stogov 593b125eb9 Fixed reference handling 2014-06-12 03:14:57 +04:00
Adam Harvey b853f99abf Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS entry for Fix potential segfault in dns_get_record()
  NEWS entry for "Fix potential segfault in dns_get_record()"
  NEWS entry for Fix potential segfault in dns_get_record(
  5.5.15 now
2014-06-11 21:44:07 +00:00
Dmitry Stogov edb064e2ee Fixed call to mysqli_init() from an object. (We should find some better fix) 2014-06-12 00:57:10 +04:00
Sara Golemon b34d7849ed Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix potential segfault in dns_get_record()
2014-06-11 13:53:59 -07:00
Dmitry Stogov bccd4184a5 Fixed error messages 2014-06-12 00:33:43 +04:00
Ferenc Kovacs ec974c4397 Merge branch 'PHP-5.6'
* PHP-5.6:
  Revert "Add optional second arg to unserialize()"
2014-06-11 14:59:39 +02:00
Dmitry Stogov 9f6db414f8 Improved assignment code 2014-06-11 15:11:29 +04:00
Dmitry Stogov 14e6ee7f42 Use absolute addresses as branch targets for NEW, FE_RESET and FE_FETCH 2014-06-11 11:39:42 +04:00
Stanislav Malyshev 6953d33d30 Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS
2014-06-10 23:25:01 -07:00
Stanislav Malyshev 6c81b14b2d Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #66127 (Segmentation fault with ArrayObject unset)
  5.4.31 next
2014-06-10 23:21:17 -07:00
Adam Harvey 61279dca69 Add NEWS. This doesn't need UPGRADING (or an RFC), IMO. 2014-06-11 00:31:04 +00:00
Adam Harvey f79f3ac184 Fix broken test. 2014-06-11 00:22:13 +00:00
Adam Harvey c12f832479 Add a mime type map generation script and update the header. 2014-06-11 00:19:49 +00:00
Adam Harvey 8c59ae345e Move the mime type map out of php_cli_server.c for easier generation. 2014-06-11 00:18:33 +00:00
Adam Harvey faa34f24e3 Replace the CLI server's linear search for extensions with a hash table.
This doesn't make a statistically significant performance impact either way
today, but gives us more scope to grow the MIME type list.
2014-06-10 23:57:42 +00:00
Dmitry Stogov 592c8a0426 Improved conditions order 2014-06-11 02:46:50 +04:00
Stanislav Malyshev ac6c86b7dc fix test 2014-06-10 14:25:49 -07:00
Xinchen Hui d461afc3a2 Merge branch 'PHP-5.6' 2014-06-10 21:58:31 +08:00
Xinchen Hui 3c69140a90 Remove unused codes 2014-06-10 21:53:46 +08:00
Remi Collet 0b6676ef87 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fixed Bug #67413 	fileinfo: cdf_read_property_info insufficient boundary chec
2014-06-10 14:36:38 +02:00
Remi Collet ed28d84b9a Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  Bug #67412 	fileinfo: cdf_count_chain insufficient boundary check
2014-06-10 14:24:28 +02:00
Remi Collet 59383273eb Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fixed Bug #67411 	fileinfo: cdf_check_stream_offset insufficient boundary check
2014-06-10 14:17:06 +02:00
Remi Collet 8cd184f14a Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fixed Bug #67410 fileinfo: mconvert incorrect handling of truncated pascal string size
2014-06-10 14:05:44 +02:00
Christian Wenz 60cc43a279 Update info.c
Fixes #67407: Windows 8.1/Server 2012 R2 reported as Windows 8/Server 2012
2014-06-10 10:42:23 +02:00
Remi Collet 39885d0819 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  Fixed bug #67406 built-in web-server segfaults on startup
2014-06-10 10:39:10 +02:00
Dmitry Stogov eb9b0baaa9 Optimized for fast path 2014-06-10 01:58:28 +04:00
Dmitry Stogov 15ba03fc80 Avoid repeatable zend_is_autogolobal() calls 2014-06-10 00:16:18 +04:00
Dmitry Stogov 7c045c61f0 Optimized for fast path 2014-06-10 00:15:44 +04:00
Dmitry Stogov 9a9bb8877e Improved ZTS support 2014-06-09 21:29:20 +04:00
Dmitry Stogov 371345bed6 Avoid reallocation 2014-06-09 17:36:37 +04:00
Ferenc Kovacs ab074b408a Merge branch 'PHP-5.6'
* PHP-5.6:
  enable phpdbg for the travis build, and also run the testsuite for it
2014-06-09 15:30:49 +02:00
Dmitry Stogov 2d29f2d8d9 Comparison optimization 2014-06-09 17:00:22 +04:00
Dmitry Stogov dbaef7c038 Avoid unnecessary memory allocation/deallocations and pcre calls 2014-06-09 15:42:32 +04:00
Dmitry Stogov 7bf4fa69be Avoid extra function call on hot path 2014-06-09 15:41:29 +04:00
Bob Weinand f0a9905759 Merge branch 'PHP-5.6' 2014-06-09 10:07:36 +02:00
Stanislav Malyshev 857618161f Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #67399 (putenv with empty variable may lead to crash)
  Fixed bug #67399 (putenv with empty variable may lead to crash)
  Fixed bug #67399 (putenv with empty variable may lead to crash)
2014-06-08 23:10:52 -07:00
Stanislav Malyshev b060880c87 Fixed bug #67399 (putenv with empty variable may lead to crash) 2014-06-08 23:10:44 -07:00
Matteo Beccati 8cfdf20ccf Fixed DOM tests when using libxml2 versions patched against CVE-2014-0191
DOMDocument::substituteEntities needs to be set to true in order for
external entities to be parsed.
2014-06-09 07:08:04 +02:00
Matteo Beccati 106b6faa7a Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed DOM tests when using libxml2 versions patched against CVE-2014-0191
2014-06-09 07:07:28 +02:00
Stanislav Malyshev d3eac6399b Merge branch 'PHP-5.6'
* PHP-5.6:
  update news
  add news
  Bug 49898 __getCookies() method implementation
2014-06-08 19:47:59 -07:00
Stanislav Malyshev 317dec0740 Merge remote-tracking branch 'github/pr/669'
* github/pr/669:
  Removed another cvsclean file
  Removed cvsclean and svnclean tools
2014-06-08 19:29:44 -07:00
Stanislav Malyshev 94b4748175 Merge branch 'PHP-5.6'
* PHP-5.6:
  Removed another cvsclean file
  Removed cvsclean and svnclean tools
2014-06-08 19:29:26 -07:00
Stanislav Malyshev c568a8e610 Merge remote-tracking branch 'github/pr/462'
* github/pr/462:
  Bug 64744 Show the type of the non-object for more descriptive errors
2014-06-08 19:19:36 -07:00
Stanislav Malyshev 9fceb05fcf Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug 64744 Show the type of the non-object for more descriptive errors
2014-06-08 19:18:09 -07:00
Stanislav Malyshev 659eeee164 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix order
  fix order
  add news
2014-06-08 19:05:10 -07:00
Stanislav Malyshev a17734fb04 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug 666222
  Fix bug 666222
2014-06-08 19:02:51 -07:00
Stanislav Malyshev 7e1e40209a Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed identation on file
  Fix align indentation
2014-06-08 15:54:49 -07:00
Stanislav Malyshev 224f369a03 Merge remote-tracking branch 'github/pr/671'
* github/pr/671:
  Fix align indentation
  Fixed identation on file
2014-06-08 14:29:03 -07:00
Stanislav Malyshev 6b4835d3e3 Merge branch 'pull-request/676'
* pull-request/676:
  Added support for parsing ssl certificates using GeneralizedTime format.
2014-06-08 14:20:30 -07:00
Stanislav Malyshev f0462db11a Merge branch 'PHP-5.6'
* PHP-5.6:
  Added support for parsing ssl certificates using GeneralizedTime format.
2014-06-08 14:20:07 -07:00
Stanislav Malyshev f22f665b47 Merge remote-tracking branch 'github/pr/677'
* github/pr/677:
  Test
  Fix grammar #2683
2014-06-08 14:02:20 -07:00
Stanislav Malyshev ee417600bc Merge branch 'pull-request/687'
* pull-request/687:
  Remove superfluous echos.
2014-06-08 13:53:40 -07:00
Stanislav Malyshev fce97414bc Merge branch 'PHP-5.6'
* PHP-5.6:
  Remove superfluous echos.
2014-06-08 13:53:27 -07:00
Jeff Welch ea543893d0 Remove superfluous echos. 2014-06-08 04:09:14 -04:00
Ferenc Kovacs 2b36a2747d Merge branch 'PHP-5.6'
* PHP-5.6:
  use ./tokenizer_data_gen.sh to for adding T_POW & T_POW_EQUAL
2014-06-08 00:18:33 +02:00
Ferenc Kovacs caf34bf189 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #67392: token_name() does not return name for T_POW and T_POW_EQUAL token
2014-06-07 15:29:29 +02:00
Remi Collet 3ef71630b1 Merge branch 'PHP-5.6'
* PHP-5.6:
  move NEWS entry in the right place
2014-06-06 17:19:57 +02:00
Nikita Popov 2adda06544 Merge branch 'PHP-5.6' 2014-06-06 17:13:08 +02:00
Dmitry Stogov dd0e96cca3 Bundle pcre-8.35 with sljit support 2014-06-06 18:46:19 +04:00
Remi Collet acf85d89ba Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fix bug #67390 insecure temporary file use in the configure script
2014-06-06 14:19:28 +02:00
Dmitry Stogov e499c3d259 Introduced new BIND_GLOBAL instraction instead of FETCH_W+ASSIGN_REF pair that caused a lot of useles checks 2014-06-06 15:04:30 +04:00
Anatol Belski 0e7bf92129 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  restore correct behavior of DateTime
  fix test use invalid code
  Fixed startup segfault in non-debug builds Fixes issue #87
  PHP 5.4/5.5 compability in phpdbg_watch.c
  fix gcov data with some locales (again)

Conflicts:
	ext/date/php_date.c
2014-06-06 09:06:48 +02:00
Anatol Belski df0794469d Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport: (35 commits)
  drop exec perm on doc files
  fix test for 5.4/5.5
  add test for previous fix
  NEWS
  NEWS
  NEWS
  Fix regression introduce in fix for bug #67118
  update news
  update NEWS
  Fix tests
  Fix possible segfault depending on memory location...
  fix gcov data with some locales (again)
  fix gcov data with some locales (again)
  Update NEWS
  Fixed startup segfault in non-debug builds Fixes issue #87
  Fixed regression introduced by patch for bug #67072
  Fixed bug #67329 fileinfo: NULL pointer deference flaw by processing certain CDF files
  (re)add cve number in NEWS, from 5.4.29
  NEWS
  NEWS
  ...
2014-06-06 09:04:37 +02:00
Anatol Belski d4cfc15514 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (24 commits)
  drop exec perm on doc files
  fix test for 5.4/5.5
  add test for previous fix
  NEWS
  NEWS
  NEWS
  Fix regression introduce in fix for bug #67118
  update news
  update NEWS
  Fix tests
  Fix possible segfault depending on memory location...
  fix gcov data with some locales (again)
  fix gcov data with some locales (again)
  Update NEWS
  Fixed startup segfault in non-debug builds Fixes issue #87
  Fixed regression introduced by patch for bug #67072
  Fixed bug #67329 fileinfo: NULL pointer deference flaw by processing certain CDF files
  (re)add cve number in NEWS, from 5.4.29
  NEWS
  NEWS
  ...

Conflicts:
	ext/date/php_date.c
2014-06-06 08:59:05 +02:00
Dmitry Stogov e4581fd6b8 GC doesn't count scalars and immutable arrays in the same way 2014-06-05 21:05:07 +04:00
Dmitry Stogov 1593d942e7 Fixed compilation warnings 2014-06-05 20:58:21 +04:00
Dmitry Stogov 717839735f Merge branch 'master' into phpng
* master: (29 commits)
  drop exec perm on doc files
  fix test for 5.4/5.5
  restore correct behavior of DateTime
  fix test use invalid code
  add test for previous fix
  NEWS
  NEWS
  NEWS
  Fix regression introduce in fix for bug #67118
  update news
  update NEWS
  Fix tests
  Fix possible segfault depending on memory location...
  Fixed startup segfault in non-debug builds Fixes issue #87
  PHP 5.4/5.5 compability in phpdbg_watch.c
  fix gcov data with some locales (again)
  fix gcov data with some locales (again)
  fix gcov data with some locales (again)
  Update NEWS
  Fixed startup segfault in non-debug builds Fixes issue #87
  ...
2014-06-05 20:54:50 +04:00
Remi Collet e16097626a Merge branch 'PHP-5.6'
* PHP-5.6:
  drop exec perm on doc files
2014-06-05 17:46:21 +02:00
Remi Collet ce3eae4c36 fix test for 5.4/5.5 2014-06-05 17:36:20 +02:00
Dmitry Stogov 1b8916886b Speedup string equality check 2014-06-05 19:14:47 +04:00
Dmitry Stogov 730beec16e Simplify code 2014-06-05 18:42:17 +04:00
Remi Collet f11f7f5601 restore correct behavior of DateTime 2014-06-05 14:04:44 +02:00
Dmitry Stogov c1965f58d4 Use reference counting instead of zval duplication 2014-06-05 16:04:11 +04:00
Remi Collet f1ef7018f0 fix test use invalid code 2014-06-05 14:01:20 +02:00
Remi Collet aafbf93841 Merge branch 'PHP-5.6'
* PHP-5.6:
  add test for previous fix
2014-06-05 14:00:40 +02:00
Remi Collet 2890284096 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fix regression introduce in fix for bug #67118
2014-06-05 13:47:14 +02:00
Stanislav Malyshev e8e907279e Merge branch 'PHP-5.6'
* PHP-5.6:
  update news
  update NEWS
  fix gcov data with some locales (again)
2014-06-04 01:11:40 -07:00
Dmitry Stogov 3d87391cc0 Reference counters in PHPNG may have different values 2014-06-04 09:57:17 +04:00
Bob Weinand 1e85b9e86b Merge branch 'PHP-5.6'
Conflicts:
	sapi/phpdbg/phpdbg.c
2014-06-04 02:20:35 +02:00
Dmitry Stogov 6e7338700e Avoid useless merge 2014-06-04 02:11:26 +04:00
Bob Weinand a1b0ae4247 Fixed startup segfault in non-debug builds
Fixes issue #87
2014-06-03 21:24:55 +00:00
Bob Weinand 241211975e PHP 5.4/5.5 compability in phpdbg_watch.c 2014-06-03 21:24:45 +00:00
Nuno Lopes 082f79de55 fix gcov data with some locales (again) 2014-06-03 17:21:20 -04:00
Anatol Belski 94d1014dc7 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed regression introduced by patch for bug #67072
2014-06-03 20:52:30 +02:00
Anatol Belski 2cdcf3e877 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #67329 fileinfo: NULL pointer deference flaw by processing certain CDF files
2014-06-03 11:38:19 +02:00
Remi Collet ec19c906bb Merge branch 'PHP-5.6'
* PHP-5.6:
  (re)add cve number in NEWS, from 5.4.29
2014-06-03 11:28:54 +02:00
Dmitry Stogov 3f6f0d5a70 Simplified and optimized ZEND_HANDLE_NUMERIC() 2014-06-03 13:10:42 +04:00
Remi Collet 7a00e8890b Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fix bug #67326	fileinfo: cdf_read_short_sector insufficient boundary check
2014-06-03 11:10:08 +02:00
Ferenc Kovacs 3fba1d308c Merge branch 'PHP-5.6'
* PHP-5.6:
  add NEWS block for 5.6.0RC1
2014-06-03 10:28:23 +02:00
Dmitry Stogov bc2ba841f9 Optimized conditions order 2014-06-03 09:45:09 +04:00
Dmitry Stogov 30c05577f7 Optimized conditions order 2014-06-03 03:54:03 +04:00
Dmitry Stogov af78ea1d97 Avoid copying of immutable arrays 2014-06-03 02:43:53 +04:00
Dmitry Stogov 2bc1abe204 cleanup 2014-06-03 02:43:31 +04:00
Dmitry Stogov 0427ae08fb cleanup 2014-06-03 00:36:31 +04:00
Anatol Belski 4dc952b190 fix macro 2014-06-02 08:45:32 +02:00
Anatol Belski 5cd607d1a7 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Update NEWs
  Update NEWs
  Fixed bug #67359 (Segfault in recursiveDirectoryIterator)
  Check for zero-length keys in spl_array_skip_protected and don't skip them.
  added CVEs in NEWS
  updated libmagic.patch for 5.6+
  updated libmagic.patch for 5.4+
  update NEWS
  Fix bug #67249: printf out-of-bounds read
  5.5.13 release date

Conflicts:
	ext/standard/formatted_print.c
2014-06-02 08:42:24 +02:00
Xinchen Hui 717b5661e7 Fixed merge 2014-06-01 23:14:31 +08:00
Xinchen Hui 91b2ddc816 Merge branch 'master' into phpng
Conflicts:
	ext/spl/spl_array.c
	ext/spl/spl_directory.c
	ext/standard/formatted_print.c
2014-06-01 22:43:06 +08:00
Xinchen Hui d196ac6a48 Merge branch 'PHP-5.6' 2014-06-01 19:42:53 +08:00
Dmitry Stogov 032bdbba73 Improved conditions order 2014-05-30 14:40:19 +04:00
Dmitry Stogov d2020cd91b Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  typo
  Revert "Fix ArrayObject with immutable array"
  Fix ArrayObject with immutable array
2014-05-30 11:13:19 +04:00
Dmitry Stogov 984c8f87d2 Avoid useless duplication of immutable arrays 2014-05-30 11:12:24 +04:00
Dmitry Stogov 45d7ab1a4c Avoid in-place modification 2014-05-30 11:12:03 +04:00
Xinchen Hui 9f70b2f6fa typo 2014-05-30 14:56:50 +08:00
Nikita Popov 92c9f826c9 Revert "Fix ArrayObject with immutable array"
This reverts commit 9c85aa0489.
2014-05-29 21:49:54 +02:00
Nikita Popov 9c85aa0489 Fix ArrayObject with immutable array 2014-05-29 21:19:49 +02:00
Adam Harvey f4a235c541 Merge branch 'PHP-5.6'
* PHP-5.6:
  Check for zero-length keys in spl_array_skip_protected and don't skip them.
  added CVEs in NEWS
2014-05-29 17:57:54 +00:00
Dmitry Stogov b3b616cf7e Introduced immutable arrays. They don't need to be copyed and may be used directly from SHM. 2014-05-29 18:21:56 +04:00
Nikita Popov bfff679d90 Fix length reset in JSON parser 2014-05-29 12:53:32 +02:00
Nikita Popov ccd9dab4c6 Fix $http_response_header creation 2014-05-29 12:51:03 +02:00
Nikita Popov d1ae74a1a5 Improve gdb ht and zval dumps 2014-05-29 12:47:40 +02:00
Nikita Popov 47e85b1b35 Improve class constant fetch fix
Dereference the cached constant for Test::TEST as well (and not just
self::TEST).

Also improve the phpt file to test this case as well - previously
this only manifested with opcache enabled, due to literal sharing.

Additionally the Z_TYPE_P != IS_REFERENCE assertion is now moved
into the TMP_VAR fetching code (as it applies to more than just
property assignments.)
2014-05-29 11:17:33 +02:00
Nikita Popov d9a35c7e97 Fix class constant fetching
If a class is extended after the constant fetch has been cached
the cached value will be turned into a reference. On the next
fetch the polymorphic cache will return this reference, which
will be directly returned. The object assignment code then
dereferences this result and performs a shallow copy, which is
invalid for references. This subsequently leads to the constant
value being prematurely freed.

This is fixed by dereferencing the value returned from the
polymorphic cache. Furthermore the incorrect dereference from
in the object assignment code is replaced with an assertion that
we're dealing with a non-reference, so ensure that this kind of
problem cannot go unnoticed in the future.
2014-05-29 00:15:50 +02:00
Nikita Popov afd8a02160 A few more fixes and improvements for gdbinit 2014-05-29 00:15:50 +02:00
Nikita Popov 411a8757ad Initialize GC_TYPE_INFO for EG(symbol_table) 2014-05-29 00:15:50 +02:00
Dmitry Stogov 8334f38615 Fixed conversion to phpng mistakes 2014-05-28 23:04:50 +04:00
Nikita Popov 9e2bc83fdb Use zend_long_to_str in wddx 2014-05-28 18:55:51 +02:00
Nikita Popov 3831b39302 Use zval_get_string in implode
Also get rid of separate case for IS_OBJECT - this is already
handled by the default branch.
2014-05-28 18:45:00 +02:00
Nikita Popov bf5a59d281 Use smart_str_append_long in implode 2014-05-28 18:39:41 +02:00
Nikita Popov 3f27d707d2 Use zend_long_to_str in curl
Also use STR_ADDREF instead of maintaining a numeric_key flag.
2014-05-28 18:34:35 +02:00
Nikita Popov 0987d19712 Use zend_long_to_str in pcntl 2014-05-28 18:26:11 +02:00
Nikita Popov a6d33eb654 Clamb gdb string output at 256 chars 2014-05-28 18:22:19 +02:00
Dmitry Stogov d0d62d3bb0 Use new zend_hash API 2014-05-28 18:45:01 +04:00
Dmitry Stogov 3419dc8c60 Use new zend_hash API 2014-05-28 18:12:52 +04:00
Dmitry Stogov 2af311bea3 Use new zend_hash API 2014-05-28 17:49:31 +04:00
Dmitry Stogov 4affab237d Use new zend_hash API 2014-05-28 17:43:11 +04:00
Dmitry Stogov b675492054 Use new zend_hash API 2014-05-28 17:30:05 +04:00
Dmitry Stogov 20f6dec6b6 Use new zend_hash API 2014-05-28 16:56:41 +04:00
Dmitry Stogov aca34b127a Use new zend_hash API 2014-05-28 14:09:42 +04:00
Dmitry Stogov a1177760b4 Use extended iteration API to avoid in-place modification 2014-05-28 13:00:33 +04:00
Dmitry Stogov 2625f145c8 Use extended iteration API to avoid in-place modification 2014-05-28 12:39:27 +04:00
Dmitry Stogov c9062917eb Use new zend_hash API 2014-05-28 12:34:08 +04:00
Dmitry Stogov a004c4fa80 Avoid in-place modification 2014-05-28 12:15:36 +04:00
Dmitry Stogov e598aab273 Use new zend_hash API 2014-05-28 12:15:16 +04:00
Dmitry Stogov 066ea2204e Avoid in-place modification 2014-05-28 10:15:15 +04:00
Dmitry Stogov cf603fb960 Reference counter in phpng may have a bit different meaning and must not be the same 2014-05-28 02:16:21 +04:00
Dmitry Stogov 6c4b30eb07 Use new zend_hash API 2014-05-28 02:13:45 +04:00
Dmitry Stogov 2dce4cb06c Avoid in-place conversion 2014-05-28 01:29:37 +04:00
Dmitry Stogov 864aa7746f Fixed refcounting 2014-05-28 01:28:38 +04:00
Anatol Belski 412feff4be Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libmagic.patch for 5.6+
  updated libmagic.patch for 5.4+
2014-05-27 22:40:17 +02:00
Stanislav Malyshev cca9f376f4 Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS
  Fix bug #67249: printf out-of-bounds read
  5.5.13 release date
2014-05-27 12:12:22 -07:00
Anatol Belski 112bf7331f Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  fix my last commit with some locales
2014-05-27 12:25:41 +02:00
Anatol Belski fa59cc202f Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fix zpp
  fix zpp
  Escape non-printable characters in the junit XML output
  Fixed broken XML junit output due to escaping of CDATA sections
  Fix #50444: PDO-ODBC changes for 64-bit
  update NEWS
  backport this piece from 5.6, related to the #66307 fix
  Fixed bug #66307 Fileinfo crashes with powerpoint files
  Fix bug #67328 (fileinfo: numerous file_printf calls resulting in performance degradation)
  Fix bug #67327: fileinfo: CDF infinite loop in nelements DoS
  fix my last commit with some locales
  fix my last commit with some locales
  Update NEWs and add a test
2014-05-27 12:25:31 +02:00
Anatol Belski 4796204a4c Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Escape non-printable characters in the junit XML output
  Fixed broken XML junit output due to escaping of CDATA sections
  Fix #50444: PDO-ODBC changes for 64-bit
  update NEWS
  backport this piece from 5.6, related to the #66307 fix
  Fixed bug #66307 Fileinfo crashes with powerpoint files
  Fix bug #67328 (fileinfo: numerous file_printf calls resulting in performance degradation)
  Fix bug #67327: fileinfo: CDF infinite loop in nelements DoS
  fix my last commit with some locales
  fix my last commit with some locales
  Update NEWs and add a test
2014-05-27 12:24:23 +02:00
Anatol Belski 9c20452ee0 fix zpp 2014-05-27 12:23:48 +02:00
Anatol Belski 638466a641 fix zpp 2014-05-27 12:22:15 +02:00
Matteo Beccati 5270563167 Escape non-printable characters in the junit XML output
XML doesn't allow most of the characters < 0x20 and binary output
breaks XML parsers. Such characters are not allowed as entities
either, so the generated entities are escaped in order to be printed
as text.
2014-05-27 12:04:52 +02:00
Matteo Beccati b85990fd8f Merge branch 'PHP-5.6'
* PHP-5.6:
  Escape non-printable characters in the junit XML output
2014-05-27 12:04:32 +02:00
Xinchen Hui 4c9f6caf39 Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-05-27 17:48:47 +08:00
Xinchen Hui 1966116791 retval's initializing is already taken by zend_call_function 2014-05-27 17:48:34 +08:00
Matteo Beccati 1b08c885ba Fixed broken XML junit output due to escaping of CDATA sections
I've removed CDATA and used htmlspecialchars as the output might not be UTF-8 safe, as pointed out by ircmaxell in 26b37f1792
2014-05-27 11:08:03 +02:00
Matteo Beccati 40fd85821b Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed broken XML junit output due to escaping of CDATA sections
2014-05-27 11:07:52 +02:00
Stanislav Malyshev 1887f9cce4 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix #50444: PDO-ODBC changes for 64-bit
2014-05-26 22:18:32 -07:00
Xinchen Hui 3a1f79d51d Fixed bug #47407 2014-05-27 11:48:25 +08:00
Stanislav Malyshev 43faeaa621 Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS
  backport this piece from 5.6, related to the #66307 fix
  Fixed bug #66307 Fileinfo crashes with powerpoint files
  Fix bug #67328 (fileinfo: numerous file_printf calls resulting in performance degradation)
  Fix bug #67327: fileinfo: CDF infinite loop in nelements DoS
  fix my last commit with some locales
  fix my last commit with some locales
2014-05-26 18:11:38 -07:00
Dmitry Stogov e34a6e9211 Use new zend_hash API 2014-05-27 00:38:58 +04:00
Nuno Lopes bdae3d2548 fix my last commit with some locales 2014-05-26 15:08:28 -04:00
Dmitry Stogov 05d0df4706 Use new zend_hash API 2014-05-26 21:29:35 +04:00
Nikita Popov 4ee14c6f8d Fix ** operator with references 2014-05-26 18:17:55 +02:00
Nikita Popov ff72c7bfd7 Add test for previous commit 2014-05-26 18:13:16 +02:00
Nikita Popov ec7b5e0b19 Fix incdec of ref object properties
This fixes a number of infinite loops in the Symfony testsuite. It
took an obscene amount of time to track this down :/
2014-05-26 18:00:15 +02:00
Dmitry Stogov 40256e0f9c Use specialized functions instead of macros 2014-05-26 17:16:16 +04:00
Dmitry Stogov 22f6cf91d5 Optimize func_get_args() to build packed array 2014-05-26 17:15:52 +04:00
Xinchen Hui 0df38cdcb6 Merge branch 'master' into phpng 2014-05-26 17:32:53 +08:00
Xinchen Hui b5f90e5103 Save some unnecessary zval copying 2014-05-26 17:25:57 +08:00
Xinchen Hui bd4b9837e9 Improve call_user_function performance
params are all zval * now, and retval will be initialized in
zend_call_function.

maybe we can make call_user_function as a macro proxy to
call_user_function_ex later.
2014-05-26 17:16:22 +08:00
Dmitry Stogov b66728aabb Removed useless initializations 2014-05-26 11:42:58 +04:00
Xinchen Hui cdacf4c90a Merge branch 'PHP-5.6' 2014-05-26 15:40:57 +08:00
Dmitry Stogov 79a3e44a0c Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  Finished persistent PDO implement
2014-05-26 10:53:14 +04:00
Dmitry Stogov 9dd66e4d53 Merge branch 'master' into phpng
* master:
  Fixed issue #183 (TMP_VAR is not only used once)
  Fix broken Junit output with --disable-cgi
  Added folder mark
  Further test fixes for the fdb2709 breakage.
  Fix broken test caused by fdb2709.
  Added tests for ZipArchive::addGlob() and ZipArchive::addPattern()
  Fix run-tests.php with Valgrind >= 3.10.0.
  Add microseconds to the serialised form of DateTime objects.
  Improved test for bug #62479
  fix typo in ODBC code
  gcov: tentative fix for broken coverage data after fix for opcache coverage slightly hackish, but works. The idea is that we want to give priority to .gcda files in .libs dirs vs the files in the upper level dir
  5.5.14 now
  Fix bug #67060: use default mode of 660

Conflicts:
	ext/date/php_date.c
2014-05-26 10:52:43 +04:00
Anatol Belski 567f5e5247 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Added tests for ZipArchive::addGlob() and ZipArchive::addPattern()
  gcov: tentative fix for broken coverage data after fix for opcache coverage slightly hackish, but works. The idea is that we want to give priority to .gcda files in .libs dirs vs the files in the upper level dir
  fix test
2014-05-26 08:51:32 +02:00
Anatol Belski a4a5e34ed9 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport: (29 commits)
  Fixed issue #183 (TMP_VAR is not only used once)
  Fix broken Junit output with --disable-cgi
  Added folder mark
  Further test fixes for the fdb2709 breakage.
  Fix broken test caused by fdb2709.
  Fix run-tests.php with Valgrind >= 3.10.0.
  Add microseconds to the serialised form of DateTime objects.
  Improved test for bug #62479
  fix typo in ODBC code
  Support for __debugInfo (Joe Watkins)
  Optimize ZEND_POW (Rouven Weßling)
  gcov: tentative fix for broken coverage data after fix for opcache coverage slightly hackish, but works. The idea is that we want to give priority to .gcda files in .libs dirs vs the files in the upper level dir
  gcov: tentative fix for broken coverage data after fix for opcache coverage slightly hackish, but works. The idea is that we want to give priority to .gcda files in .libs dirs vs the files in the upper level dir
  Prevent recursion in ZF2 Parameters class
  5.5.14 now
  adding NEWS block for beta4
  5.4.30 next
  enable email notifications
  update NEWS
  update NEWS
  ...

Conflicts:
	ext/opcache/ZendAccelerator.h
	ext/spl/spl_array.c
2014-05-26 08:39:06 +02:00
Anatol Belski 317e8058e0 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Fixed issue #183 (TMP_VAR is not only used once)
  Fix broken Junit output with --disable-cgi
  Added folder mark
2014-05-26 08:31:21 +02:00
Xinchen Hui 9fa9da4831 Finished persistent PDO implement 2014-05-26 14:17:45 +08:00
Dmitry Stogov 347b430a03 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed issue #183 (TMP_VAR is not only used once)
2014-05-26 10:12:36 +04:00
Xinchen Hui 066c1d5451 This seems better 2014-05-26 12:05:21 +08:00
Xinchen Hui 02fde346f8 Save one zval copy 2014-05-26 11:49:43 +08:00
Xinchen Hui 922285ec55 Don't use cast (compiler friendly) 2014-05-26 11:05:04 +08:00
Nikita Popov 0ade00c844 Fix print_flat_hash for objects 2014-05-25 20:07:29 +02:00
Nikita Popov bdeeddbb80 Fix parts of .gdbinit 2014-05-25 19:04:33 +02:00
Nikita Popov 43cf92edf6 Fix in_array (strict) with references 2014-05-25 18:19:00 +02:00
Nikita Popov 6714770d83 Fix ZTS build 2014-05-25 18:11:24 +02:00
Xinchen Hui bc357eaf3f Fixed apply_func_args_t 2014-05-25 20:04:35 +08:00
Xinchen Hui 0175d994c0 Fixed apply_func_arg_t, and it's better not using cast (compiler friendly) 2014-05-25 19:56:51 +08:00
Xinchen Hui c2082ece52 Fixed apply_func_t (they should be broken before) 2014-05-25 18:32:35 +08:00
Matteo Beccati 5d7f82745f Fix broken Junit output with --disable-cgi 2014-05-25 00:10:00 +02:00
Matteo Beccati 2c8ce5ba17 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix broken Junit output with --disable-cgi
2014-05-25 00:08:56 +02:00
Xinchen Hui 00e69ba164 typo 2014-05-24 21:45:07 +08:00
Xinchen Hui b87cff66b8 fci->retval is always set 2014-05-24 21:37:15 +08:00
Xinchen Hui 60e01e5d64 Added folder mark and codes style 2014-05-24 21:35:36 +08:00
Xinchen Hui dc8a53d4ba Merge branch 'PHP-5.6' 2014-05-24 21:11:26 +08:00
Anatol Belski 1d28acb437 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Further test fixes for the fdb2709 breakage.
  Fix broken test caused by fdb2709.
  Fix run-tests.php with Valgrind >= 3.10.0.
  Add microseconds to the serialised form of DateTime objects.
  Improved test for bug #62479
2014-05-24 13:58:35 +02:00
Xinchen Hui 9b730bf4bf Merge branch 'new-tests' of https://github.com/SammyK/php-src 2014-05-24 15:43:37 +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
Adam Harvey bbdbb6f7eb Merge branch 'PHP-5.6'
* PHP-5.6:
  Further test fixes for the fdb2709 breakage.
  Fix broken test caused by fdb2709.
2014-05-23 15:23:55 +00:00
Nikita Popov 8fbf4027e2 Remove incorrect EMPTY_SWITCH_DEFAULT_CASE() usage 2014-05-23 14:32:52 +02:00
Nikita Popov c838f6c5b9 Remove UB in signed printing macro
Signed->unsigned conversion and unsigned negation are well-defined
(unlike signed negation for LONG_MIN.)
2014-05-23 13:15:08 +02:00
Nikita Popov 1d8c499b51 Optimize int to string conversion
Probably platform depedentant, but for me snprintf is terribly
slow.

The code for the long printing is taken from the smart string
API.
2014-05-23 13:10:50 +02:00
Sammy Kaye Powers e2bbe95310 Added tests for ZipArchive::addGlob() and ZipArchive::addPattern() 2014-05-23 05:51:13 +00:00
Adam Harvey 93a98202d0 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix run-tests.php with Valgrind >= 3.10.0.
2014-05-22 22:43:39 +00:00
Nikita Popov 4778586896 Fix typo 2014-05-22 19:00:25 +02:00
Nikita Popov 6f0f8511f2 Assert that EMPTY_SWITCH_DEFAULT_CASE() cannot be reached in debug 2014-05-22 19:00:25 +02:00
Aidas Kasparas d339ddf417 Bug #41577 fix: reinitialization of dotnet_domain structure member 2014-05-22 09:54:44 +03:00
Christopher Jones 94d092dea3 Make a start on phpng compat 2014-05-21 16:43:44 -07:00
Adam Harvey 16a44b993f Merge branch 'PHP-5.6'
* PHP-5.6:
  Add microseconds to the serialised form of DateTime objects.
2014-05-21 15:06:30 -05:00
Matteo Beccati bb7638adbb Merge branch 'PHP-5.6'
* PHP-5.6:
  Improved test for bug #62479
2014-05-21 18:59:31 +02:00
Xinchen Hui f9c3d09f1c Fixed tests but introduce segfaults (behavior same as trunk) 2014-05-21 23:11:02 +08:00
Xinchen Hui ad1ef9b629 Refactored ext/pdo_firebird (didn't do test) 2014-05-21 15:52:36 +08:00
Xinchen Hui 59d74db108 Fixed segafult while stream is referenced by persistent resource (like dba) 2014-05-21 13:11:56 +08:00
Xinchen Hui 96617874bd Fixed persistent dba handling 2014-05-21 12:22:59 +08:00
Xinchen Hui 6d12d3bae1 Refactored ext/dba (tests passes, but segfaults need to be fixed) 2014-05-21 11:40:19 +08:00
Andrey Hristov 5d4f9dfff4 Second set of changes to mysqlnd for phpng.
A bit problematic is that the streams seem not to be completely ported.
Also there are some hacks in the streams about EG(regular_list) and EG(persistent_list)
and these need to be carefully checked. The test suite should catch them, however.
2014-05-20 21:50:15 +03:00
Andrey Hristov 5d57e17a15 First set of phpng changes for mysqlnd 2014-05-20 19:57:11 +03:00
Andrey Hristov 2312af04a7 Defensive check 2014-05-20 16:41:14 +03:00
Andrey Hristov 759f1009ad Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-20 14:51:16 +03:00
Andrey Hristov 90cad3de2f Add one more check to skip getting into code that will do nothing 2014-05-20 14:50:50 +03:00
Dmitry Stogov 01ef592fba Reverted last commit 2014-05-20 13:55:15 +04:00
Dmitry Stogov cf4d43e45b Fixed wrong test (see https://bugs.php.net/bug.php?id=67307) 2014-05-20 13:47:10 +04:00
Dmitry Stogov b5af9e8599 More accurate mysql_close() 2014-05-20 13:19:21 +04:00
Xinchen Hui b36afe8dd3 Refactoring ext/snmp 2014-05-20 17:02:29 +08:00
Xinchen Hui f2028491aa Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng
Conflicts:
	ext/pdo_pgsql/tests/common.phpt
2014-05-20 15:50:41 +08:00
Xinchen Hui 4d299b5092 Revert changes to configs by accident 2014-05-20 11:31:39 +08:00
Xinchen Hui 9c98c1f888 Refactored ext/ldap 2014-05-20 11:29:37 +08:00
Xinchen Hui e1317ed517 Refactored ext/ldap 2014-05-20 11:26:26 +08:00
Dmitry Stogov 0a68835bd4 Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  remove mysqlnd_bt.c as it a long dead code
2014-05-19 22:21:14 +04:00
Dmitry Stogov b38bb265d4 Fixed test. The warning actually indicate a problem in master that we didn't repeat in phpng. 2014-05-19 22:20:02 +04:00
Andrey Hristov e6e5d3535d remove mysqlnd_bt.c as it a long dead code 2014-05-19 20:32:41 +03:00
Dmitry Stogov 78e4f03c22 Fixed incorrect efree() 2014-05-19 16:19:01 +04:00
Dmitry Stogov a21e6d6ed9 Fixed double free 2014-05-19 13:11:20 +04:00
Dmitry Stogov 35f23d9ee7 Fixed incorrect Z_LVAL() usage 2014-05-19 12:51:48 +04:00
Dmitry Stogov 8506618850 Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  Fixed memleak (3 tests fails now)
  Fixed resources apply_dtor
  It's a zend_array not Hashtable (fixed segfault)
  Fixed segfault
  Refactoring ext/pgsql (incompleted, only compilable)
2014-05-19 11:53:06 +04:00
Dmitry Stogov 4e521c92ec Prevent crash in case of SQL error 2014-05-19 11:52:33 +04:00
Dmitry Stogov 4ea10696e8 Prevent double resource free 2014-05-19 11:50:38 +04:00
Anatol Belski ce8f7cb794 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix typo in ODBC code
  Support for __debugInfo (Joe Watkins)
  Optimize ZEND_POW (Rouven Weßling)
  gcov: tentative fix for broken coverage data after fix for opcache coverage slightly hackish, but works. The idea is that we want to give priority to .gcda files in .libs dirs vs the files in the upper level dir
  gcov: tentative fix for broken coverage data after fix for opcache coverage slightly hackish, but works. The idea is that we want to give priority to .gcda files in .libs dirs vs the files in the upper level dir
  Prevent recursion in ZF2 Parameters class
  5.5.14 now
  Fix bug #67060: use default mode of 660
2014-05-19 09:44:18 +02:00
Xinchen Hui a816032285 Fixed memleak (3 tests fails now) 2014-05-19 14:57:17 +08:00
Xinchen Hui 98f801ccbc Fixed resources apply_dtor 2014-05-19 14:53:02 +08:00
Xinchen Hui 09d2f4b195 It's a zend_array not Hashtable (fixed segfault) 2014-05-19 14:49:28 +08:00
Stanislav Malyshev 134d38118c Merge branch 'PHP-5.6'
* PHP-5.6:
  fix typo in ODBC code
  gcov: tentative fix for broken coverage data after fix for opcache coverage slightly hackish, but works. The idea is that we want to give priority to .gcda files in .libs dirs vs the files in the upper level dir
  5.5.14 now
  Fix bug #67060: use default mode of 660
2014-05-18 23:47:14 -07:00
Xinchen Hui ed554704f3 Fixed segfault 2014-05-19 14:44:59 +08:00
Xinchen Hui 1ff7c7b9a3 Refactoring ext/pgsql (incompleted, only compilable) 2014-05-19 14:25:30 +08:00
Xinchen Hui 82a4897446 Use new iterator macros 2014-05-19 10:55:09 +08:00
Xinchen Hui f2d1ace1b4 This should be this (broken compiling before) 2014-05-19 10:26:10 +08:00
Xinchen Hui 3eeb0dc9f7 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-19 10:21:13 +08:00
Dmitry Stogov 21da8af578 Removed the old hack that was originally developed to support constants in array indeces, and isn't needed anymore after the Bob's patch. 2014-05-19 01:20:56 +04:00
Dmitry Stogov d07c1941ec Use new hash iteration API and avoid old zend_hash_update_current_key() hack 2014-05-19 00:50:00 +04:00
Dmitry Stogov b11a30f5ea Merge branch 'master' into phpng
* master:
  Support for __debugInfo (Joe Watkins)
  Optimize ZEND_POW (Rouven Weßling)
  gcov: tentative fix for broken coverage data after fix for opcache coverage slightly hackish, but works. The idea is that we want to give priority to .gcda files in .libs dirs vs the files in the upper level dir
  gcov: tentative fix for broken coverage data after fix for opcache coverage slightly hackish, but works. The idea is that we want to give priority to .gcda files in .libs dirs vs the files in the upper level dir
  Prevent recursion in ZF2 Parameters class
  adding NEWS block for beta4
  5.4.30 next
  enable email notifications
  update NEWS
  update NEWS
  update NEWS
  - Updated to version 2014.3 (2014c)
  fix bug #67253: timelib_meridian_with_check out-of-bounds read
  Fix bug #67252: convert_uudecode out-of-bounds read
  Fix bug #67251 - date_parse_from_format out-of-bounds read
  Fix bug #67250 (iptcparse out-of-bounds read)

Conflicts:
	ext/opcache/zend_persist.c
	ext/spl/spl_array.c
2014-05-18 21:17:31 +04:00
Dmitry Stogov 91c475fc00 Merge branch 'PHP-5.6'
* PHP-5.6:
  Support for __debugInfo (Joe Watkins)
2014-05-18 20:56:34 +04:00
Dmitry Stogov 0019b512ff Merge branch 'PHP-5.6'
* PHP-5.6:
  Optimize ZEND_POW (Rouven Weßling)
  gcov: tentative fix for broken coverage data after fix for opcache coverage slightly hackish, but works. The idea is that we want to give priority to .gcda files in .libs dirs vs the files in the upper level dir

Conflicts:
	ext/opcache/ZendAccelerator.h
2014-05-18 20:51:37 +04:00
Nuno Lopes 4f8a84b2e7 gcov: tentative fix for broken coverage data after fix for opcache coverage
slightly hackish, but works. The idea is that we want to give priority to .gcda files in .libs dirs vs the files in the upper level dir
2014-05-18 11:21:05 -04:00
Tjerk Meesters 6aac353acc Merge branch 'PHP-5.6'
Conflicts:
	ext/spl/spl_array.c
2014-05-18 22:51:36 +08:00
Xinchen Hui 583bb6339b Merge branch 'phpng' of git.php.net:/php-src into phpng
Conflicts:
	ext/pdo/pdo_sql_parser.c
2014-05-18 21:06:44 +08:00
Xinchen Hui d86fa38cc5 Fixed uninitialized used 2014-05-18 21:04:43 +08:00
Xinchen Hui b0ecac6ba8 Fixed uninitialized used 2014-05-18 20:55:06 +08:00
Xinchen Hui 204e580fcd Fixed Hash API usage 2014-05-18 20:25:07 +08:00
Xinchen Hui af3829608d Fixed Hash API usage 2014-05-18 20:23:26 +08:00
Dmitry Stogov 32b58b2e07 phpng support for ext/readline 2014-05-18 15:49:35 +04:00
Dmitry Stogov 0c27dedb6a phpng support for ext/enchant 2014-05-18 15:04:04 +04:00
Dmitry Stogov 41336194b5 Fixed wrong condition 2014-05-18 13:28:06 +04:00
Dmitry Stogov c7e6d3acce Regenerated parser 2014-05-18 13:27:54 +04:00
Pierre Joye f3963e77ac Merge branch 'phpng' of git.php.net:php-src into phpng
# By Xinchen Hui
# Via Xinchen Hui
* 'phpng' of git.php.net:php-src:
  Fixed Hash API usage (it's in comments)
  Fixed Zend Hash API usage (although it's in comments)
  Fixed several tests failes
2014-05-18 11:19:31 +02:00
Pierre Joye fca1e0c574 more port to phpng, zend_string and hash, work in progress 2014-05-18 11:19:02 +02:00
Martin Jansen 068bf645e1 Remove usage of pointless COOKIE_SET_COOKIE constant. 2014-05-18 10:45:31 +02:00
Xinchen Hui 4ababc3a41 Fixed Hash API usage (it's in comments) 2014-05-18 12:09:14 +08:00
Xinchen Hui eb5c613311 Fixed Zend Hash API usage (although it's in comments) 2014-05-18 12:05:36 +08:00
Xinchen Hui 3cbdcdc2c8 Fixed several tests failes 2014-05-18 12:02:54 +08:00
Xinchen Hui 0d3cd2486a Finish ext/sockets 2014-05-18 12:02:05 +08:00
Pierre Joye 6223702cf4 fix smart string usage (work in progress), ps: a lot of len tests are done twice or more, rooms for cleanup here 2014-05-17 15:34:03 +02:00
Pierre Joye bd1aae54eb fix init, new smart_str struct (use zend_string now) 2014-05-17 15:29:25 +02:00
Pierre Joye 77ba802726 Merge branch 'phpng' of git.php.net:php-src into phpng
# By Dmitry Stogov
# Via Dmitry Stogov
* 'phpng' of git.php.net:php-src:
  Fixed new hash API usage
2014-05-17 15:05:48 +02:00
Dmitry Stogov feeebc2e05 Fixed new hash API usage 2014-05-17 11:48:29 +04:00
Pierre Joye e9eb642a36 fix hash API calls 2014-05-17 08:12:18 +02:00
Pierre Joye 81f45d50a1 fix signature according to apply_func_arg_t 2014-05-17 05:54:06 +02:00
Pierre Joye 0ba3aec5f7 only used if HAVE_NOFOLLOW 2014-05-17 05:50:01 +02:00
Pierre Joye c0bd24b502 Z_TYPE_PP > Z_TYPE_P 2014-05-17 05:44:26 +02:00
Pierre Joye 5939345fd5 Merge branch 'phpng' of git.php.net:php-src into phpng
# By Dmitry Stogov (5) and Xinchen Hui (3)
# Via Xinchen Hui (3) and Dmitry Stogov (2)
* 'phpng' of git.php.net:php-src:
  Fixed signed
  Refactoring socket (only compilable now)
  it make no sense to create a reference to object
  Initialize zvals
  Fixed <any> with XML references
  Refactored shmop
  Fixed pointer mess (use * instead of **)
  Fixed support for XML references
2014-05-17 05:42:00 +02:00
Pierre Joye 9b44d687df fix zend_hash_get_current_data_ptr_ex call 2014-05-17 05:41:21 +02:00
Xinchen Hui 84eeae80d8 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-17 10:39:05 +08:00
Xinchen Hui a4a1fc5552 Fixed signed 2014-05-17 10:28:54 +08:00
Xinchen Hui 489da59b08 Refactoring socket (only compilable now) 2014-05-17 10:23:46 +08:00
Dmitry Stogov fa4b281c56 Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  Refactored shmop
2014-05-16 20:21:08 +04:00
Dmitry Stogov fe7d22ddd4 it make no sense to create a reference to object 2014-05-16 20:20:17 +04:00
Dmitry Stogov e743089d55 Initialize zvals 2014-05-16 19:43:49 +04:00
Dmitry Stogov e159955d15 Fixed <any> with XML references 2014-05-16 18:11:28 +04:00
Xinchen Hui bcb4fcd305 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-16 22:02:19 +08:00
Xinchen Hui 8b7a3b2d05 Refactored shmop 2014-05-16 22:00:04 +08:00
Dmitry Stogov 89dbe07449 Fixed pointer mess (use * instead of **) 2014-05-16 16:56:36 +04:00
Dmitry Stogov 5eb273cfec Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  hash find returns zval* now
2014-05-16 16:35:37 +04:00
Dmitry Stogov 9d6b5e1f8e Fixed support for XML references 2014-05-16 16:35:00 +04:00
Pierre Joye 06fe7e1e15 Merge branch 'phpng' of git.php.net:php-src into phpng
# By Dmitry Stogov (3) and Xinchen Hui (1)
# Via Xinchen Hui
* 'phpng' of git.php.net:php-src:
  Fixed invalid read in ext/pdo/tests/pdo_025.phpt(pgsql)
  Fixed persistent WSDL cache
  Fixed wrong backtrace (__doRequest is not a static method). The "master" behavior is wrong.
  Restored __destructor() behavior
2014-05-16 14:32:46 +02:00
Pierre Joye c0ae699ca2 hash find returns zval* now 2014-05-16 14:31:20 +02:00
Xinchen Hui c7face7702 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-16 19:13:01 +08:00
Xinchen Hui d85e39cf4a Fixed invalid read in ext/pdo/tests/pdo_025.phpt(pgsql) 2014-05-16 19:11:38 +08:00
Dmitry Stogov 9df1dcd329 Fixed persistent WSDL cache 2014-05-16 14:36:54 +04:00
Dmitry Stogov 1da1b989cf Fixed wrong backtrace (__doRequest is not a static method). The "master" behavior is wrong. 2014-05-16 13:41:27 +04:00
Dmitry Stogov 87591db5f5 Restored __destructor() behavior 2014-05-16 13:15:24 +04:00
Pierre Joye e28662dd95 Merge branch 'phpng' of git.php.net:php-src into phpng
# By Dmitry Stogov
# Via Dmitry Stogov
* 'phpng' of git.php.net:php-src:
  Fixed support for <any>
2014-05-16 11:00:49 +02:00
Dmitry Stogov 9389ce8034 Fixed support for <any> 2014-05-16 12:41:45 +04:00
Pierre Joye c062b889f8 Merge branch 'phpng' of git.php.net:php-src into phpng
# By Xinchen Hui (3) and Dmitry Stogov (2)
# Via Xinchen Hui (3) and Dmitry Stogov (2)
* 'phpng' of git.php.net:php-src:
  Fixed iterator destruction
  Fixed uninitialized value used
  Finish ext/pdo_pgsql (3 tests fail, 1 due to knew issue, 2 also fails in trunk)
  Fixed memory leaks
  Fixed several test failed
2014-05-16 09:15:55 +02:00
Pierre Joye 3ebd7ec9cf wrong macro usage, we expect a DOM object here 2014-05-16 09:15:30 +02:00
Dmitry Stogov b258b112a4 Fixed iterator destruction 2014-05-16 11:12:32 +04:00
Xinchen Hui 6859890091 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-16 15:09:17 +08:00
Xinchen Hui 4aaab964d7 Fixed uninitialized value used 2014-05-16 14:59:16 +08:00
Dmitry Stogov 3e40a77c9f Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  Finish ext/pdo_pgsql (3 tests fail, 1 due to knew issue, 2 also fails in trunk)
  Fixed several test failed
2014-05-16 10:41:55 +04:00
Xinchen Hui 97da4ba079 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-16 14:40:42 +08:00
Xinchen Hui e8c2b54b9e Finish ext/pdo_pgsql (3 tests fail, 1 due to knew issue, 2 also fails in trunk) 2014-05-16 14:38:24 +08:00
Dmitry Stogov 98878d4e7d Fixed memory leaks 2014-05-16 10:37:59 +04:00
Pierre Joye 797c1660cb test the right length and remove unused var (remaining from 'old' version) 2014-05-16 08:27:21 +02:00
Xinchen Hui 417860f95d Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-16 14:20:54 +08:00
Xinchen Hui 34bb45e92d Fixed several test failed 2014-05-16 14:18:11 +08:00
Pierre Joye f28e0b0db7 fix TS build 2014-05-16 07:34:47 +02:00
Pierre Joye afeead0499 Merge branch 'phpng' of git.php.net:php-src into phpng
# By Dmitry Stogov
# Via Dmitry Stogov
* 'phpng' of git.php.net:php-src:
  Fixed WSDL attibute parsing
  fixed reference counting and memory leak
  Partial fix for XML references handling
  Fixed handling of compressed SOAP requests
  Fixed support for SOAP_PERSISTENCE_SESSION
  Fixed support for empty strings
  Buffer has to be reallocated on each loop iteration
  Support for IS_INDIRECT
  Buffer has to be reallocated on each loop iteration
2014-05-16 07:25:12 +02:00
Dmitry Stogov b1f88c9a13 Fixed WSDL attibute parsing 2014-05-16 02:36:52 +04:00
Dmitry Stogov 51c55a1ed3 fixed reference counting and memory leak 2014-05-16 02:04:50 +04:00
Dmitry Stogov 5a9de70ba7 Partial fix for XML references handling 2014-05-16 01:49:04 +04:00
Dmitry Stogov 9b8b55bc16 Fixed handling of compressed SOAP requests 2014-05-16 01:29:40 +04:00
Dmitry Stogov 7cb20d597f Fixed support for SOAP_PERSISTENCE_SESSION 2014-05-15 23:54:36 +04:00
Dmitry Stogov f31aa8434f Fixed support for empty strings 2014-05-15 23:16:21 +04:00
Dmitry Stogov f0da988282 Buffer has to be reallocated on each loop iteration 2014-05-15 22:58:58 +04:00
Dmitry Stogov ce8518e652 Support for IS_INDIRECT 2014-05-15 22:53:01 +04:00
Dmitry Stogov 2709d4f18b Buffer has to be reallocated on each loop iteration 2014-05-15 22:51:46 +04:00
Pierre Joye 47335ef956 fix casting 2014-05-15 20:30:30 +02:00
Pierre Joye a897591180 return ptr, not status 2014-05-15 20:14:29 +02:00
Pierre Joye 8a2a9379cf used only in the #ifdef 0 2014-05-15 20:09:49 +02:00
Pierre Joye f87d5001fc Merge branch 'phpng' of git.php.net:php-src into phpng
# By Dmitry Stogov
# Via Dmitry Stogov
* 'phpng' of git.php.net:php-src:
  Fixed wrong comparisons
2014-05-15 19:48:31 +02:00
Dmitry Stogov 16d3d5dc53 Fixed wrong comparisons 2014-05-15 21:06:39 +04:00
Pierre Joye 19f6476d19 fix void* ptr arithmetic 2014-05-15 18:09:50 +02:00
Pierre Joye dc4a39ca9c Merge branch 'phpng' of git.php.net:php-src into phpng
# By Dmitry Stogov (4) and others
# Via Xinchen Hui
* 'phpng' of git.php.net:php-src:
  Made a little clean up
  check for EG(excepton)
  key->len doesn't include trailing space anymore
  Fixed WSDL parsing
  add support for pdo-pgsql in phpng refactoring
  Fixed memory leaks
2014-05-15 17:53:44 +02:00
Xinchen Hui 5aa0856bae Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-15 22:35:06 +08:00
Xinchen Hui 49df66be01 Made a little clean up 2014-05-15 22:33:13 +08:00
Dmitry Stogov fba70c8362 check for EG(excepton) 2014-05-15 18:17:49 +04:00
Dmitry Stogov 3610c5cf02 key->len doesn't include trailing space anymore 2014-05-15 17:17:09 +04:00
Dmitry Stogov 40a8156966 Fixed WSDL parsing 2014-05-15 16:21:13 +04:00
nikita2206 b7f6bc5103 add support for pdo-pgsql in phpng refactoring 2014-05-15 16:18:50 +04:00
Dmitry Stogov 3e131b41b2 Fixed memory leaks 2014-05-15 16:18:19 +04:00
Pierre Joye bb0fb58beb Merge branch 'phpng' of git.php.net:php-src into phpng
# By Dmitry Stogov (1) and Xinchen Hui (1)
# Via Dmitry Stogov
* 'phpng' of git.php.net:php-src:
  Fixed hack. now we may store numbers not as pointers.
  Fixed two tests, 1 left
2014-05-15 12:03:58 +02:00
Dmitry Stogov f2324a3e0e Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  Fixed two tests, 1 left
  Refactored ext/xsl, need some help in 3 tests failed
2014-05-15 14:03:44 +04:00
Dmitry Stogov bc99c0debb Fixed hack. now we may store numbers not as pointers. 2014-05-15 14:00:49 +04:00
Xinchen Hui a031ced63b Fixed two tests, 1 left 2014-05-15 17:54:58 +08:00
Pierre Joye 17c68b9fd8 Merge branch 'phpng' of git.php.net:php-src into phpng
# By Dmitry Stogov (2) and Xinchen Hui (1)
# Via Dmitry Stogov (2) and Xinchen Hui (1)
* 'phpng' of git.php.net:php-src:
  Fixed zend_string/char* mess
  Refactored ext/xsl, need some help in 3 tests failed
  Fixed SoapFault handling
2014-05-15 11:50:09 +02:00
Xinchen Hui 08663e9107 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-15 17:45:35 +08:00
Dmitry Stogov 55b6fb1656 Fixed zend_string/char* mess 2014-05-15 13:44:13 +04:00
Xinchen Hui d74f5ab3df Refactored ext/xsl, need some help in 3 tests failed 2014-05-15 17:43:44 +08:00
Pierre Joye 5fa4e047b0 unused var 2014-05-15 11:36:40 +02:00
Dmitry Stogov 154976f711 Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  forgot that hash uses ending 0
  fix ts build
2014-05-15 13:35:03 +04:00
Dmitry Stogov 6f984ab1e8 Fixed SoapFault handling 2014-05-15 13:34:31 +04:00
Pierre Joye d5e6789439 Merge branch 'phpng' of git.php.net:php-src into phpng
# By Dmitry Stogov
# Via Dmitry Stogov
* 'phpng' of git.php.net:php-src:
  fixed refcounting
  Fixed destructive assignment
2014-05-15 10:56:48 +02:00
Pierre Joye 6ad1d7d831 forgot that hash uses ending 0 2014-05-15 10:39:35 +02:00
Pierre Joye 684506c4c8 fix ts build 2014-05-15 10:36:09 +02:00
Dmitry Stogov 88ba312808 fixed refcounting 2014-05-15 12:34:04 +04:00
Dmitry Stogov 5e7e299a34 Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  fix leak
  zend_hash_del>zend_hash_str_del
  unused local var
2014-05-15 12:32:15 +04:00
Dmitry Stogov 3d2b175339 Fixed destructive assignment 2014-05-15 12:29:52 +04:00
Pierre Joye 5609bcc757 fix leak 2014-05-15 10:23:50 +02:00
Pierre Joye e3e192ca98 Merge branch 'phpng' of git.php.net:php-src into phpng
# By Dmitry Stogov
# Via Dmitry Stogov
* 'phpng' of git.php.net:php-src:
  Fixed get_zval_property()
2014-05-15 10:17:11 +02:00
Pierre Joye 365446763f zend_hash_del>zend_hash_str_del 2014-05-15 10:16:19 +02:00
Dmitry Stogov 540070a999 Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  fix invalid use of STR_FREE > efree
  RETURN_STRING takes the char* only now (always copied)
  RETURN_STRING takes the char* only now
  fix build
2014-05-15 12:14:08 +04:00
Pierre Joye 6e84e4a28e unused local var 2014-05-15 10:12:02 +02:00
Dmitry Stogov d1c539ce67 Fixed get_zval_property() 2014-05-15 12:11:24 +04:00
Pierre Joye 39f0b585be Merge branch 'phpng' of git.php.net:php-src into phpng
# By Dmitry Stogov
# Via Dmitry Stogov
* 'phpng' of git.php.net:php-src:
  Fixed reference counting and memory leak
  Fixed SOAP error handling
  Array with var_args must not be deallocated any more
  Allow just set or get context passing NULL pointers
  Removed support for old-style resource destructors (only ext/soap used it)
2014-05-15 10:05:04 +02:00
Pierre Joye 15a887ca14 fix invalid use of STR_FREE > efree 2014-05-15 10:01:11 +02:00
Dmitry Stogov 926388620b Fixed reference counting and memory leak 2014-05-15 11:57:16 +04:00
Pierre Joye d8c6749649 RETURN_STRING takes the char* only now (always copied) 2014-05-15 09:56:20 +02:00
Pierre Joye 526c778e91 RETURN_STRING takes the char* only now 2014-05-15 09:54:52 +02:00
Dmitry Stogov 4c4df85988 Fixed SOAP error handling 2014-05-15 11:47:10 +04:00
Pierre Joye 6a3ee29785 fix build 2014-05-15 09:38:26 +02:00
Dmitry Stogov 76ada8d5e6 Array with var_args must not be deallocated any more 2014-05-15 11:14:45 +04:00
Dmitry Stogov 04456f8fab Allow just set or get context passing NULL pointers 2014-05-15 11:14:12 +04:00
Dmitry Stogov 281663f75d Removed support for old-style resource destructors (only ext/soap used it) 2014-05-15 10:57:03 +04:00
Pierre Joye 89a6d2bc53 Merge branch 'phpng' of git.php.net:php-src into phpng
# By Dmitry Stogov
# Via Dmitry Stogov
* 'phpng' of git.php.net:php-src:
  ext/soap support for phpng (incomplete - just compilable)
2014-05-15 08:24:07 +02:00
Dmitry Stogov c446e57588 ext/soap support for phpng (incomplete - just compilable) 2014-05-15 02:44:47 +04:00
zborboa-google ec7eccaaae Test 2014-05-14 13:11:51 -07:00
Pierre Joye 3ae86b9cce Merge branch 'phpng' of git.php.net:php-src into phpng
# By Stanislav Malyshev (15) and others
# Via Stanislav Malyshev (15) and others
* 'phpng' of git.php.net:php-src: (53 commits)
  Use defined macro
  Refactored tidy (all tests passes)
  Reverted wrong commit Xinchen, stop commit changed configs :) You may use environment variables to ovverride default settings
  Fixed reference counting, IS_REFERENCE and IS_INDIRECT support
  Terminate string Useproper hash function
  C89 compat
  Fixed curl_close() behavior
  In most user extensions functions like mysql_close() should use zend_list_close() instead of zend_list_delete(). This closes the actual connection and frees extension specific data structures, but doesn't free zend_reference structure that might be referenced from zval(s). This also doesn't decrement the resource reference counter.
  Fixed access to uninitialized data and attempt to double free
  Fixed safe resource close. It must not de deleted (just closed), because it still may be referenced from zval(s). This fixes few ext/ftp test memory failures detected with valgrind.
  Nested PCRE calls may clobber extra->mark and it has to be reinitailized This fixes invalid memory writes (detected with valgrind) in Zend/tests/closure_047.phpt and Zend/tests/closure_048.phpt.
  Added comment
  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
  ...
2014-05-14 20:06:58 +02:00
Pierre Joye 21d270dbaa fix windows build 2014-05-14 20:06:18 +02:00
Pierre Joye 01513976e7 ptr needed here 2014-05-14 20:05:54 +02:00
Anatol Belski 4fb177b916 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  adding NEWS block for beta4
2014-05-14 13:02:08 +02:00
Xinchen Hui b57b1ff495 Use defined macro 2014-05-14 16:54:14 +08:00
Xinchen Hui 0f6c93d620 Refactored tidy (all tests passes) 2014-05-14 16:44:07 +08:00
Ferenc Kovacs 886fafc34f Merge branch 'PHP-5.6'
* PHP-5.6:
  adding NEWS block for beta4
2014-05-14 09:14:57 +02:00
Anatol Belski 1ddecc9d12 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (32 commits)
  5.4.30 next
  enable email notifications
  update NEWS
  update NEWS
  update NEWS
  - Updated to version 2014.3 (2014c)
  fix test - output can be chunked
  fix test
  Fixed test for commit 997be125eb
  Add bug fix to NEWS
  Update UPGRADING according to bug fix
  improve CURL tests to allow testing without separate server
  Fixed bug #67199	mb_regex_encoding mishmash
  fix bug #67253: timelib_meridian_with_check out-of-bounds read
  Fix bug #67252: convert_uudecode out-of-bounds read
  Fix bug #67251 - date_parse_from_format out-of-bounds read
  Fix bug #67250 (iptcparse out-of-bounds read)
  Fix bug #67248 (imageaffinematrixget missing check of parameters)
  Fix bug #67247	spl_fixedarray_resize integer overflow
  fix news
  ...

Conflicts:
	ext/gd/gd.c
	ext/standard/iptc.c
2014-05-14 08:21:12 +02:00
Stanislav Malyshev 5b9f7ee147 Merge branch 'PHP-5.6'
* PHP-5.6:
  5.4.30 next
2014-05-13 22:22:13 -07:00
Stanislav Malyshev 4fd19c0397 Merge branch 'PHP-5.6'
* PHP-5.6:
  enable email notifications
2014-05-13 17:15:09 -07:00
Stanislav Malyshev fedb908b58 Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS
  update NEWS
  update NEWS
2014-05-13 17:09:30 -07:00
Stanislav Malyshev 3c107d6434 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix bug #67253: timelib_meridian_with_check out-of-bounds read
  Fix bug #67252: convert_uudecode out-of-bounds read
  Fix bug #67251 - date_parse_from_format out-of-bounds read
  Fix bug #67250 (iptcparse out-of-bounds read)
2014-05-13 17:04:44 -07:00
Paul Oehler f148026017 Added support for parsing ssl certificates using GeneralizedTime format.
fix bug #65698
fix bug #66636
2014-05-13 18:32:15 -04:00
Dmitry Stogov c25f09e6ab Reverted wrong commit
Xinchen, stop commit changed configs :)
You may use environment variables to ovverride default settings
2014-05-13 21:29:57 +04:00
Derick Rethans 7ee66c51e6 Merge branch 'PHP-5.6' 2014-05-13 16:37:07 +01:00
Dmitry Stogov a08a1ae2c0 Fixed reference counting, IS_REFERENCE and IS_INDIRECT support 2014-05-13 17:27:37 +04:00
Dmitry Stogov 0eeeaa1a23 Terminate string
Useproper hash function
2014-05-13 16:40:05 +04:00
Dmitry Stogov 275e006734 Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  C89 compat
2014-05-13 16:06:30 +04:00
Anatol Belski f089d63ddd C89 compat 2014-05-13 14:04:53 +02:00
Dmitry Stogov 3ba4f8263d Fixed curl_close() behavior 2014-05-13 16:00:44 +04: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
Dmitry Stogov b8b8c497c4 In most user extensions functions like mysql_close() should use zend_list_close() instead of zend_list_delete(). This closes the actual connection and frees extension specific data structures, but doesn't free zend_reference structure that might be referenced from zval(s). This also doesn't decrement the resource reference counter. 2014-05-13 13:18:00 +04:00
Dmitry Stogov f1720348ca Fixed access to uninitialized data and attempt to double free 2014-05-13 12:57:42 +04:00
Dmitry Stogov 7b1cb4922f Fixed safe resource close.
It must not de deleted (just closed), because it still may be referenced from zval(s).
This fixes few ext/ftp test memory failures detected with valgrind.
2014-05-13 12:47:34 +04:00
Dmitry Stogov 376ab3b787 Nested PCRE calls may clobber extra->mark and it has to be reinitailized
This fixes invalid memory writes (detected with valgrind) in Zend/tests/closure_047.phpt and Zend/tests/closure_048.phpt.
2014-05-13 12:14:55 +04:00
Dmitry Stogov 88421c6a04 Added comment 2014-05-13 10:22:21 +04:00
Pierre Joye c26d79c854 hash keys now use actual string length without leading zero 2014-05-13 08:11:44 +02:00
Pierre Joye 1b89df4925 Merge branch 'phpng' of git.php.net:php-src into phpng
# By Xinchen Hui
# Via Xinchen Hui
* 'phpng' of git.php.net:php-src:
  Save one type checking if the type is already string
  This should be removed too
  Remove zval **
2014-05-13 08:08:25 +02:00
Xinchen Hui 075a6ced0a Save one type checking if the type is already string 2014-05-13 14:05:28 +08:00
Xinchen Hui 7080131e71 This should be removed too 2014-05-13 13:55:51 +08:00
Xinchen Hui 97c836e421 Remove zval ** 2014-05-13 13:45:24 +08:00
Pierre Joye 11caa1d7b4 port dns_win32 2014-05-13 07:06:27 +02:00
Pierre Joye bc0161b720 Merge branch 'phpng' of git.php.net:php-src into phpng
# By Dmitry Stogov (5) and others
# Via Xinchen Hui (3) and Dmitry Stogov (1)
* 'phpng' of git.php.net:php-src:
  restore unexpected commit
  Convert to unpacked before deleting elements
  - Fixed ZTS build
  Fix memory error in spl_directory.c
  Fix spl_directory cast_object, reenable error
  Support for ext/phar (all tests passed)
  ext/phar support (incomplete)
  Fixed double free (xmlrpc is done, 1 test failed due to knew issue)
  Fixed typo
  Refactoring ext/xmlrpc (incompleted)
  Removed error message that breaks phar
  ext/phar support (incomplete)
  Refactor ext/gd (all tests passes)
  Fixed wrong buffer length (added place for terminating zero)
2014-05-13 06:51:45 +02:00
Pierre Joye d24c5de173 port sendmail to windwos (untested yet) 2014-05-13 06:51:11 +02:00
Pierre Joye dbc6d0df84 port proc_open to windows (untested yet) 2014-05-13 06:50:20 +02:00
Xinchen Hui 618de55485 restore unexpected commit 2014-05-13 12:25:03 +08:00
Xinchen Hui 6037dcd25b Merge branch 'phpng-hash-str-del-fix' of https://github.com/datibbaw/php-src into phpng 2014-05-13 12:23:58 +08:00
Tjerk Meesters e7b50a8ee9 Convert to unpacked before deleting elements
Return FAILURE immediately if a string index removal is attempted.

Moved condition higher up
2014-05-13 11:58:28 +08:00
Felipe Pena 920d298f4a - Fixed ZTS build 2014-05-13 00:34:10 -03: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
Dmitry Stogov f29b68306d Support for ext/phar (all tests passed) 2014-05-12 22:28:31 +04:00
Stanislav Malyshev c7abe84d94 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test - output can be chunked
  fix test

Conflicts:
	ext/curl/tests/curl_basic_006.phpt
2014-05-12 10:58:18 -07:00
Jefersson Nathan dd2005535c Fix align indentation 2014-05-12 13:37:47 -03:00
Dmitry Stogov dda4140010 Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  Fixed double free (xmlrpc is done, 1 test failed due to knew issue)
  Fixed typo
  Refactoring ext/xmlrpc (incompleted)
2014-05-12 16:43:41 +04:00
Dmitry Stogov 4288f0486b ext/phar support (incomplete) 2014-05-12 16:43:18 +04:00
Xinchen Hui b0f434c3dd Fixed double free (xmlrpc is done, 1 test failed due to knew issue) 2014-05-12 20:40:08 +08:00
Xinchen Hui dec5fa6c08 Fixed typo 2014-05-12 19:57:04 +08:00
Xinchen Hui b0329185cc Refactoring ext/xmlrpc (incompleted) 2014-05-12 19:28:06 +08:00
Dmitry Stogov c6c9d1414c Removed error message that breaks phar 2014-05-12 14:03:10 +04:00
Dmitry Stogov dfb10145f7 ext/phar support (incomplete) 2014-05-12 13:31:38 +04:00
Stanislav Malyshev db35409136 fix test 2014-05-12 01:40:39 -07:00
Anatol Belski 63f57b5901 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master: (29 commits)
  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
  updated NEWS
  Bug #67238 Ungreedy and min/max quantifier bug in PCRE 8.34 upstream
  oops, 5.4 and 5.5 use malloc in TSRM
  ...

Conflicts:
	ext/gd/gd.c
2014-05-12 09:59:02 +02:00
Anatol Belski 1c5b635281 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  Allow crypto_method context value in stream_socket_enable_crypto()
2014-05-12 09:56:35 +02:00
Xinchen Hui 1be957ebc9 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-12 15:55:48 +08:00
Xinchen Hui 9081a1bdfb Refactor ext/gd (all tests passes) 2014-05-12 15:53:35 +08:00
Dmitry Stogov f089be8291 Fixed wrong buffer length (added place for terminating zero) 2014-05-12 11:17:12 +04:00
Anatol Belski a582692720 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Allow crypto_method context value in stream_socket_enable_crypto()

Conflicts:
	ext/standard/streamsfuncs.c
2014-05-12 08:55:10 +02:00
Yasuo Ohgaki 072bbe95ea Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed test for commit 997be125eb
2014-05-12 15:38:40 +09:00
Stanislav Malyshev 97b203c93f fix test 2014-05-11 23:20:33 -07:00
Stanislav Malyshev 41b655d9cd improve CURL tests to allow testing without separate server 2014-05-11 23:04:09 -07:00
Pierre Joye 7a74d779aa Merge branch 'phpng' of git.php.net:php-src into phpng
# By Xinchen Hui
# Via Xinchen Hui
* 'phpng' of git.php.net:php-src:
  Fixed reference handling
  Fixed IS_INDRICT handling
  Fixed fields handling
  Refactoring wddx (incompleted, is there any one use it? )
  Finish refactoring of MySQLi
  Various bug fixes (now 17 tests fails, it is 11 in trunk)
  Various bug fixed
2014-05-12 06:46:59 +02:00
Yasuo Ohgaki a33a817f0e Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #67199	mb_regex_encoding mishmash
2014-05-12 13:34:43 +09:00
Xinchen Hui b2b508a279 Fixed reference handling 2014-05-12 11:39:55 +08:00
Xinchen Hui fca5af618f Fixed IS_INDRICT handling 2014-05-12 10:52:37 +08:00
Xinchen Hui 618d6e273c Fixed fields handling 2014-05-12 10:46:19 +08: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
Xinchen Hui 8d87e3b841 Refactoring wddx (incompleted, is there any one use it? ) 2014-05-11 22:04:45 +08:00
Felipe Pena 2ed2283932 Merge branch 'PHP-5.6'
* PHP-5.6:
  - Fixed off-by-one in phar_build (patch by crrodriguez at opensuse dot org)
2014-05-11 09:46:47 -03:00
Xinchen Hui c057b3f63d Finish refactoring of MySQLi
a few tests failed due to knew issue, I will disscuss with dmitry later
2014-05-11 19:37:48 +08:00
Xinchen Hui 446c60c616 Various bug fixes (now 17 tests fails, it is 11 in trunk) 2014-05-11 17:02:08 +08:00
Xinchen Hui 53b930475f Various bug fixed 2014-05-11 16:05:14 +08:00
Pierre Joye 486138ef3f Merge branch 'phpng' of git.php.net:php-src into phpng
# By Xinchen Hui (27) and others
# Via Xinchen Hui (5) and others
* 'phpng' of git.php.net:php-src: (47 commits)
  Refactor MySQLi (incompleted, only compilable now)
  Add support for pspell
  update for phpng
  Test push (previous push didn't send mail?)
  Added smart_string to avoid string duplicated
  Use strpprintf
  Added vstrpprintf strpprintf to avoid duplicate string
  Refactor sysvsem, sysvshm, sysmsg
  Fix identical comparison of arrays with references
  Fix strtr() segfault
  Code cleanup in proc_open
  Finish ext/curl (7 tests fails as trunk)
  Fixed post data (long type cast matters here :<)
  Use zend_string for better performance
  Fixed clone refcount
  Fixed build with high version libcurl
  Refactoring ext/curl (only compilable now)
  Fix proc_open resource destruction
  Support for ext/phar (incomplete)
  Finish bz2 (all tests passed)
  ...
2014-05-11 08:55:10 +02:00
Xinchen Hui 2402d6cbbc Refactor MySQLi (incompleted, only compilable now) 2014-05-11 14:53:18 +08:00
Xinchen Hui e9274de503 Add support for pspell 2014-05-11 00:58:48 +08:00
Felipe Pena bd88e8dfd2 Merge branch 'PHP-5.6'
* PHP-5.6:
  - Move checking
2014-05-10 11:55:51 -03:00
Felipe Pena b09529ec1a Merge branch 'PHP-5.6'
* PHP-5.6:
  - Fixed missing NULL check in SimpleXMLElement::xpath()
2014-05-10 11:53:59 -03:00
Felipe Pena 4308cf30ba Merge branch 'PHP-5.6'
* PHP-5.6:
  - Fixed missing NULL check
2014-05-10 11:40:04 -03:00
Sobak 9db82df076 Removed another cvsclean file 2014-05-10 13:30:54 +02:00
Sobak 21642861b2 Removed cvsclean and svnclean tools 2014-05-10 13:16:48 +02:00
krakjoe 08c4b4736e update for phpng 2014-05-10 10:02:33 +01:00
Xinchen Hui 5ce6c33f65 Test push (previous push didn't send mail?) 2014-05-10 11:19:21 +08:00
Xinchen Hui beb042090d Added smart_string to avoid string duplicated
for now, if we want result a char * use smart_string, if zend_string
 use smart_str
2014-05-10 11:09:17 +08:00
Anatol Belski 7ac7069e99 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Bug #67238 Ungreedy and min/max quantifier bug in PCRE 8.34 upstream
2014-05-09 22:18:07 +02:00
Xinchen Hui b1c9d5ddee Use strpprintf 2014-05-10 00:43:02 +08:00
Xinchen Hui 88c550a799 Added vstrpprintf strpprintf to avoid duplicate string
(the function name maybe improvement)
2014-05-10 00:21:49 +08:00
Xinchen Hui e2890e3a0f Refactor sysvsem, sysvshm, sysmsg 2014-05-09 23:28:21 +08:00
Nikita Popov 9343f874cd Fix identical comparison of arrays with references
Also commit a test I forgot.
2014-05-09 15:46:43 +02:00
Nikita Popov f1e1231529 Fix strtr() segfault 2014-05-09 15:14:27 +02:00
Nikita Popov 1616415056 Code cleanup in proc_open 2014-05-09 13:01:38 +02:00
Xinchen Hui 1071bf74cf Finish ext/curl (7 tests fails as trunk) 2014-05-09 14:58:07 +08:00
Xinchen Hui f4c105dc7d Fixed post data (long type cast matters here :<) 2014-05-09 14:48:39 +08:00
Xinchen Hui 763cee63ab Use zend_string for better performance 2014-05-09 14:14:09 +08:00
Xinchen Hui 2d9bc88db8 Fixed clone refcount 2014-05-09 14:00:47 +08:00
Xinchen Hui 564db38dc4 Fixed build with high version libcurl 2014-05-09 13:54:42 +08:00
Xinchen Hui c5e63f8a63 Refactoring ext/curl (only compilable now) 2014-05-09 12:17:39 +08:00
Nikita Popov b57d558d56 Fix proc_open resource destruction 2014-05-09 00:24:01 +02:00
Dmitry Stogov 2a31934a1a Support for ext/phar (incomplete) 2014-05-08 21:18:59 +04:00
Xinchen Hui 28bc91d8b4 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-08 23:02:53 +08:00
Xinchen Hui afa1de1883 Finish bz2 (all tests passed) 2014-05-08 22:59:17 +08:00
Dmitry Stogov df5ad846c6 Support for ext/phar (incomplete) 2014-05-08 18:30:07 +04:00
Xinchen Hui 979c665f21 There is memleak 2014-05-08 22:01:50 +08:00
krakjoe ebaee948d9 bz2 changes for phpng 2014-05-08 13:14:19 +01:00
krakjoe 29a48fe73b update skeleton 2014-05-08 12:29:56 +01:00
krakjoe 8c7064b2f7 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-08 11:58:28 +01:00
krakjoe f9cfbb8ea1 recode update for phpng 2014-05-08 11:57:35 +01:00
Xinchen Hui 7541f93f97 ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt fails in trunk as well while building with libmysql 2014-05-08 18:34:56 +08:00
Xinchen Hui 28e6a2b452 Revert "ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt fails in trunk as well while building with libmysql"
This reverts commit 29b3529292.
2014-05-08 18:34:40 +08:00
Xinchen Hui 29b3529292 ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt fails in trunk as well while building with libmysql 2014-05-08 18:30:21 +08:00
Stanislav Malyshev 281bde7701 Merge branch 'PHP-5.6'
* PHP-5.6:
  oops, 5.4 and 5.5 use malloc in TSRM
2014-05-08 02:04:50 -07:00
Xinchen Hui 7de633c549 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-08 17:03:26 +08:00
Stanislav Malyshev 607b0f99bf Merge branch 'PHP-5.6'
* PHP-5.6:
  make release tags not fail Travis CI
2014-05-08 01:12:06 -07:00
Xinchen Hui be79628b87 Fixed REFERENCE handling 2014-05-08 16:11:50 +08:00
Stanislav Malyshev cfe9596260 make release tags not fail Travis CI 2014-05-08 01:08:55 -07:00
Stanislav Malyshev f90505f5c4 don't bother with travis for now, not ready yet 2014-05-08 01:05:17 -07:00
Stanislav Malyshev 79bdc75cb3 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix memory leak in TSRM
2014-05-08 01:01:34 -07:00
Xinchen Hui c242518bf0 There should been memory leaks(and don't use pointer cast) 2014-05-08 15:20:13 +08:00
Xinchen Hui 5f46c8fa31 Fixed bugs in pdo_mysql 2014-05-08 15:19:43 +08:00
Xinchen Hui dfc940c5d9 Revert "Going to refactor mysqlnd"
This reverts commit 37d9f1e6e9.
2014-05-08 11:50:56 +08:00
Dmitry Stogov fa7008bb24 Fixed resource destruction 2014-05-08 02:48:31 +04:00
Stanislav Malyshev da4cd8edb0 Fix memory leak in TSRM 2014-05-07 13:28:03 -07:00
Dmitry Stogov 223df9ceea We shouldn't modify strings in-place (it may be interned strings stored in SHN) 2014-05-07 23:19:28 +04:00
Dmitry Stogov d41d6cf206 Interned strings must not be modified in-place
MAKE_COPY_ZVAL() should be changed into ZVAL_DUP()
2014-05-07 22:08:25 +04:00
Xinchen Hui 37d9f1e6e9 Going to refactor mysqlnd 2014-05-07 23:34:23 +08:00
Daniel Lowrey b637946a23 Merge branch 'PHP-5.6'
* PHP-5.6:
  Allow crypto_method context value in stream_socket_enable_crypto()
2014-05-07 08:13:31 -06:00
Dmitry Stogov 449ea00a48 Fixed ext/fileinfo conversion mistakes 2014-05-07 17:58:28 +04:00
Anatol Belski fe09b5b0b6 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  Fixed test (it requires ext/hash)
  Fixed tests (they might fail from time to time because of session GC)
  NEWS
  XFAIL-- for bug #67198
  remove useless indirection
  fix bug #67198 (php://input regression)
  rename a constant - old name to new name
  test for bug #67198
  Fix author name on the #63228 patch.
2014-05-07 15:01:44 +02:00
Anatol Belski ede2963963 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Fixed test (it requires ext/hash)
  Fixed tests (they might fail from time to time because of session GC)
  NEWS
  XFAIL-- for bug #67198
  remove useless indirection
  fix bug #67198 (php://input regression)
  rename a constant - old name to new name
  test for bug #67198
  Fix author name on the #63228 patch.

Conflicts:
	ext/standard/php_fopen_wrapper.c
2014-05-07 15:00:18 +02:00
Dmitry Stogov e75f2d1f76 Fixed bug introduced during conversion to "phpng" 2014-05-07 16:15:29 +04:00
Dmitry Stogov b54dcab377 Initialize "retval" 2014-05-07 15:36:01 +04:00
Dmitry Stogov d5831bfa12 Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  fix exif, thnx laruence
2014-05-07 15:14:41 +04:00
krakjoe 1f9ecf42b6 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-07 12:04:04 +01:00
Dmitry Stogov 0c6a6f0fba Re-applyed Bob's patch with minor fixes 2014-05-07 15:03:56 +04:00
krakjoe 6cab75aaa4 fix exif, thnx laruence 2014-05-07 12:03:00 +01:00
Pierre Joye 670feb3a53 typo in var name 2014-05-07 11:17:03 +02:00
Xinchen Hui 2393000aeb Prefer the macro we defined 2014-05-07 17:06:27 +08:00
Xinchen Hui e3a0809655 Rerevert previous commit to phpt by accident 2014-05-07 17:01:59 +08:00
Xinchen Hui ea26b820e1 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-07 16:53:20 +08:00
Xinchen Hui ed5b6af8af Refactored filter 2014-05-07 16:52:58 +08:00
krakjoe 0a134d1a3a phpng updates for exif 2014-05-07 07:59:45 +01:00
Xinchen Hui 8b90b17c8d Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-07 13:50:53 +08:00
Xinchen Hui 9ef21b7606 Refactor fileinfo 2014-05-07 13:50:29 +08:00
Pierre Joye 38c886a449 -- missing length declaration, may have worked w/some gcc as length is not used in the macro but still need it, ifdef just make code uncertain. will get opt out anyway if not used 2014-05-07 07:31:21 +02:00
Xinchen Hui 478a8b2ebb Fixed reference handling(param->parameter) 2014-05-07 12:01:07 +08:00
Xinchen Hui 2d0c9690de Refactor pdo_mysql(incompleted, some tests failed due to no mysqlnd) 2014-05-07 11:00:36 +08:00
Dmitry Stogov 4ecc527976 Reverted Bob's patch (it breaks many tests when run with opcache and needs to be fixed first). 2014-05-07 03:26:13 +04:00
Ferenc Kovacs 64162cd3c2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed test (it requires ext/hash)

Conflicts:
	ext/session/tests/031.phpt
2014-05-07 01:03:31 +02:00
Ferenc Kovacs 0cd679fb17 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed tests (they might fail from time to time because of session GC)
  Fix author name on the #63228 patch.
2014-05-07 00:39:57 +02:00
Dmitry Stogov 424aebbf36 Added support for ext/openssl 2014-05-07 01:09:42 +04:00
Martin Jansen 71ad601dee Fix typo 2014-05-06 22:08:52 +02:00
Nikita Popov a9ba7a6779 Add tests for previous commit 2014-05-06 22:04:58 +02:00
Martin Jansen c5f9a231d5 Streamlining of cookie handling in ext/session and setcookie
Up until now the session cookie used "HttpOnly" to indicate cookies
only available through HTTP while setcookie() used "httponly".  The
relevant RFC 6265 claims that case does not matter for this token,
but only explicitely mentions "HttpOnly".  Thus this seems like a
logical choice when streamlining the code.

Also the setcookie implementation now uses the same string constants
as the session extension for other tokens like Max-Age or the domain
attribute.

This change poses a slight risk of backwards incompatibility in places
where people deliberately ignore chapter 5.2.5 of RFC 6265 and perform
case-sensitive checks for the HttpOnly attribute.
2014-05-06 22:00:59 +02:00
Nikita Popov 4d8c59f0da Fix parse_method_params 2014-05-06 21:56:01 +02:00
Martin Jansen c0f4e270a8 This test requires the hash extension. 2014-05-06 21:34:10 +02:00
Nikita Popov ccc2c8ae16 Fix error message in parse_method_params 2014-05-06 20:32:49 +02:00
Nikita Popov 80f8d20b72 Remove dead code from ZEND_THROW
The IS_CONST case always throws an E_ERROR two lines above that,
so no need to handle it further.
2014-05-06 20:02:26 +02:00
Nikita Popov 767b5eea7e Fix throw by reference
Reported by Timm Friebe
2014-05-06 20:01:19 +02:00
Nikita Popov 409e9134ac Sync zend_is_true with convert_to_boolean (fixes GMP test) 2014-05-06 19:03:48 +02:00
Nikita Popov 4c5b5d7201 Port ext/gmp (one failure) 2014-05-06 19:03:48 +02:00
Nikita Popov 6e87a0857d Fix ZTS build 2014-05-06 19:03:48 +02:00
Bob Weinand 628646ec93 Removed now superfluous #define IS_CONSTANT_ARRAY_EX 2014-05-06 18:16:12 +02:00
Bob Weinand f3c1881f1d Re-added fix for bug #66015 and adapted for phpng branch 2014-05-06 14:59:03 +02:00
Dmitry Stogov 485a60414d Fixed incorrect boolean IS_FALSE/IS_TRUE handling 2014-05-06 15:59:49 +04:00
Dmitry Stogov ebe024fd78 Fixed memory leaks 2014-05-06 15:18:17 +04:00
Dmitry Stogov 70a5e0e429 Fixed support for references and proper string lengths 2014-05-06 15:03:25 +04:00
Dmitry Stogov 6f5a0df570 added support for ext/posix 2014-05-06 14:50:54 +04:00
Michael Wallner 4609f202f0 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
2014-05-06 12:39:34 +02:00
Michael Wallner 950bd5e20a Merge branch 'PHP-5.6'
* PHP-5.6:
  XFAIL-- for bug #67198
  remove useless indirection
  fix bug #67198 (php://input regression)
2014-05-06 12:36:55 +02:00
Dmitry Stogov 53b5de1e64 Added support for ext/pcntl (incomplete; ext/posix required to run all tests) 2014-05-06 14:23:56 +04:00
krakjoe b2fe1c1648 ... 2014-05-06 11:22:15 +01:00
Michael Wallner 416cc83f4e XFAIL-- for bug #67198 2014-05-06 12:22:09 +02:00
Michael Wallner 333638b0d3 remove useless indirection
the stream was initialized within the ops
in a prior version of the slim_post_data patch
2014-05-06 12:22:08 +02:00
Michael Wallner 86b6bfb9b7 fix bug #67198 (php://input regression) 2014-05-06 12:22:08 +02:00
krakjoe ff9597a238 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-06 11:21:21 +01:00
krakjoe 7f32ffbf89 fix leaks in here 2014-05-06 11:20:54 +01:00
Dmitry Stogov 9d21bef39f Added support for apache and apache2handler SAPIs (They seem slower than FastCGI) 2014-05-06 13:26:23 +04:00
Andrey Hristov 4df71647b6 Merge branch 'PHP-5.6' 2014-05-06 12:17:29 +03:00
Dmitry Stogov 0ea615fd10 Mark all strings stored in SHM as IS_INTERNED to avoid refcounting 2014-05-06 12:41:27 +04:00
krakjoe 4187be99fe fix for phpng, failing RFC2144 test 2014-05-06 09:08:02 +01:00
krakjoe 362e1db428 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-06 08:01:26 +01:00
krakjoe 360962ea29 fix ftp for ng 2014-05-06 07:54:54 +01:00
Hannes Magnusson 0ebf0c02a0 Fix argument, cur_method_ref->class_name is a zend_string 2014-05-05 21:45:33 -07:00
Dmitry Stogov 1fa4dcac87 Added comment with problem description and two soltions 2014-05-06 04:35:29 +04:00
Dmitry Stogov 8915ad69fb Fixed memory leaks 2014-05-06 04:06:58 +04:00
Dmitry Stogov 28a8135331 Restored original EG(scope) behavior when call object methods 2014-05-06 02:04:05 +04:00
Dmitry Stogov 1606a9a36a PDO code assumes that different parts of the union alligned in special way 2014-05-06 02:02:00 +04:00
krakjoe d7c529ed32 Merge branch 'phpng' of git.php.net:php-src into phpng 2014-05-05 22:45:29 +01:00
Nikita Popov 211d32c814 Initialize CG(one_time_string) in ZTS as well 2014-05-05 22:21:57 +02:00
Nikita Popov b9438a1ec7 Fix use after free for doc_comment persist 2014-05-05 19:56:05 +02:00
Nikita Popov 592aa37f67 Fix memory error in ext/xml 2014-05-05 17:43:13 +02:00
Nikita Popov 4d22be992c Fix ZTS 2014-05-05 17:28:22 +02:00
Ferenc Kovacs 875c48ae67 Merge branch 'PHP-5.6'
* PHP-5.6:
  test for bug #67198
2014-05-05 16:25:38 +02:00
Xinchen Hui a636c4c03f Fixed segfault in _xml_xmlchar_zval 2014-05-05 19:52:42 +08:00
Xinchen Hui fa6f6c8807 Fixed Reference handling in xml_parse_into_struct 2014-05-05 19:45:50 +08:00
Xinchen Hui c73c6526ef clean up 2014-05-05 18:09:15 +08:00
Xinchen Hui 39c521c056 Finish Zip (all tests pass) 2014-05-05 17:48:49 +08:00
Xinchen Hui 356824df4c Romove unnecessary proxy macro 2014-05-05 17:44:07 +08:00
Dmitry Stogov cd4b4dfc4d Merge branch 'master' into refactoring2
Conflicts:
	Zend/zend_hash.c
	ext/date/php_date.c
2014-05-05 13:02:43 +04:00
Dmitry Stogov 83d45d0a04 GC checks during argument release don't make sense 2014-05-05 12:40:16 +04:00
Xinchen Hui 72f46a34b8 Refactor zlib (all tests pass) 2014-05-05 15:52:09 +08:00
Anatol Belski 19b6e2cc9a Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport: (32 commits)
  fixed ZEND_DEBUG usage
  updated libmagic.patch
  added missing stdint header, bug #66907
  fix macros
  /me blushes, really hard
  only build and test nts non-debug and ts debug builds as discussed at https://github.com/php/php-src/pull/654
  Fix mysqli build when building against libmysqlclient.
  Fix author name on the #63228 patch.
  Fixed bug #67169: []= after_array_splice incorrect
  Revert "show leaks in their own group" using valgrind would be a bit too much for travis I guess.
  show leaks in their own group
  Use the right path for the suggested PHP invocation in ext_skel.
  Changed to more understandable NEWS message
  one heading is enough
  add new NEWS block for alpha3
  XFAIL the leaking multibyte tests, we should really get to the bottom of this
  Fixed numbering in UPGRADING file
  Updated NEWS for fixed phpdbg issue #85
  Added stdion/stdout/stderr constsnts and their php:// wrappers Fixes issue #85
  Added stdion/stdout/stderr constsnts and their php:// wrappers Fixes issue #85
  ...
2014-05-05 08:59:08 +02:00
Xinchen Hui f7ee17d9f7 Refactor gettext 2014-05-05 14:32:32 +08:00
Anatol Belski bc92917e73 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fixed ZEND_DEBUG usage
  updated libmagic.patch
  added missing stdint header, bug #66907
2014-05-05 08:29:35 +02:00
Xinchen Hui fee9d4cafd Refactor bcmath 2014-05-05 14:26:23 +08:00
Xinchen Hui 7e3989f301 Fixed memory leak in prop_handlers registering 2014-05-05 14:04:52 +08:00
Xinchen Hui cd00ea9993 Port iconv (all tests passes) 2014-05-05 13:58:23 +08:00
Xinchen Hui ea33fbd833 Don't use this (keyword) 2014-05-05 10:56:18 +08:00
Xinchen Hui bea30846bb Refactor Zip (1 test failed) 2014-05-05 10:49:27 +08:00
Xinchen Hui cf15e94e07 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-05-05 10:34:04 +08:00
Nikita Popov b30c7fe263 Port JSON 2014-05-05 01:00:59 +02:00
Anatol Belski 149568f4da Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed ZEND_DEBUG usage
2014-05-05 00:51:40 +02:00
Nikita Popov 404cc45ee2 Get php-fpm to work
At least phpinfo() works. Need to do more testing (how do you run
fpm with valgrind?)
2014-05-04 22:10:00 +02:00
Anatol Belski 53b4d2feea Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libmagic.patch
2014-05-04 21:34:36 +02:00
Anatol Belski fe7853137b Merge branch 'PHP-5.6'
* PHP-5.6:
  added missing stdint header, bug #66907
2014-05-04 21:27:37 +02:00
Anatol Belski 5168611127 fix macros 2014-05-04 21:15:35 +02:00
Anatol Belski 2044884812 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (28 commits)
  /me blushes, really hard
  only build and test nts non-debug and ts debug builds as discussed at https://github.com/php/php-src/pull/654
  Fix mysqli build when building against libmysqlclient.
  Fix author name on the #63228 patch.
  Fixed bug #67169: []= after_array_splice incorrect
  Revert "show leaks in their own group" using valgrind would be a bit too much for travis I guess.
  show leaks in their own group
  Use the right path for the suggested PHP invocation in ext_skel.
  Changed to more understandable NEWS message
  one heading is enough
  add new NEWS block for alpha3
  XFAIL the leaking multibyte tests, we should really get to the bottom of this
  Fixed numbering in UPGRADING file
  Updated NEWS for fixed phpdbg issue #85
  Added stdion/stdout/stderr constsnts and their php:// wrappers Fixes issue #85
  Added stdion/stdout/stderr constsnts and their php:// wrappers Fixes issue #85
  add missing NEWS entry to the correct release where it was added
  5.5.12 was released yesterday
  add missing NEWS entry to the correct release where it was added
  Updated NEWS entry for phpdbg
  ...

Conflicts:
	ext/curl/interface.c
2014-05-04 21:12:47 +02:00
Xinchen Hui 41f6889436 Fixed SimpleXMl build with DOM 2014-05-04 11:46:17 +08:00
Xinchen Hui f3ccbb3c40 Use self instead of this(keyword) 2014-05-04 11:35:05 +08:00
Xinchen Hui a275f4c64d Port XMLWriter 2014-05-04 11:33:17 +08:00
Xinchen Hui 4778efc009 Port XMLReader 2014-05-04 11:12:55 +08:00
Bob Weinand f66449a467 Merge branch 'PHP-5.6' 2014-05-03 11:41:33 +02:00
Nikita Popov 42d4adabbd Fix SXE->string cast for __toString in inheriting class
This issue was originally hacked around in zend_make_printable_zval.
I've now moved the overridden __toString() handling into the SXE
cast_object handler, so everything invoking that handler
(zend_make_printable_zval, convert_to_string, zval_get_string,
and various other more obscure usages) see the same behavior.
2014-05-03 11:29:08 +02:00
Nikita Popov 65f488ece3 Add STR_ALLOCA_* API, use in get_method and verify_arg
This avoid unnecessary allocations when using dynamic method
dispatch and class typehints.

Probably there are other places where this should be done as well,
those just stood out for my usage.
2014-05-03 10:43:45 +02:00
Xinchen Hui d8651fbe1c Make they are in the same style of Z_ISREF 2014-05-03 16:08:58 +08:00
Xinchen Hui 5984f95d8f Refactor XML (incompleted) 2014-05-03 15:58:09 +08:00
Ferenc Kovacs a6a1785e23 Merge branch 'PHP-5.5'
* PHP-5.5:
  only build and test nts non-debug and ts debug builds as discussed at https://github.com/php/php-src/pull/654
2014-05-03 02:51:46 +02:00
Adam Harvey 2f1148ae8a Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix mysqli build when building against libmysqlclient.
2014-05-02 14:34:48 -07:00
Adam Harvey 62d72d9105 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix author name on the #63228 patch.
2014-05-02 10:26:18 -07:00
Nikita Popov 46bcaf1b28 Merge branch 'PHP-5.6' 2014-05-02 12:52:44 +02:00
Ferenc Kovacs db3b70673f Merge branch 'PHP-5.6'
* PHP-5.6:
  Revert "show leaks in their own group" using valgrind would be a bit too much for travis I guess.
2014-05-02 09:50:40 +02:00
Ferenc Kovacs 3ca7bc089b Merge branch 'PHP-5.6'
* PHP-5.6:
  show leaks in their own group
2014-05-02 09:33:31 +02:00
Adam Harvey aacc49191c Merge branch 'PHP-5.6'
* PHP-5.6:
  Use the right path for the suggested PHP invocation in ext_skel.
  Changed to more understandable NEWS message
  one heading is enough
2014-05-01 11:23:48 -07:00
Ferenc Kovacs f8f5d311cb Merge branch 'PHP-5.6'
* PHP-5.6:
  add new NEWS block for alpha3
2014-05-01 16:25:38 +02:00
Ferenc Kovacs 562a845dcc Merge branch 'PHP-5.6'
* PHP-5.6:
  XFAIL the leaking multibyte tests, we should really get to the bottom of this
2014-05-01 12:50:28 +02:00
Bob Weinand e0b9e5249c Merge branch 'PHP-5.6' 2014-05-01 12:30:46 +02:00
Bob Weinand 3695bf27f8 Merge branch 'PHP-5.6' 2014-05-01 11:47:28 +02:00
Bob Weinand 191e3a0210 Merge sapi/phpdbg 2014-05-01 11:41:49 +02:00
Ferenc Kovacs 94f279258d Merge branch 'PHP-5.6'
* PHP-5.6:
  add missing NEWS entry to the correct release where it was added
  5.5.12 was released yesterday
  add missing NEWS entry to the correct release where it was added
  add missing NEWS entry to the correct release where it was added
2014-05-01 10:57:12 +02:00
Bob Weinand ae8010a0f4 Merge branch 'PHP-5.6' 2014-05-01 10:51:45 +02:00
Ferenc Kovacs 8b2fdb496d Merge branch 'PHP-5.6'
* PHP-5.6:
  add some missing NEWS entries
2014-05-01 10:44:31 +02:00
Nikita Popov d820ea9f5e Avoid superflous allocations in convert_to_string
Taken from zval_get_string.
2014-05-01 09:08:30 +02:00
Nikita Popov e0247de147 zend_stack_top() now returns pointer directly 2014-05-01 09:08:30 +02:00
Nikita Popov 5a03efe279 Don't allocate zend_stack elements individually
Instead allocate a vector of elements. Size must now be specified
on initialization rather than on push.
2014-05-01 09:08:29 +02:00
Nikita Popov 257bf697ae Fix php-cgi -m 2014-05-01 00:25:23 +02:00
Nikita Popov 2c24cdb4a3 Comment out cast_object for IS_NULL 2014-05-01 00:25:23 +02:00
Dmitry Stogov 52e79186b2 JMPZ/JMPNZ/JMPZNZ optimization 2014-05-01 01:24:38 +04:00
Dmitry Stogov 17d027ed47 Split IS_BOOL into IS_FALSE and IS_TRUE 2014-04-30 18:32:42 +04:00
Michael Wallner e7e44d7d56 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test locality inconsitency
2014-04-30 13:03:12 +02:00
Michael Wallner 8c559c7d8d Merge branch 'PHP-5.6'
* PHP-5.6:
  BFN
  fix bug #64247 (CURLOPT_INFILE doesn't allow reset)
2014-04-30 09:29:53 +02:00
Dmitry Stogov 6a911e833f Optimized JMPZNZ to avoid multiplication at runtime (may be it makes sense to use relative addresses everywere it'll lead to Position Independent Code) 2014-04-30 11:23:19 +04:00
Ferenc Kovacs 50396e6c10 Merge remote-tracking branch 'origin/PHP-5.6'
* origin/PHP-5.6:
  Added further notice about removal of IS_CONSTANT_INDEX/ARRAY macros
  separate travis jobs for debug and non-debug builds
  separate travis jobs for TS and NTS builds
  put this test back to XFAIL, as it was before, since it is still leaking memory
2014-04-30 00:08:38 +02:00
Anatol Belski 3491ef6cdc Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-04-29 23:53:00 +02:00
Anatol Belski 908c364248 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  Added further notice about removal of IS_CONSTANT_INDEX/ARRAY macros
  Fix bug #67060: use default mode of 660
  updated NEWS
  updated NEWS
  Fixed bug #66431 Special Character via COM Interface (CP_UTF8)
  Cleanup ZEND_MODULE_API_NO => 20050922
  Fix crashes in GMP serialize/unserialize
  enable gmp for tests
  C89 compat
2014-04-29 23:52:49 +02:00
Anatol Belski ba19cc7b45 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Added further notice about removal of IS_CONSTANT_INDEX/ARRAY macros
  Fix bug #67060: use default mode of 660
2014-04-29 23:49:56 +02:00
Stanislav Malyshev f2a3be9627 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #67060: use default mode of 660
2014-04-29 09:17:10 -07:00
Anatol Belski 0f42656fed Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  updated NEWS
  updated NEWS
  Fixed bug #66431 Special Character via COM Interface (CP_UTF8)
  Cleanup ZEND_MODULE_API_NO => 20050922
  Fix crashes in GMP serialize/unserialize
  enable gmp for tests
  C89 compat

Conflicts:
	ext/com_dotnet/com_variant.c
2014-04-29 14:05:57 +02:00
Anatol Belski 8928611b0e Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  updated NEWS
  Fixed bug #66431 Special Character via COM Interface (CP_UTF8)
2014-04-29 13:47:38 +02:00
Dmitry Stogov 8a8df2ce68 Changed order of types 2014-04-29 10:54:59 +04:00
Marc Bennewitz b547e1358d Improved logarithm of base 2 and 10 of standard math functions 2014-04-28 19:58:10 +02:00
Popa Adrian Marius 005f589dc4 Merge branch 'master' of https://git.php.net/push/php-src
* 'master' of https://git.php.net/push/php-src:
  Fix crashes in GMP serialize/unserialize
  enable gmp for tests
2014-04-28 12:14:39 +03:00
Popa Adrian Marius 7c58c5cc90 Merge branch 'PHP-5.6'
* PHP-5.6:
  Cleanup ZEND_MODULE_API_NO => 20050922
2014-04-28 12:14:12 +03:00
Stanislav Malyshev 8c5ea5624b Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix crashes in GMP serialize/unserialize
  enable gmp for tests
2014-04-28 01:23:39 -07:00
Anatol Belski 705909aa48 Merge branch 'PHP-5.6'
* PHP-5.6:
  C89 compat
2014-04-27 18:02:07 +02:00
Nikita Popov 7c93a7e078 Fix leak I introduced 2014-04-26 11:26:37 +02:00
Nikita Popov 4cd97b3ebd Fix by-reference argument unpacking 2014-04-26 10:40:12 +02:00
Anatol Belski 92a73b042f Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Fix #66908: php-fpm reload leaks epoll_create() file descriptor
  fix file descriptor leak of epollfd
  Fix a compiler warning in php_rand.h
  Fix #50444: PDO-ODBC changes for 64-bit
2014-04-26 01:27:13 +02:00
Anatol Belski 2b6be48685 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport: (168 commits)
  some more after merge fixes
  fixed macro names
  removed /EHa as __try/__catch syntax is used anyway
  fix ZEND_DEBUG usage
  fixed test
  updated NEWS
  updated NEWS
  Fixed bug #67118 DateTime constructor crash with invalid data
  update NEWS
  update NEWS
  add a test case previously broken by a bad fix
  Revert "Fixed bug #64604"
  updated libmagic.patch for 5.6+
  updated libmagic.patch
  backport this piece from 5.6, related to the #66307 fix
  updated NEWS
  Fixed bug #66307 Fileinfo crashes with powerpoint files
  fix CFLAGS_PHPDBGS and some formatting
  use a portable strndup implementation
  fixed C89 compat
  ...
2014-04-26 01:26:55 +02:00
Anatol Belski 047a39c946 some more after merge fixes 2014-04-26 00:42:22 +02:00
Anatol Belski e88c8cbb7b fixed macro names 2014-04-26 00:40:58 +02:00
Anatol Belski 14b9658a38 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  removed /EHa as __try/__catch syntax is used anyway
  fix ZEND_DEBUG usage
  fix CFLAGS_PHPDBGS and some formatting
2014-04-26 00:40:16 +02:00
Anatol Belski 5dbe7c98e4 Merge branch 'PHP-5.6'
* PHP-5.6:
  removed /EHa as __try/__catch syntax is used anyway
  fix ZEND_DEBUG usage
  fix CFLAGS_PHPDBGS and some formatting
2014-04-26 00:17:09 +02:00
Nikita Popov 5db9312ec8 Add dst parameter to convert_object_to_type macro
Avoids a ZVAL_DUP in the zval_get_* functions.

Also improve object-to-array cast a bit by initializing the array
with correct number of elements and not doing a alloc-init-free
cycle when convert_object_to_type succeeds.
2014-04-25 23:21:05 +02:00
Nikita Popov 778946b3b6 Use convert_scalar_to_array only for arrays 2014-04-25 23:21:05 +02:00
Nikita Popov 4c16b777fe Uhm, do we really need to support that? 2014-04-25 23:21:05 +02:00
Nikita Popov 9263d18bd9 Optimize ZEND_CAST to avoid zval copies
The scalar type casts IS_NULL, IS_BOOL, IS_LONG, IS_DOUBLE and
IS_STRING will no longer require a copy when casting.

A copy is now only made when casting to IS_ARRAY and IS_OBJECT, if
the type doesn't already match.

I tweaked the reference handling for the type-already-correct case
to DEREF the zval after that check. References require a copy anyway,
so they can go through the slow codepath.
2014-04-25 23:21:05 +02:00
Nikita Popov dd419d24ca Replace more convert_to_* calls 2014-04-25 23:21:05 +02:00
Nikita Popov 93f9518a58 Align zval_get_long/double with zval_get_string 2014-04-25 23:21:04 +02:00
Nikita Popov b1b7939b0f Move more code to use zval_get_string 2014-04-25 23:21:04 +02:00
Nikita Popov f979e9afb0 More zend_string usage in PCRE
Avoid a few copies and zval duplications
2014-04-25 23:21:04 +02: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
Anatol Belski 36a0950b39 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (158 commits)
  fixed test
  updated NEWS
  updated NEWS
  Fixed bug #67118 DateTime constructor crash with invalid data
  update NEWS
  update NEWS
  add a test case previously broken by a bad fix
  Revert "Fixed bug #64604"
  updated libmagic.patch for 5.6+
  updated libmagic.patch
  backport this piece from 5.6, related to the #66307 fix
  updated NEWS
  Fixed bug #66307 Fileinfo crashes with powerpoint files
  use a portable strndup implementation
  fixed C89 compat
  prepare config.w32
  fix dll export
  add parser files to dist
  Fix accepting ill-formed UTF-8 characters
  sapi/litespeed/lsapi_main.c: Fix bug #63228
  ...

Conflicts:
	ext/date/php_date.c
	sapi/phpdbg/phpdbg_bp.c
	sapi/phpdbg/phpdbg_frame.c
	sapi/phpdbg/phpdbg_help.c
	sapi/phpdbg/phpdbg_list.c
	sapi/phpdbg/phpdbg_prompt.c
2014-04-25 19:49:10 +02:00
Anatol Belski e5b8fd2cc7 Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed test
2014-04-25 17:40:46 +02:00
Anatol Belski f5c0cc64ed Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  updated NEWS
  Fixed bug #67118 DateTime constructor crash with invalid data
2014-04-25 17:27:35 +02:00
Dmitry Stogov 4e7cbf3f58 Use appropriate macros 2014-04-25 11:54:10 +04:00
Dmitry Stogov 2c39cf670c Use appropriate macro 2014-04-25 11:29:35 +04:00
Dmitry Stogov 42a33085c8 Avoid useless allocations 2014-04-25 11:29:18 +04:00
Stanislav Malyshev b82d077f98 Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS
  update NEWS
  add a test case previously broken by a bad fix
  Revert "Fixed bug #64604"
2014-04-25 00:07:12 -07:00
Dmitry Stogov d0ed1212a4 Enable PCRE JIT compiler 2014-04-25 08:33:37 +04:00
Xinchen Hui 2178612186 Fixed fetch into refcount hanlding (now 3 test fails) 2014-04-25 11:45:23 +08:00
Xinchen Hui c5f9b86fd4 Fixed bindColumn 2014-04-25 11:36:53 +08:00
Xinchen Hui 35f22f609a Fixed memleak 2014-04-25 11:34:00 +08:00
Xinchen Hui 1ccc250c50 Fixed memleak in quote 2014-04-25 11:04:11 +08:00
Xinchen Hui 911d58de37 Fixed tests (object id) 2014-04-25 11:02:19 +08:00
Xinchen Hui 868c2f9c88 Fixed reference handling in bindCloumn 2014-04-25 11:00:35 +08:00
Xinchen Hui 67f27bce55 Fixed register bound parameters in execute 2014-04-25 10:44:21 +08:00
Xinchen Hui 36e214c88b Fixed refcount of dbh (we don't need another refcount anymore) 2014-04-25 10:27:23 +08:00
Dmitry Stogov e4c59d7f65 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-25 00:57:12 +04:00
Dmitry Stogov df7ca608ce Optimized constant lookup 2014-04-25 00:56:15 +04:00
Anatol Belski ad22add191 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libmagic.patch for 5.6+
  updated libmagic.patch
2014-04-24 20:16:29 +02:00
Anatol Belski a9d714f874 Merge branch 'PHP-5.6'
* PHP-5.6:
  backport this piece from 5.6, related to the #66307 fix
2014-04-24 19:53:20 +02:00
Anatol Belski 78eeefb946 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fixed bug #66307 Fileinfo crashes with powerpoint files
2014-04-24 19:36:20 +02:00
Xinchen Hui fb81d7270e Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-24 23:29:20 +08:00
Dmitry Stogov 0ca57dd1d3 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-24 19:15:30 +04:00
Dmitry Stogov b1ff152782 Reimplement strtr() 2014-04-24 19:14:29 +04:00
Xinchen Hui 65931501e6 Fixed Aggregate 2014-04-24 22:43:30 +08:00
Xinchen Hui e86b287c83 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-24 21:14:57 +08:00
Xinchen Hui 9fe8531309 Various bugs fixed 2014-04-24 21:14:36 +08:00
Dmitry Stogov 65e2ed6e50 Redesigned zend_execute_data layout now EX(object), EX(scope) and EX(called_scope) arr properties of the current function execution co
ntext. They are set during zend_execute_data initialization and never changed.
2014-04-24 15:53:20 +04:00
Anatol Belski ceec2152a6 Merge branch 'PHP-5.6'
* PHP-5.6:
  use a portable strndup implementation
  fixed C89 compat
  prepare config.w32
  add parser files to dist
2014-04-24 11:07:08 +02:00
Anatol Belski 60f976a45e Merge branch 'PHP-5.6'
* PHP-5.6:
  fix dll export
2014-04-24 10:53:31 +02:00
Xinchen Hui 9824418c61 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-24 10:18:39 +08:00
Nikita Popov d2e45b05c7 Small zts fix 2014-04-23 22:33:38 +02:00
Nikita Popov c98d373eb6 Fix strict array comparison
Fixes Symfony test failures
2014-04-23 20:34:45 +02:00
Nikita Popov 58089c5977 Port ext/hash
Unsure what to do about hash_final
2014-04-23 20:34:05 +02:00
Nikita Popov 08ae88157b Allocate zend_strings with correct size
For me (32bit) sizeof(zend_string) is 20, which means that the
char[1] array at the end is padded with three bytes. Thus allocating
based on sizeof(zend_string)-1 overallocates by those 3 padding bytes.

This commit fixes the allocation size, by using XtOffsetOf.
2014-04-23 19:34:51 +02:00
Nikita Popov 20580a511c Fix ZTS build 2014-04-23 18:30:24 +02:00
Xinchen Hui a30442c1c8 Refactor pdo_sqlite (only compilable) 2014-04-23 11:41:57 +08:00
Xinchen Hui bd9f575517 Clean up (use zend_string and foreach macros) 2014-04-23 10:58:08 +08:00
Stanislav Malyshev c0c452d1e0 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix accepting ill-formed UTF-8 characters
2014-04-22 16:59:11 -07:00
Dmitry Stogov 7e424f5a95 Use symbolic names instead of magic constants + optimization 2014-04-23 02:47:41 +04:00
Nikita Popov 9c70603f4a Initialize hash as unpacked if it contains string keys 2014-04-22 21:33:49 +02:00
Nikita Popov 4912bec514 Fix zts 2014-04-22 19:39:13 +02:00
Nikita Popov 3d3a55cbcb Pass expected array size hint in INIT_ARRAY
To avoid unnecessary rehashes
2014-04-22 18:57:03 +02:00
Xinchen Hui decda0dabe Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-23 00:18:18 +08:00
Xinchen Hui 97381369a3 Refactored sqlite3 (all tests passes) 2014-04-23 00:17:29 +08:00
Dmitry Stogov 7584ae3200 Fixed compilaation warnings 2014-04-22 18:52:59 +04:00
Felipe Pena fd96831f68 Merge branch 'PHP-5.6'
* PHP-5.6:
  sapi/litespeed/lsapi_main.c: Fix bug #63228
2014-04-22 10:49:18 -03:00
Dmitry Stogov 5864ce8a44 Fixed compilation warnings 2014-04-22 17:46:34 +04:00
Xinchen Hui c0b49a701a Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-22 19:10:19 +08:00
Xinchen Hui 8581dd56af Fixed segfault cause EG(This) is modified 2014-04-22 19:08:58 +08:00
Dmitry Stogov 9cb24c47e1 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-22 14:38:00 +04:00
Xinchen Hui 09dd780c60 USE ZEND_HASH_FOREACH_* macros 2014-04-22 18:29:56 +08:00
Xinchen Hui 207f2431e8 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-22 18:23:47 +08:00
Xinchen Hui bdfef93b42 Refactor PDO (only compilable now) 2014-04-22 18:23:03 +08:00
Dmitry Stogov e295518bf3 Fixed typo 2014-04-22 13:11:07 +04:00
Dmitry Stogov 32e6e89887 Optimized ZEND_SEND_REF 2014-04-22 13:10:53 +04:00
Dmitry Stogov 5d479ef693 ZEND_SEND_* optimization 2014-04-22 12:33:00 +04:00
Dmitry Stogov 022fee2166 Cache knowledge about missing property_info 2014-04-22 10:11:41 +04:00
Xinchen Hui 89d89b9586 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-22 11:59:53 +08:00
Dmitry Stogov fa588a5c82 Use shorter call chain 2014-04-22 02:34:34 +04:00
Bob Weinand 70fc31b8be Merge branch 'PHP-5.6' 2014-04-22 00:21:34 +02:00
Dmitry Stogov b886d9ce1e Use fast comparison function 2014-04-22 02:03:10 +04:00
Dmitry Stogov 1f181c0f4c Chiper __autoload() function caching 2014-04-22 01:41:40 +04:00
Dmitry Stogov a821009a6e Avoid string duplication 2014-04-22 01:41:09 +04:00
Bob Weinand 823ddab3f3 Merge branch 'PHP-5.6' 2014-04-21 23:32:57 +02:00
Dmitry Stogov ff6dc3e1f2 zend_isset_isempty_dim_prop_obj_handler() split into separate handlers. (Actually, it shared near nothing) 2014-04-22 00:32:29 +04:00
Dmitry Stogov 9610977d10 Reverted chunk committed by mistake 2014-04-21 23:32:36 +04:00
Dmitry Stogov b9d45cc0a9 Handle references in "slow path" 2014-04-21 23:30:19 +04:00
Dmitry Stogov 4ed452c1b5 Convert zval_get_string() into "fast path" macro and "slow path" function 2014-04-21 22:36:01 +04:00
Dmitry Stogov 8ad8254a16 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-21 21:39:15 +04:00
Dmitry Stogov 4533269839 Fast path for pre/post inc/dec 2014-04-21 21:38:44 +04:00
Nikita Popov 0d43a277b8 Use zval_get_string in a few more places 2014-04-21 17:55:58 +02:00
Nikita Popov bda96e3c58 Use zval_get_string in print_zval and propagate TSRMLS 2014-04-21 17:55:58 +02:00
Nikita Popov 5c8697184f Bring zval_get_string implement in line with make_printable_zval
As make_printable_zval is the "main" string cast, match that one.
2014-04-21 17:55:58 +02:00
Dmitry Stogov 72c287bd23 Combine HashTable.flags and HashTable.nApplyCount into single 32-bit word 2014-04-21 18:25:34 +04:00
Dmitry Stogov afe66d89a1 Cleanup 2014-04-21 16:34:40 +04:00
Dmitry Stogov acd77dec81 Use alloca() for temporary allocation 2014-04-21 15:18:19 +04:00
Dmitry Stogov fd24614cd9 Inline simple function 2014-04-21 15:18:05 +04:00
Dmitry Stogov 3c42593735 Removed duplicate code 2014-04-21 15:17:48 +04:00
Dmitry Stogov dd464fb582 Use ZEND_HASH_FOREACH_* macros 2014-04-21 14:20:05 +04:00
Dmitry Stogov f71da39210 Use ZEND_HASH_FOEACH_* instead of zend_hash_apply_* 2014-04-21 13:55:25 +04:00
Dmitry Stogov e9f4d822b0 Avoid useles copy ctor 2014-04-21 13:19:52 +04:00
Anatol Belski 70707a58c9 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Allow valid multi-byte utf-8 characters to be allowed as file names in phar archives.
  Fix #50444: PDO-ODBC changes for 64-bit
  Fix a compiler warning in php_rand.h
  Fix #66908: php-fpm reload leaks epoll_create() file descriptor
  Fix bug #65701: Do not use cache for file file copy
2014-04-21 08:57:18 +02:00
Xinchen Hui e48b9ad197 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-21 14:14:00 +08:00
Stanislav Malyshev 57ca493c95 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #64498: Allow valid multi-byte utf-8 characters to be allowed as file names in phar archives.
2014-04-20 17:24:24 -07:00
Stanislav Malyshev 1ff58c10c9 Merge branch 'pull-request/603'
* pull-request/603:
  Fix #50444: PDO-ODBC changes for 64-bit
2014-04-20 16:50:01 -07:00
Stanislav Malyshev e680b098e3 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix #50444: PDO-ODBC changes for 64-bit
2014-04-20 16:49:40 -07:00
Stanislav Malyshev fc35b548d3 Merge branch 'pull-request/605'
* pull-request/605:
  Fix a compiler warning in php_rand.h
2014-04-20 16:37:42 -07:00
Stanislav Malyshev 821cc39882 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix a compiler warning in php_rand.h
2014-04-20 16:36:55 -07:00
Stanislav Malyshev 60c54f016f Merge branch 'pull-request/627'
* pull-request/627:
  Fix #66908: php-fpm reload leaks epoll_create() file descriptor
  fix file descriptor leak of epollfd
2014-04-20 16:25:37 -07:00
Stanislav Malyshev 185e5c0327 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix #66908: php-fpm reload leaks epoll_create() file descriptor
2014-04-20 16:25:25 -07:00
Stanislav Malyshev dd9c80e44b Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #65701: Do not use cache for file file copy
2014-04-20 15:27:55 -07:00
Anatol Belski f3e56c8c9e Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Fixed test case for 5328d42
  These links to ~helly don't work anymore.
2014-04-20 20:39:39 +02:00
Anatol Belski 7c6ac6be55 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport: (23 commits)
  updated libs versions
  added some notes about the win build system
  UPGRADING note about bug #67072
  UPGRADING note about bug #67072
  UPGRADING note about bug #67072
  refixed the test related to bug #67072
  Improved the fix for bug #67072, thanks Nikita
  Fixed test case for 5328d42
  These links to ~helly don't work anymore.
  updated NEWS
  updated NEWS
  Fixed bug #67072 Echoing unserialized "SplFileObject" crash
  updated UPGRADING
  updated UPGRADING
  correct the bug #67081 fix
  updated NEWS
  updated NEWS
  Fixed bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset
  updated NEWS
  Fixed bug #67079 Missing MIME types for XML/XSL files
  ...
2014-04-20 20:39:29 +02:00
Anatol Belski 3eaf40c3fc Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  updated libs versions
  added some notes about the win build system
  UPGRADING note about bug #67072
  UPGRADING note about bug #67072
  UPGRADING note about bug #67072
  refixed the test related to bug #67072
  Improved the fix for bug #67072, thanks Nikita
  Fixed test case for 5328d42
  These links to ~helly don't work anymore.
  updated NEWS
  updated NEWS
  Fixed bug #67072 Echoing unserialized "SplFileObject" crash
  updated UPGRADING
  updated UPGRADING
  correct the bug #67081 fix
  updated NEWS
  updated NEWS
  Fixed bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset
2014-04-20 20:30:54 +02:00
Dmitry Stogov 54d9ad53f4 More ZEND_HASH_FOREACH_* related changes 2014-04-19 00:08:14 +04:00
Dmitry Stogov 277f8f6391 ZEND_HASH_FOREACH_* usage 2014-04-18 21:49:07 +04:00
Dmitry Stogov c1e900e4c0 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-18 19:20:39 +04:00
Nikita Popov 85f537bfc0 Revert "Fix include/eval with custom zend_execute"
This reverts commit ead8a6636d.
2014-04-18 17:19:46 +02:00
Nikita Popov f76c683d37 Revert "Fix zend_eval_string (and as such assert + dom tests)"
This reverts commit 64cc5a72e2.
2014-04-18 17:19:31 +02:00
Dmitry Stogov 7652a977a8 Use ZEND_FETCH_FOREACH_* macros to iterate over HashTables instead of zend_hash_move_forward() and family. 2014-04-18 19:18:11 +04:00
Anatol Belski 0cdc57b3cf Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libs versions
2014-04-18 16:09:02 +02:00
Anatol Belski 2bb7f3adfc Merge branch 'PHP-5.6'
* PHP-5.6:
  added some notes about the win build system
2014-04-18 16:05:11 +02:00
Anatol Belski 5745a513c7 Merge branch 'PHP-5.6'
* PHP-5.6:
  UPGRADING note about bug #67072
  UPGRADING note about bug #67072
  UPGRADING note about bug #67072
2014-04-18 15:55:12 +02:00
Anatol Belski f5f1abdc29 Merge branch 'PHP-5.6'
* PHP-5.6:
  refixed the test related to bug #67072
  Improved the fix for bug #67072, thanks Nikita
2014-04-18 15:17:39 +02:00
Nikita Popov 64cc5a72e2 Fix zend_eval_string (and as such assert + dom tests) 2014-04-18 14:35:59 +02:00
Nikita Popov ead8a6636d Fix include/eval with custom zend_execute 2014-04-18 13:44:19 +02:00
Dmitry Stogov ea2e1bb1eb Optimized zend_leave_helper() 2014-04-18 13:46:36 +04:00
Stanislav Malyshev c2b20c467f Merge branch 'pull-request/646'
* pull-request/646:
  Fixed test case for 5328d42
2014-04-17 17:37:17 -07:00
Stanislav Malyshev 3405d799f8 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed test case for 5328d42
2014-04-17 17:37:05 -07:00
Tjerk Meesters bb565de5cc Fixed test case for 5328d42 2014-04-18 08:29:32 +08:00
Nikita Popov 8a14276701 Fix libxml external entity loading 2014-04-18 00:15:13 +02:00
Nikita Popov c3c47c431e Move libxml_destroy_fci to RSHUTDOWN
If this is only done in post shutdown and the function name is
an object (e.g. closure), the object will already be freed during
zend_deactivate.

I left the rest of the shutdown procedure in post shutdown, as it
presumably has a reason to be there...
2014-04-18 00:15:13 +02:00
Nikita Popov 59d45e69f4 Fix libxml/sxe/dom node import/export
Also fix sxe zts.
2014-04-18 00:15:13 +02:00
Dmitry Stogov 3434d3fc98 Optimize CASE(TRUE, X) into BOOL(X) (this pattern affects wordpress) 2014-04-17 21:15:02 +04:00
Bob Weinand 1bc0dbba7b Merge branch 'PHP-5.6' 2014-04-17 17:37:31 +02:00
Levi Morrison 0193895bb4 These links to ~helly don't work anymore. 2014-04-17 08:46:38 -06:00
Dmitry Stogov e7b3b1132a Fixed support for references 2014-04-17 17:21:59 +04:00
Dmitry Stogov 5c02e0fc5f Cache op_array->run_time_cache in zend_execute_data for faster access 2014-04-17 16:36:04 +04:00
Dmitry Stogov 3cca67f740 Use local variables instead of opline operands to access cache_slots 2014-04-17 16:10:16 +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
Anatol Belski a381cc3c40 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  updated NEWS
  Fixed bug #67072 Echoing unserialized "SplFileObject" crash
2014-04-17 11:08:45 +02:00
Dmitry Stogov c92dd8eedf Fixed ZEND_CAST related optimizations (now it returns IS_VAR instead of IS_TMP_VAR) 2014-04-17 11:12:47 +04:00
Dmitry Stogov dfaf8b6d28 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-17 02:12:52 +04:00
Dmitry Stogov 6976eb2919 Fixed support for unspecialized and GOTO and SWITCH executor 2014-04-17 02:12:06 +04:00
Nikita Popov f98937fa80 Don't copy in ZEND_CAST if type is already correct 2014-04-16 22:39:50 +02:00
Anatol Belski 7d9e161fa7 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated UPGRADING
  updated UPGRADING
2014-04-16 20:49:35 +02:00
Dmitry Stogov 320bf772c6 Prevented modification of original name 2014-04-16 22:42:37 +04:00
Dmitry Stogov 3257dc09eb Prevented modification of interned string 2014-04-16 22:42:15 +04:00
Dmitry Stogov cc576c74d2 op_array->function_name, op_array->doc_comments and op_array->filename may be kept in opcache SHM 2014-04-16 22:41:07 +04:00
Dmitry Stogov 5bb493c40b op_array->filename and op_array->filename may be kept in opcache SHM 2014-04-16 22:39:23 +04:00
Dmitry Stogov 2d62a12128 Prevented modification of constant arguments 2014-04-16 21:31:32 +04:00
Dmitry Stogov 05817f1a93 Prevented unintended SHM modification 2014-04-16 21:01:11 +04:00
Dmitry Stogov a9aa5224e7 Prevented modification of interned string 2014-04-16 20:59:02 +04:00
Nikita Popov e59c8661fd Finish DOM port
All tests pass now
2014-04-16 17:14:34 +02:00
Nikita Popov 59f6d189c8 Fix remaining XPath issue 2014-04-16 17:14:34 +02:00
Nikita Popov 39d12294fd Mostly fix Dom XPath 2014-04-16 17:14:34 +02:00
Xinchen Hui cf7e703813 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-16 22:33:22 +08:00
Dmitry Stogov 54c338acc1 Fixed reference counting 2014-04-16 18:06:03 +04:00
Anatol Belski 3456b73656 Merge branch 'PHP-5.6'
* PHP-5.6:
  correct the bug #67081 fix
2014-04-16 15:08:46 +02:00
Dmitry Stogov c44eee153f Fixed reference counting 2014-04-16 17:06:25 +04:00
Dmitry Stogov 533a8b65f8 Fixed typo 2014-04-16 16:35:41 +04:00
Dmitry Stogov be60f90dd7 Set reference values of reference counters of not-interned strings when they are restored from SHM 2014-04-16 16:28:27 +04:00
Dmitry Stogov 7537251bd7 Fixed reference counting 2014-04-16 16:28:11 +04:00
Anatol Belski 8a985edfb2 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  updated NEWS
  Fixed bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset
2014-04-16 14:16:56 +02:00
Dmitry Stogov 62016f5ab3 Fixed reference counting 2014-04-16 14:15:24 +04:00
Xinchen Hui ce49e6b0f7 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-16 18:08:08 +08:00
Dmitry Stogov 78f428d3a8 Fixed memory leaks 2014-04-16 13:59:49 +04:00
Dmitry Stogov a86eb10dae Fixed non-interned strings refcounting 2014-04-16 13:36:38 +04:00
Xinchen Hui a16a6eae24 Refactor PDO (incompleted) 2014-04-16 17:28:11 +08:00
Anatol Belski 6162a993dd Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  updated NEWS
  Fixed bug #67079 Missing MIME types for XML/XSL files
  5.4.29 is next
  Fixed bug #66907 Solaris 10 is missing strcasestr and needs substitute
  5.5.12RC1 setup
2014-04-16 10:48:48 +02:00
Dmitry Stogov 2f65090a38 Fixed reference counting 2014-04-16 12:33:25 +04:00
Dmitry Stogov fb4e0a6364 Removed invalid STR_RELEASE() 2014-04-16 12:28:20 +04:00
Dmitry Stogov 81b24d4100 Fixed reference support 2014-04-16 12:08:16 +04:00
Dmitry Stogov 1082489302 Fixed refcounting 2014-04-16 12:07:58 +04:00
Dmitry Stogov 153e549886 Fixed zend_string/char mess 2014-04-16 12:07:21 +04:00
Anatol Belski 0ffdcfe756 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fixed bug #67079 Missing MIME types for XML/XSL files
2014-04-16 09:50:24 +02:00
Stanislav Malyshev 59d50b5fb0 Merge branch 'PHP-5.6'
* PHP-5.6:
  5.4.29 is next
  5.5.12RC1 setup
2014-04-15 17:18:24 -07:00
Dmitry Stogov dce95c064f Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-16 01:46:07 +04:00
Dmitry Stogov e99e6958bc Cleanup 2014-04-16 01:45:40 +04:00
Nikita Popov 9eb8569865 Make DOM mostly work 2014-04-15 22:20:06 +02:00
Dmitry Stogov a4bda5b187 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-15 22:44:21 +04:00
Dmitry Stogov 6cf5e51f3e Reduced memory realocations 2014-04-15 22:43:18 +04:00
Nikita Popov 3b9fdf37e1 Make DOM compile
Just make it compile, not work yet...
2014-04-15 20:32:47 +02:00
Nikita Popov 7a1a6092f6 Add functions for extracting long/double/string from zval
These function get the long / double / string value of a zval with
usual cast semantics, but without actually modifying the zval.

Didn't go on a killing spree for convert_to_* yet...
2014-04-15 20:32:47 +02:00
Nikita Popov 2f0a758fbb Start working on dom extension
Nowhere near compiling yet...
2014-04-15 20:32:46 +02:00
Dmitry Stogov d0cc5c633c Use zend_string* instead of char* 2014-04-15 22:10:39 +04:00
Dmitry Stogov f9b26bc39a Cleanup (2-nd round) 2014-04-15 21:56:30 +04:00
Anatol Belski b7d376c1e5 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66907 Solaris 10 is missing strcasestr and needs substitute
2014-04-15 10:29:32 -07:00
Anatol Belski 5f79883497 fixed signatures 2014-04-15 08:22:36 -07:00
Anatol Belski c0faf60be0 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fixed signatures
2014-04-15 17:20:01 +02:00
Anatol Belski e396a3539c Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Fix #66942: openssl_seal() memory leak
  ws fix
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
  Fix #66562: Consistency bug where curl_multi_getcontent behaves different from curl_exec
  Fixed bug 64604
2014-04-15 14:11:13 +02:00
Anatol Belski b504468d78 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport: (58 commits)
  fix datatypes
  fix zpp
  fixed prototype
  fix test - doesn't seem to produce warning
  Fix test - on CI somebody could create a process in the meantime
  fix windows build
  Fix #66942: openssl_seal() memory leak
  ws fix
  Fix #66942: openssl_seal() memory leak
  ws fix
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
  fix crash in MINFO when no mysqlnd plugins are loaded
  Add test
  backported some ext/intl tests from 5.6 into 5.4
  test fixes for ICU 53.1
  ...

Conflicts:
	ext/mysqlnd/mysqlnd_result.c
2014-04-15 14:10:50 +02:00
Anatol Belski 5e750feb21 fix datatypes 2014-04-15 14:01:50 +02:00
Dmitry Stogov 61e9b0d265 Fixed memory leak 2014-04-15 15:50:34 +04:00
Dmitry Stogov 050d7e38ad Cleanup (1-st round) 2014-04-15 15:40:40 +04:00
Anatol Belski 6e10627d54 fix zpp 2014-04-15 11:34:59 +02:00
Anatol Belski bc2b0d8ba3 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix test - doesn't seem to produce warning
  Fix test - on CI somebody could create a process in the meantime
  fix windows build
  Fix #66942: openssl_seal() memory leak
  ws fix
  Fix #66942: openssl_seal() memory leak
  ws fix
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
  Add test

Conflicts:
	ext/openssl/openssl.c
2014-04-15 10:23:51 +02:00
Anatol Belski 4be58a12d8 fixed prototype 2014-04-15 09:59:01 +02:00
Anatol Belski f166237626 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (41 commits)
  fix crash in MINFO when no mysqlnd plugins are loaded
  backported some ext/intl tests from 5.6 into 5.4
  test fixes for ICU 53.1
  Fixed bug #67033 Remove reference to Windows 95
  fix NEWS
  Fixed bug #64604
  Fix #66562: Consistency bug where curl_multi_getcontent behaves different from curl_exec
  Fix bug #66482, replace wrong item name 'priority' with 'process.priority' in php-fpm.conf
  Fix windows build
  Fix bug #66721
  fix apr_psprintf format string from e0df4e3dba
  Fixed bug #67024 - getimagesize should recognize BMP files with negative height
  Bug #66840: Fix broken build when extension built separately
  Reverted to 5a0da281e5 Discussion: http://news.php.net/php.cvs/76836
  Forgot title in phpt for bug #67064
  Updated NEWS
  Fix bug #67064 in a BC safe way You can use an optional parameter now when implementing the Countable interface to get the $mode passed to count().
  Added UPGRAING notice for bug #66015 in BC break section
  Add new zend_hash_* APIs to UPGRADING.INTERNALS
  Add str_* macros to UPGRADING.INTERNALS
  ...

Conflicts:
	Zend/zend_compile.c
	Zend/zend_execute_API.c
	Zend/zend_language_parser.y
	ext/mysqli/mysqli.c
	ext/mysqlnd/mysqlnd.c
	ext/mysqlnd/mysqlnd.h
	ext/mysqlnd/mysqlnd_ps.c
	ext/mysqlnd/mysqlnd_result.c
	ext/mysqlnd/mysqlnd_result.h
	ext/mysqlnd/mysqlnd_structs.h
	ext/mysqlnd/mysqlnd_wireprotocol.c
	ext/mysqlnd/mysqlnd_wireprotocol.h
	ext/opcache/zend_accelerator_util_funcs.c
	ext/spl/spl_observer.c
	ext/standard/array.c
2014-04-15 09:53:02 +02:00
Dmitry Stogov 93d3a613d8 Fixed support for references 2014-04-15 11:13:23 +04:00
Xinchen Hui 8bfc037348 Fixed invaid write/read 2014-04-15 14:38:38 +08:00
Xinchen Hui 541842d87a Fixed return uninitialized_zval 2014-04-15 11:10:39 +08:00
Xinchen Hui 84ce66f17c Fixed Typo 2014-04-15 11:09:04 +08:00
Xinchen Hui a0690ff288 Fixed zend_object_get_t in simpleXML 2014-04-15 11:05:03 +08:00
Stanislav Malyshev 0ae2328c44 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test - doesn't seem to produce warning
  Fix test - on CI somebody could create a process in the meantime
2014-04-14 15:48:33 -07:00
Anatol Belski 46070e956c Merge branch 'PHP-5.6'
* PHP-5.6:
  fix windows build
2014-04-14 23:35:51 +02:00
Dmitry Stogov 2056359594 Fixed test (support for MarinaDB) 2014-04-15 01:27:21 +04:00
Dmitry Stogov 460120c887 Fixed reference counting 2014-04-15 01:16:09 +04:00
Stanislav Malyshev 4db11ff081 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix #66942: openssl_seal() memory leak
  ws fix
  Fix #66942: openssl_seal() memory leak
  ws fix
2014-04-14 13:38:44 -07:00
Chuan Ma 8d05a777ad Fix #66942: openssl_seal() memory leak
Fix #66952: memory leak in openssl_open()
2014-04-14 13:38:32 -07:00
Stanislav Malyshev fae8ed8ae9 ws fix 2014-04-14 13:37:58 -07:00
Dmitry Stogov 258a5a39fa Fixed memory leak 2014-04-15 00:21:41 +04:00
Andrey Hristov f1c70fbbd6 Merge branch 'master' of git.php.net:php-src 2014-04-14 23:11:01 +03:00
Dmitry Stogov cc50ebc487 Fixed memory leak 2014-04-14 23:53:25 +04:00
Dmitry Stogov 5ff9089320 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-14 23:01:02 +04:00
Dmitry Stogov 9629eea9e7 The test works out of the box 2014-04-14 22:43:33 +04:00
Dmitry Stogov b0b54e8db4 Fixed nested GC calls (valgrind error in Zend/tests/gc_016.phpt) 2014-04-14 22:41:42 +04:00
Stanislav Malyshev 8bf77370e9 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
2014-04-14 10:53:09 -07:00
Stanislav Malyshev 9af0756dd5 Fix null byte in LDAP bindings 2014-04-14 10:53:08 -07:00
Stanislav Malyshev fb96a62b7d Fix bug #66171: better handling of symlinks 2014-04-14 10:53:07 -07:00
Xinchen Hui 76825a71a4 Fixed SXE iterator(14 tests fail) 2014-04-15 00:37:48 +08:00
Xinchen Hui 30a974f435 Fixed sxe object clone 2014-04-15 00:10:59 +08:00
Xinchen Hui 1f207e73eb Fixed double free 2014-04-15 00:06:54 +08:00
Anatol Belski a35723f6e1 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix crash in MINFO when no mysqlnd plugins are loaded
2014-04-14 17:45:18 +02:00
Xinchen Hui 55440b0870 Fixed libxml handling default context 2014-04-14 23:40:21 +08:00
Anatol Belski edc4aca826 Merge branch 'PHP-5.6'
* PHP-5.6:
  backported some ext/intl tests from 5.6 into 5.4
2014-04-14 16:45:18 +02:00
Andrey Hristov 0705bfc3a3 Merge branch 'PHP-5.6' 2014-04-14 17:44:21 +03:00
Anatol Belski 333af6fe34 Merge branch 'PHP-5.6'
* PHP-5.6:
  test fixes for ICU 53.1
2014-04-14 15:35:01 +02:00
Xinchen Hui c7513f58d2 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-14 19:27:55 +08:00
Xinchen Hui a975c7e0fe Refactor simpleXML (compilable, but incompleted) 2014-04-14 19:27:22 +08:00
Dmitry Stogov 703c1bc570 Fixed passing arguments by reference into array_walk() callbacks. 2014-04-14 15:11:05 +04:00
Dmitry Stogov 5dc52e4880 Fixed interface constants inheritance.
Now we use IS_REFERENCE for inhereted class constants.
I might miss some edje cases.
2014-04-14 13:24:43 +04:00
Anatol Belski fca5889963 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #67033 Remove reference to Windows 95
2014-04-14 09:34:02 +02:00
Stanislav Malyshev 1155b62ba4 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix NEWS
2014-04-13 20:17:30 -07:00
Stanislav Malyshev 3970b9d7dd Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix #66021 (Blank line inside empty array/object)
2014-04-13 18:56:26 -07:00
Stanislav Malyshev 9f9f378c88 Merge branch 'pull-request/533'
* pull-request/533:
  Fixed bug 64604
2014-04-13 18:39:58 -07:00
Stanislav Malyshev 0a13f8168d Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #64604
2014-04-13 18:39:28 -07:00
Stanislav Malyshev aa3cc443c3 Merge branch 'pull-request/578'
* pull-request/578:
  Fix #66562: Consistency bug where curl_multi_getcontent behaves different from curl_exec
2014-04-13 18:15:55 -07:00
Stanislav Malyshev 85d05b5654 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix #66562: Consistency bug where curl_multi_getcontent behaves different from curl_exec
2014-04-13 18:14:10 -07:00
Stanislav Malyshev d3b433bb15 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #66482, replace wrong item name 'priority' with 'process.priority' in php-fpm.conf
2014-04-13 17:33:02 -07:00
Stanislav Malyshev 3a3a05d2e8 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix windows build
2014-04-13 17:04:25 -07:00
Stanislav Malyshev 11bdb85d30 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #66721
2014-04-13 15:56:02 -07:00
Stanislav Malyshev 9fb92eed83 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix apr_psprintf format string from e0df4e3dba
  Fixed bug #67024 - getimagesize should recognize BMP files with negative height
2014-04-13 15:40:21 -07:00
Bob Weinand 12844292b8 Merge branch 'PHP-5.6' 2014-04-14 00:10:25 +02:00
Daniel Lowrey f1aa39c1af Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug #66840: Fix broken build when extension built separately
2014-04-13 15:19:23 -06:00
Nikita Popov 4fc3d2d104 Copy varname before unset
Otherwise we get issues when the varname variable coincides with
the variable that is deleted.
2014-04-13 23:07:10 +02:00
Bob Weinand e8728b4999 Merge branch 'PHP-5.6' 2014-04-13 19:41:27 +02:00
Bob Weinand ef214aa3c0 Merge branch 'PHP-5.6' 2014-04-13 19:28:32 +02:00
Bob Weinand d86c297659 Merge branch 'PHP-5.6' 2014-04-13 11:42:30 +02:00
Nikita Popov 099c070f18 Merge branch 'PHP-5.6' 2014-04-13 10:49:38 +02:00
Ferenc Kovacs c459805cb2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #66660: use str_efree instead of efree to handle interned empty strings correctly
2014-04-13 10:48:42 +02:00
Matteo Beccati 0175bbb767 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66604 'pdo/php_pdo_error.h' not copied to the include dir
2014-04-13 08:55:13 +02:00
Ferenc Kovacs fdbf467d2e Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #66568: the second arg for unserialize is optional.
2014-04-13 02:50:03 +02:00
Ferenc Kovacs fb326bbd9b Merge branch 'PHP-5.6'
* PHP-5.6:
  fix typo
2014-04-13 01:57:49 +02:00
Bob Weinand eae0f529f2 Merge branch 'PHP-5.6' 2014-04-12 23:55:35 +02:00
Dmitry Stogov b178992cd1 Temporary fix for Zend/tests/bug46238.phpt 2014-04-12 00:50:36 +04:00
Dmitry Stogov c6af3781ee Fixed test (now string data allocated together with zend_string structure) 2014-04-11 23:25:50 +04:00
Dmitry Stogov affc7ab6c5 Fixed test (order of variables doesn't mater) 2014-04-11 23:04:47 +04:00
Bob Weinand ca447a8f6f Merge branch 'PHP-5.6' 2014-04-11 20:14:44 +02:00
Nikita Popov 2c6ee5dcb5 Fix argument unpacking 2014-04-11 19:53:14 +02:00
Bob Weinand ccf863c8ce Merge branch 'PHP-5.6' 2014-04-11 19:35:11 +02:00
Bob Weinand 38ec4d20bf Merge branch 'PHP-5.6' 2014-04-11 18:24:41 +02:00
Bob Weinand 53e71e47b9 Merge branch 'PHP-5.6' 2014-04-11 16:21:15 +02:00
Dmitry Stogov e27eca90a5 for some reason gcc -O2 compiled the previous code in unexpected way 2014-04-11 18:16:03 +04:00
Dmitry Stogov a6123151c7 Fixed memory leak 2014-04-11 18:15:53 +04:00
Dmitry Stogov 13f0c8b18c Fixed double free 2014-04-11 16:48:38 +04:00
Dmitry Stogov 2614d945f8 Fixed memory leaks 2014-04-11 15:29:37 +04:00
Anatol Belski f0c95cb705 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix syntax error in vc++
2014-04-11 13:28:13 +02:00
Dmitry Stogov 33c731d94f Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-11 15:06:01 +04:00
Dmitry Stogov b6af031e52 Fixed support for references 2014-04-11 15:05:12 +04:00
Dmitry Stogov 68c34855af Fixed memory leaks 2014-04-11 14:47:53 +04:00
Dmitry Stogov f1f3e3c371 fixed persistent reaource destruction 2014-04-11 14:47:38 +04:00
Xinchen Hui a2a2481dd1 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-11 18:08:11 +08:00
Xinchen Hui 180de35bce Refactor libxml (incompleted) 2014-04-11 18:07:25 +08:00
Dmitry Stogov aa2ed70d43 Fixed srialize() 2014-04-11 13:44:23 +04:00
Dmitry Stogov dac8cefb45 Fixed tests (added session_destroy() to avoid side effects on the following tests) 2014-04-11 13:17:59 +04:00
Anatol Belski 3af4be482c Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fixed bug #66967 Updated the bundled libsqlite to 3.8.4.3
2014-04-11 11:02:02 +02:00
Dmitry Stogov 4adedff13d Fixed tests (they might fail from time to time because of session GC) 2014-04-11 12:43:35 +04:00
Dmitry Stogov ec4314f818 Fixed reference counting 2014-04-11 12:43:22 +04:00
Xinchen Hui 0d341e5b0e No need anymore 2014-04-11 16:30:19 +08:00
Bob Weinand 9663193bbc Merge branch 'PHP-5.6' 2014-04-11 10:11:58 +02:00
Dmitry Stogov aeb64f5447 Fixed support for references 2014-04-11 11:15:31 +04:00
Xinchen Hui 70ba20bfd3 hmm, make it consistent 2014-04-11 12:54:42 +08:00
Xinchen Hui 2e97e18bd0 Fixed _php_mbstr_parse_mail_headers 2014-04-11 12:53:35 +08:00
Xinchen Hui 12470b4092 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-11 12:34:06 +08:00
Dmitry Stogov 91ed685e26 Close all files and resources before before destroying object storage, because resources may point to objects. (THIS CHANGE MAY BE DANGEROUS) 2014-04-11 02:22:00 +04:00
Dmitry Stogov 98350cdcea Introduced API to close all resources at once 2014-04-11 02:21:06 +04:00
Dmitry Stogov a9599c9512 Fixed memory leak 2014-04-10 23:36:16 +04:00
Dmitry Stogov ca05f965e3 Fixed tests (added missing zend.multibyte=On) 2014-04-10 23:07:00 +04:00
Dmitry Stogov c54768bd60 fixed serialize() 2014-04-10 22:44:39 +04:00
Andrey Hristov 6828437c11 Merge branch 'PHP-5.6'
Conflicts:
	NEWS
	ext/mysqlnd/mysqlnd_result.c
2014-04-10 18:22:01 +03:00
Dmitry Stogov 8eb8d123e0 Fixed suppor for multibyte encoding 2014-04-10 18:47:47 +04:00
Popa Adrian Marius c2ce0df01b Merge branch 'PHP-5.6'
* PHP-5.6:
  Cleanup $ is not needed for git
2014-04-10 17:43:45 +03:00
Dmitry Stogov 7a7b94d2fe Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-10 18:08:39 +04:00
Dmitry Stogov 6bfedfd22e Fixed unserialize() 2014-04-10 18:08:11 +04:00
Nikita Popov f449b04713 Fix some ZTS issues and leaks 2014-04-10 13:50:25 +02:00
Anatol Belski 0eb34f25ae Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-04-10 12:43:08 +02:00
Anatol Belski dfbc874a11 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fix prototype
  fix typo
  fix typo
  fix typo
  add a NEWS block for beta2
  add missing entries to NEWS
  abstract namespace for unix sockets is a linux only feature
  Don't test for specific non-zero substr_compare() return value
  Add only_integer_keys option to zend_hash_reindex
  Don't always separate splice replacement array
  Add zend_hash_splice
  Add zend_hash_reindex
  Remove some usages of hashtable internals
  Updated NEWS
  fixed bug66702 : regexiterator's invert flag doesn't work as expected
2014-04-10 12:42:58 +02:00
Nikita Popov c6eba25571 Port tokenizer extension 2014-04-10 11:44:45 +02:00
Anatol Belski 9112c2f122 fix prototype 2014-04-10 11:44:28 +02:00
Anatol Belski af53cc6799 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix typo
  fix typo
  fix typo
  add a NEWS block for beta2
  add missing entries to NEWS
  abstract namespace for unix sockets is a linux only feature
  Don't test for specific non-zero substr_compare() return value
  Add only_integer_keys option to zend_hash_reindex
  Don't always separate splice replacement array
  Add zend_hash_splice
  Add zend_hash_reindex
  Remove some usages of hashtable internals
  Updated NEWS
  fixed bug66702 : regexiterator's invert flag doesn't work as expected

Conflicts:
	Zend/zend_hash.c
	ext/spl/spl_iterators.c
	ext/standard/array.c
	ext/standard/php_array.h
2014-04-10 10:49:48 +02:00
Dmitry Stogov 6df6006769 Compatibility fix for ext/session/tests/session_id_error3.phpt 2014-04-10 12:29:14 +04:00
Dmitry Stogov 23aecd1736 Fixed test (it requires ext/hash) 2014-04-10 12:14:11 +04:00
Dmitry Stogov 0ae14f3a1d Fixed access to uninitialized data 2014-04-10 10:38:40 +04:00
Ferenc Kovacs 7b3e369740 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix typo
  fix typo
  fix typo
2014-04-10 07:07:50 +02:00
Ferenc Kovacs edbaa1fa5e Merge branch 'PHP-5.6'
* PHP-5.6:
  add a NEWS block for beta2
  add missing entries to NEWS
2014-04-10 06:23:23 +02:00
Xinchen Hui 27f7f342ee session_id is binary safe now 2014-04-10 11:57:34 +08:00
Dmitry Stogov eb69fd9b0b Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-10 03:22:06 +04:00
Nikita Popov a6be32f59a IS_INTERNED is not always 0 in ZTS
The current implementation chooses to intern "" in ZTS. Either that
should be removed or IS_INTERNED needs to actually check the flag.
2014-04-09 23:54:03 +02:00
Dmitry Stogov 6ee5e813ab var_push_dtor_no_addref() is useles (var_push_dtor() doesn't work properly as well) 2014-04-10 01:49:26 +04:00
Nikita Popov 19ccd79942 Fix copying of constants for ZTS
Just a quick hack, should probably add an internal_copy_ctor
function for this.
2014-04-09 23:41:17 +02:00
Nikita Popov 3ce96eabc0 Fix function copying in ZTS
Still doesn't entirely work :/
2014-04-09 23:41:16 +02: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 2016e72111 Temporary refcounting fix 2014-04-10 01:08:52 +04:00
Dmitry Stogov d8a0c6c6ab typo 2014-04-10 00:22:13 +04:00
Dmitry Stogov 29f068779f Fixed ext/spl/tests/iterator_035.phpt 2014-04-09 23:49:58 +04:00
Dmitry Stogov a938b24607 Fixed resource to integer conversion 2014-04-09 22:31:40 +04:00
Dmitry Stogov 816f8dfefb Fixed macro 2014-04-09 22:23:22 +04:00
Ferenc Kovacs 1b1dabcf60 Merge branch 'PHP-5.6'
* PHP-5.6:
  abstract namespace for unix sockets is a linux only feature
2014-04-09 19:04:35 +02:00
Dmitry Stogov b1d2efcc2d Fixed reference counting 2014-04-09 18:11:18 +04:00
Dmitry Stogov 8732f5e5d7 Removed useless code 2014-04-09 17:55:40 +04:00
Dmitry Stogov 9b276c7a0c Fixed error reporting 2014-04-09 17:08:52 +04:00
Dmitry Stogov b7e6c8d0f8 Fixed reference counting 2014-04-09 17:02:13 +04:00
Dmitry Stogov 79b27dc096 Fixed reference counting 2014-04-09 16:48:03 +04:00
Tjerk Meesters 939b2db87d Merge branch 'PHP-5.6' 2014-04-09 20:11:36 +08:00
Dmitry Stogov d9f6068fd3 Fixed GC 2014-04-09 15:26:45 +04:00
Dmitry Stogov 22ec682e77 Fixed reference counting 2014-04-09 15:05:22 +04:00
Nikita Popov 21e01f2b70 Merge branch 'PHP-5.6' 2014-04-09 12:31:35 +02:00
Dmitry Stogov 085be9d618 Fixed ArrayObject::sort() family 2014-04-09 14:25:35 +04:00
Etienne Kneuss 6acfaa982b Merge branch 'PHP-5.6' 2014-04-09 11:52:11 +02:00
Dmitry Stogov 39d2cede74 Fixed support for IS_INDIRECT and IS_REFERENCE 2014-04-09 13:23:28 +04:00
Anatol Belski b0ddef8ba3 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  cleanup old unsupported versions of Firebird 1.0.x
  cleanup
  Fixes bug #66071: isc_interprete is unsafe and deprecated , it is replaced with fb_iterpret
2014-04-09 11:17:43 +02:00
Anatol Belski 71a8b01b2b Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  Updated NEWS for #67043
  Fixed bug 67043
  cleanup
  Fixes bug #66071: isc_interprete is unsafe and deprecated , it is replaced with fb_iterpret
  updated libs versions
  fixed the test for ICI >= 52.1
  Fix Linux specific fail in error traces Linux apparently does not like memcpy in overlapping regions...
  add missing skip to the output, so we actually skip this test
  fix the test according to how new date code does it
  fix to work on different ICU versions
  multibytes tests still fail, put them in XFAIL
2014-04-09 11:17:23 +02:00
Anatol Belski abad64c50e Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Updated NEWS for #67043
  Fixed bug 67043
  cleanup
  Fixes bug #66071: isc_interprete is unsafe and deprecated , it is replaced with fb_iterpret
  updated libs versions
  fixed the test for ICI >= 52.1
  Fix Linux specific fail in error traces Linux apparently does not like memcpy in overlapping regions...
  add missing skip to the output, so we actually skip this test
  fix the test according to how new date code does it
  fix to work on different ICU versions
  multibytes tests still fail, put them in XFAIL

Conflicts:
	ext/standard/string.c
2014-04-09 11:04:50 +02:00
Dmitry Stogov ad524d2818 Use proper size 2014-04-09 12:16:21 +04:00
Dmitry Stogov 48d3b95aee Fixed NULL pointer dereferencing 2014-04-09 11:56:48 +04:00
Dmitry Stogov 98ab24f1af Fixed NULL pointer dereferencing 2014-04-09 11:39:39 +04:00
Dmitry Stogov abbb1c0f00 Unset CV before calling zval_ptr_dtor(), because its destructor may bailout and stay CV value in inconsistet state 2014-04-09 10:47:24 +04:00
Dmitry Stogov c99b767537 Fixed generator destruction 2014-04-09 10:47:03 +04:00
Dmitry Stogov 479f520d14 Fixed store of "shared" zend_strings 2014-04-09 09:43:42 +04:00
Tjerk Meesters 419d98b291 Merge branch 'PHP-5.6' 2014-04-09 07:37:07 +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
Stanislav Malyshev d349971bb2 Merge branch 'PHP-5.6'
* PHP-5.6:
  cleanup
  Fixes bug #66071: isc_interprete is unsafe and deprecated , it is replaced with fb_iterpret
2014-04-08 09:39:34 -07:00
Popa Adrian Marius 8abcd97333 cleanup old unsupported versions of Firebird 1.0.x 2014-04-08 17:36:38 +03:00
Popa Adrian Marius 88cd44aa62 cleanup 2014-04-08 15:29:32 +03:00
Popa Adrian Marius 6d7093cbbe Fixes bug #66071: isc_interprete is unsafe and deprecated , it is replaced with fb_iterpret 2014-04-08 14:11:58 +03:00
Anatol Belski 1157f81b2f Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libs versions
2014-04-08 11:43:55 +02:00
Dmitry Stogov 0e7d30e8d3 Optimized ASSIGN_OP 2014-04-08 02:25:49 +04:00
Dmitry Stogov 3d0b32b3db IS_CONST can't be a reference 2014-04-08 00:52:07 +04:00
Dmitry Stogov f3c57716f7 Optimized ZEND_FETCH_R and family 2014-04-08 00:38:54 +04:00
Dmitry Stogov 3d17219cd8 Refactored zend_hash_* iteration API zend_hash_fove_forward_ex(ht, pos) and family require second argument to be real pointer.
&(ht)->nInternalPointer should be passed instead of NULL.
zend_hash_update_current_key() may work only with internal pointer.
2014-04-07 23:14:17 +04:00
Anatol Belski 6c2f7bc2c4 Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed the test for ICI >= 52.1
2014-04-07 17:41:47 +02:00
Bob Weinand d58a7500a7 Merge branch 'PHP-5.6' 2014-04-07 17:16:48 +02:00
Ferenc Kovacs a6e56586c6 Merge branch 'PHP-5.6'
* PHP-5.6:
  add missing skip to the output, so we actually skip this test
2014-04-07 16:59:27 +02:00
Dmitry Stogov 3167b49ce9 Allocate HashTable->arData and HashTable->arHash at once 2014-04-07 18:22:03 +04:00
Dmitry Stogov 66b3b907c2 Cleanup 2014-04-07 16:50:41 +04:00
Dmitry Stogov bf35b22af5 Optimized ISSET_ISEMPTY_DIM_OBJ 2014-04-07 14:56:34 +04:00
Dmitry Stogov 3485b11499 "incremental" hash bucket initialization 2014-04-07 13:31:44 +04:00
Dmitry Stogov df7293b072 don't use memset() for array of zval initialization 2014-04-07 12:14:44 +04:00
Dmitry Stogov 8b2bb30137 Use macros 2014-04-07 10:57:58 +04:00
Stanislav Malyshev 2000c8ed46 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix the test according to how new date code does it
  fix to work on different ICU versions
2014-04-05 20:13:48 -07:00
Stanislav Malyshev ca31c8f4fe Merge branch 'PHP-5.6'
* PHP-5.6:
  multibytes tests still fail, put them in XFAIL
2014-04-05 18:35:18 -07:00
Anatol Belski 589384cb2c Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Remove call_user_method() and call_user_method_array() from master, long time deprecated in favour of call_user_func*().
2014-04-05 10:34:46 +02:00
Anatol Belski 62a25407a9 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  updated NEWS
  updated NEWS
  Fixed bug #66084 simplexml_load_string() mangles empty node name
  cleanup NEWS
  NEWS
  NEWS
  Fix Bug #66736 	fpassthru broken
2014-04-05 10:34:40 +02:00
Anatol Belski d308724d19 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  updated NEWS
  updated NEWS
  Fixed bug #66084 simplexml_load_string() mangles empty node name
  cleanup NEWS
  NEWS
  NEWS
  Fix Bug #66736 	fpassthru broken
2014-04-05 09:53:38 +02:00
Anatol Belski d7f5f608ac Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  updated NEWS
  Fixed bug #66084 simplexml_load_string() mangles empty node name
2014-04-05 09:50:13 +02:00
Kalle Sommer Nielsen 96d5d7c240 Merge branch 'master' of https://git.php.net/push/php-src 2014-04-05 06:45:02 +02:00
Kalle Sommer Nielsen 91aa9fbb47 Remove call_user_method() and call_user_method_array() from master, long time deprecated in favour of call_user_func*(). 2014-04-05 06:43:41 +02:00
Dmitry Stogov a94923d5cb Avoid double zval copying in ZEND_SEND_VAL and zend_send_by_var_helper 2014-04-05 02:14:17 +04:00
Dmitry Stogov a80e945835 Optimized ZEND_FETCH_DIM_* 2014-04-05 01:56:51 +04:00
Dmitry Stogov c11dc75b4e Refactored IS_INDIRECT IS_VAR passing between opcodes to avoid reference counting 2014-04-04 19:01:53 +04:00
Dmitry Stogov cea26aa2eb Tergets of ASSIGN and ASSIGN_REF don't have to be initialized 2014-04-04 15:22:41 +04:00
Dmitry Stogov eaeb3c39b4 Optimized RECV_* opcodes 2014-04-04 14:36:34 +04:00
Dmitry Stogov 3bc8810b1e Constant duplication optimization
Argument receiving optimization
2014-04-04 03:55:27 +04:00
Stanislav Malyshev 882862eb6e Merge branch 'PHP-5.6'
* PHP-5.6:
  cleanup NEWS
2014-04-03 15:57:26 -07:00
Dmitry Stogov 58f0f2503c Various VM optimizations 2014-04-04 02:52:53 +04:00
Dmitry Stogov 58871730c8 ASSIGN_REF optimization 2014-04-03 16:53:30 +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
Michael Wallner 8d4ee1dbed Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  Fix Bug #66736 	fpassthru broken
2014-04-03 10:41:53 +02:00
Anatol Belski d7aed3c631 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-04-03 10:02:53 +02:00
Anatol Belski bccac3c79b Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  NEWS
  NEWS
  Fix bug #66182 	exit in stream filter produces segfault
  NEWS
  NEWS
  Fixed bug #61019 (Out of memory on command stream_get_contents)
  NEWS
  NEWS
  Fix bug #64330
  update NEWS
  updated NEWS
  updated NEWS
  added test for bug #53965
  Fixed bug #53965 <xsl:include> cannot find files w/ relative paths when loaded w/ "file://"
  updated libmagic.patch
  NEWS
  NEWS
  NEWS
  Fixed Bug #66987 Memory corruption in fileinfo ext (bigendian)
2014-04-03 10:02:44 +02:00
Anatol Belski 582bf28311 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  NEWS
  NEWS
  Fix bug #66182 	exit in stream filter produces segfault
  NEWS
  NEWS
  Fixed bug #61019 (Out of memory on command stream_get_contents)
  NEWS
  NEWS
  Fix bug #64330
  update NEWS
  updated NEWS
  updated NEWS
  added test for bug #53965
  Fixed bug #53965 <xsl:include> cannot find files w/ relative paths when loaded w/ "file://"
  updated libmagic.patch
  NEWS
  NEWS
  NEWS
  Fixed Bug #66987 Memory corruption in fileinfo ext (bigendian)
2014-04-03 09:12:26 +02:00
Michael Wallner 3f8c45e28c Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  Fix bug #66182 	exit in stream filter produces segfault
2014-04-03 09:10:02 +02:00
Michael Wallner 4d412421df Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  Fixed bug #61019 (Out of memory on command stream_get_contents)
2014-04-02 15:39:16 +02:00
Dmitry Stogov d8099d0468 Changed data layout to allow more efficient operations 2014-04-02 14:34:44 +04:00
Michael Wallner 2b7bf2cb6e Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
2014-04-02 11:15:11 +02:00
Michael Wallner 1d6b3f1293 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #64330
2014-04-02 11:11:39 +02:00
Dmitry Stogov 3b25faa4aa Fixed 0 index handling 2014-04-02 12:09:05 +04:00
Dmitry Stogov 7240b4ec4d Avoid unnecessary zval separations 2014-04-02 01:56:16 +04:00
Dmitry Stogov 5c912a805b Use "fast" comparison function 2014-04-02 00:48:26 +04:00
Dmitry Stogov 60961bba3d Avoid useless memset() 2014-04-01 23:56:45 +04:00
Dmitry Stogov dccd97d347 Avoid unnecessary zval separations 2014-04-01 23:44:42 +04:00
Dmitry Stogov 4456bfaa72 Avoid unnecessry reallocations 2014-04-01 23:27:51 +04:00
Dmitry Stogov 6b2ed577fd Avoid unnecessry reallocations 2014-04-01 22:36:17 +04:00
Dmitry Stogov 8ddda2f649 Avoid unnecessry reallocation 2014-04-01 21:19:44 +04:00
Dmitry Stogov 8dedaf8512 Use interned strings for one character strings 2014-04-01 18:06:50 +04:00
Dmitry Stogov 042c937f69 Use STR_COPY() instead of STR_DUP() where possible 2014-04-01 17:10:15 +04:00
Dmitry Stogov a25a1ba0ef STR_DUP() doesn't duplicate interned strings anymore. In case new string is required STR_INIT() or STR_ALLOC() should be used. 2014-04-01 16:31:03 +04:00
Dmitry Stogov 7eff369ba9 Store constant flags 2014-04-01 16:30:13 +04:00
Dmitry Stogov 9799542ffa Fixed parameter passing 2014-04-01 14:42:04 +04:00
Dmitry Stogov 015e5dc43b In case the string can't be interned it must not be released 2014-04-01 14:35:34 +04:00
Dmitry Stogov 70b7950a75 Exclude interned flags from constant flags 2014-04-01 14:20:10 +04:00
Dmitry Stogov 9b196ca6e8 Added check for interned strings 2014-04-01 14:19:43 +04:00
Dmitry Stogov 98ca90c910 Fixed char*/zend_string* mess 2014-04-01 13:57:23 +04:00
Dmitry Stogov 0da12b9273 Fixed script size calculation 2014-04-01 13:04:33 +04:00
Dmitry Stogov 569bfbd00b Keep constnat flags 2014-04-01 12:20:16 +04:00
Anatol Belski 45c1e28161 Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS
  updated NEWS
  updated NEWS
  added test for bug #53965
  Fixed bug #53965 <xsl:include> cannot find files w/ relative paths when loaded w/ "file://"
2014-04-01 10:15:05 +02:00
Dmitry Stogov ceecd31cb6 Fixed support for arg_info and type hinfing (TODO: names should be interned) 2014-04-01 11:44:11 +04:00
Dmitry Stogov 46647180ef function_name might be shared across few op_arrays (inherited methods) 2014-04-01 11:29:22 +04:00
Dmitry Stogov 2a612e91c2 Fixed optimizer 2014-04-01 11:04:12 +04:00
Dmitry Stogov b964621294 Fixed optimizer (incomplete) 2014-04-01 01:53:33 +04:00
Dmitry Stogov 3fc8449e1e Fixed interned strings support 2014-04-01 00:50:25 +04:00
Dmitry Stogov fd4d11e053 fixes 2014-03-31 23:38:37 +04:00
Anatol Belski 41d63e38e1 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libmagic.patch
2014-03-31 17:24:53 +02:00
Remi Collet cf4e7837d1 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fixed Bug #66987 Memory corruption in fileinfo ext (bigendian)
2014-03-31 16:58:21 +02:00
Dmitry Stogov 7465be4fbd Optimizer related fixes (incomplete) 2014-03-31 18:13:16 +04:00
Dmitry Stogov 47fdb9eae3 fixed craches at request shutdown and memory leaks 2014-03-31 16:09:45 +04:00
Anatol Belski 4dd4eac9d5 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-03-31 12:04:04 +02:00
Anatol Belski 0fb1f51435 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  update lib versions
  Remove unneeded string copy. Allow to set ''(empty string values) internal/input/output_encoding for better compatibility. i.e. Runtime INI value changes. More compliance to the RFC. Improve/add encoding handling tests. i.e. Rather than set encoding automagic way, detect it.
  Fix test
2014-03-31 12:03:50 +02:00
Anatol Belski 295cec706e Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  update lib versions
  Remove unneeded string copy. Allow to set ''(empty string values) internal/input/output_encoding for better compatibility. i.e. Runtime INI value changes. More compliance to the RFC. Improve/add encoding handling tests. i.e. Rather than set encoding automagic way, detect it.
  Fix test

Conflicts:
	ext/iconv/iconv.c
	ext/standard/html.c
2014-03-31 11:57:46 +02:00
Dmitry Stogov 292b8dffc8 Make opcache work (incomplete - optimizer doesn't work yet; crashes on request shutdown) 2014-03-31 13:11:58 +04:00
Xinchen Hui 35199a3d0c Fixed null pointer dereference 2014-03-30 17:53:17 +08:00
Xinchen Hui 6c16325034 Fixed smart_str_setl 2014-03-30 17:50:42 +08:00
Xinchen Hui fa2e7ba0cb Fixed retval for ps_call_handler 2014-03-29 20:17:59 +08:00
Xinchen Hui 6e34bde64b Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-29 17:40:34 +08:00
Xinchen Hui 5c1595ca8e Refactor session (incompleted) 2014-03-29 17:39:26 +08:00
Dmitry Stogov 5324f22f59 ext/opcache refactoring (incomplete) 2014-03-28 23:34:49 +04:00
Julio Pintos 389d4e5ec3 Fix #66908: php-fpm reload leaks epoll_create() file descriptor
This patch fixes descriptor leak which could lead to DoS once Max open files is reached
2014-03-28 13:26:43 -03:00
Xinchen Hui 3647fc6fcc Refactor session (incompleted) 2014-03-28 18:46:25 +08: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
Anatol Belski 5000a2cd37 Merge branch 'PHP-5.6'
* PHP-5.6:
  update lib versions
2014-03-27 18:20:17 +01:00
Dmitry Stogov 68385716a4 Fixed support for references & cleanup 2014-03-27 18:14:57 +04:00
Dmitry Stogov 5604cfbbba cleanup 2014-03-27 18:14:42 +04:00
Dmitry Stogov 8bfd9a0e57 Fixed memory leak 2014-03-27 16:43:40 +04:00
Dmitry Stogov 9a8fbdf2f4 Use CV variable offset instead of CV variable number 2014-03-27 16:00:25 +04:00
Dmitry Stogov d83d34ba6d Cleanup 2014-03-27 14:55:52 +04:00
Dmitry Stogov c6cba55454 Use ZVAL_DEREF() macro 2014-03-27 13:39:09 +04:00
Yasuo Ohgaki 08cd3c6146 Merge branch 'PHP-5.6'
* PHP-5.6:
  Remove unneeded string copy. Allow to set ''(empty string values) internal/input/output_encoding for better compatibility. i.e. Runtime INI value changes. More compliance to the RFC. Improve/add encoding handling tests. i.e. Rather than set encoding automagic way, detect it.
2014-03-27 17:21:23 +09:00
Dmitry Stogov 54d559d893 Replaced (Z_TYPE(x) == IS_REFERENCE) with (Z_ISREF(x)) 2014-03-27 11:50:45 +04:00
Dmitry Stogov e2e99b0670 Typo 2014-03-27 11:40:59 +04:00
Dmitry Stogov 36f24c512e Inlined "slow" CV lookup code (now it's cheap)
Removed expectations for undefined CV acess for BP_VAR_W and BP_VAR_IS modes
2014-03-27 11:19:34 +04:00
Dmitry Stogov 92aef5279a Fixed support for references 2014-03-27 00:05:06 +04:00
Dmitry Stogov f53c31265f Fixed symbol table detaching 2014-03-27 00:04:50 +04:00
Dmitry Stogov f3272bf7ac Fixed extract() support IS_INDIRECT 2014-03-26 22:52:28 +04:00
Dmitry Stogov de6a76d16e fixed support for references 2014-03-26 22:06:44 +04:00
Xinchen Hui 903b6b59bf Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-26 23:25:26 +08:00
Xinchen Hui c9bca5039b Refactor session (incompleted) 2014-03-26 23:23:54 +08:00
Dmitry Stogov 887189ca31 Refactored IS_INDIRECT usage for CV and object properties to support HashTable resizing 2014-03-26 18:07:31 +04:00
Andrey Hristov a496525744 Merge branch 'PHP-5.6' 2014-03-26 15:40:54 +02:00
Anatol Belski fd89d420a8 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  fix merge issue
  Added TSRMLS_CC to zend_is_true() calls

Conflicts:
	ext/spl/spl_array.c
2014-03-26 08:31:42 +01:00
Anatol Belski 9a9af437cb Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  - Updated to version 2014.2 (2014b)
  fix merge issue
  Updated NEWS for #66834
  Call offsetGet() when called with isset() on ArrayObject derivatives
  NEWS
  NEWS
  NEWS
  Fixed bug #66946 extensive backtracking in awk rule regular expression CVE-2013-7345
  Fixed bug #66946 extensive backtracking in awk rule regular expression CVE-2013-7345

Conflicts:
	ext/spl/spl_array.c
2014-03-26 08:30:15 +01:00
Dmitry Stogov e82f112468 Fixed test (scalar values don't have reference counters...) 2014-03-26 00:01:33 +04:00
Anatol Belski ef05ba6411 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  - Updated to version 2014.2 (2014b)
  fix merge issue
  Updated NEWS for #66834
  Call offsetGet() when called with isset() on ArrayObject derivatives
  NEWS
  NEWS
  NEWS
  Fixed bug #66946 extensive backtracking in awk rule regular expression CVE-2013-7345
  Fixed bug #66946 extensive backtracking in awk rule regular expression CVE-2013-7345

Conflicts:
	ext/spl/spl_array.c
2014-03-25 17:37:06 +01:00
Derick Rethans 5fe735c5a2 Merge branch 'PHP-5.6' 2014-03-25 12:17:22 +00:00
Remi Collet ab72457d7f fix merge issue 2014-03-25 12:07:29 +01:00
Tjerk Meesters 4cb19f0a0f Added TSRMLS_CC to zend_is_true() calls 2014-03-25 19:05:43 +08:00
Tjerk Meesters 6018c47a28 Merge branch 'PHP-5.6' 2014-03-25 18:19:42 +08:00
Remi Collet 94647425d7 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fixed bug #66946 extensive backtracking in awk rule regular expression CVE-2013-7345
  Fixed bug #66946 extensive backtracking in awk rule regular expression CVE-2013-7345
2014-03-25 11:05:11 +01:00
Anatol Belski 0e15725152 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-03-25 09:06:02 +01:00
Anatol Belski 7915eb8c5c Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fix disabling PGO for extensions, rel bug #65715
  more fixes related to bug #65715
  fix some warnings
  PHP-5.6 compatibility for apache2 filter SAPI
  updated NEWS
  updated NEWS
  updated NEWS
  Fixed bug #65715 php5embed.lib isn't provided anymore
2014-03-25 09:05:49 +01:00
Anatol Belski 2fb527660d Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix disabling PGO for extensions, rel bug #65715
  more fixes related to bug #65715
  fix some warnings
  PHP-5.6 compatibility for apache2 filter SAPI
  updated NEWS
  updated NEWS
  updated NEWS
  Fixed bug #65715 php5embed.lib isn't provided anymore
2014-03-25 09:03:32 +01:00
Anatol Belski 86e77b6b58 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix disabling PGO for extensions, rel bug #65715
2014-03-25 06:46:25 +01:00
Anatol Belski 978ceb2830 Merge branch 'PHP-5.6'
* PHP-5.6:
  more fixes related to bug #65715
2014-03-24 19:19:24 +01:00
Michael Wallner 8b9d12dd47 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix some warnings
  PHP-5.6 compatibility for apache2 filter SAPI

Fixes bug #66595
2014-03-24 17:53:08 +01:00
Anatol Belski 12bc572008 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  updated NEWS
  updated NEWS
  Fixed bug #65715 php5embed.lib isn't provided anymore
2014-03-24 10:32:07 +01:00
Xinchen Hui 6965efb273 Fixed segfault due to incompleted refactoring 2014-03-24 17:14:29 +08:00
Xinchen Hui c998bfaf86 It's a tradition return NULL on error of args parsing 2014-03-24 14:31:03 +08:00
Xinchen Hui 9e96c912fc Fixed smart_str0 for empty str(more friendly for user?) 2014-03-24 14:06:35 +08:00
Xinchen Hui 50dc2ec46c Fixed memleak temporary 2014-03-24 13:57:59 +08:00
Xinchen Hui 807ed2eb19 Fixed encoding list building while array arg 2014-03-24 13:56:46 +08:00
Xinchen Hui 7caf93a785 Fixed tests (mysqlnd only) 2014-03-24 13:45:18 +08:00
Xinchen Hui 506f6a4282 Refactor mbstring (incompleted) 2014-03-24 12:40:07 +08:00
Xinchen Hui 9011a70c7f Refactor mbstring (incompleted) 2014-03-23 23:38:32 +08:00
Xinchen Hui 946269e48e Refactor mbstring (incompleted) 2014-03-23 20:04:58 +08:00
Xinchen Hui adcfee7b07 Refactor ext/mysql 2014-03-23 13:23:25 +08:00
Anatol Belski 8afbb5cdd6 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-03-22 11:06:37 +01:00
Anatol Belski 208af7e86c Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fix C89 compat
  fix signature
  Revert "Add helper function for updating bucket contents"
  Rename+move zend_hash_apply_deleter and reuse it
  Make zend_hash_apply_deleter() void, to allow reuse
  Add helper function for updating bucket contents
  Remove unnecessary check
  Fixes after merge
  Emit a warning in case of unallowed characters. Fix another place this code is used - reuse
  add info: empty strings are interned
  don't replace with ?, just skip it
2014-03-22 11:06:27 +01:00
Anatol Belski 18405e9dff Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix C89 compat
2014-03-22 10:45:56 +01:00
Anatol Belski d374c7703c Merge branch 'PHP-5.6'
* PHP-5.6:
  fix C89 compat
2014-03-22 10:44:40 +01:00
Anatol Belski 4d647197cf fix signature 2014-03-22 10:34:32 +01:00
Anatol Belski 69ae149b4f Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Revert "Add helper function for updating bucket contents"
  Rename+move zend_hash_apply_deleter and reuse it
  Make zend_hash_apply_deleter() void, to allow reuse
  Add helper function for updating bucket contents
  Remove unnecessary check
  Fixes after merge
  Emit a warning in case of unallowed characters. Fix another place this code is used - reuse
  add info: empty strings are interned
  don't replace with ?, just skip it

Conflicts:
	Zend/zend_hash.c
	ext/mysqlnd/mysqlnd.c
2014-03-22 10:24:11 +01:00
Dmitry Stogov f2a598393f Fixed wrong assignment 2014-03-22 02:40:41 +04:00
Dmitry Stogov 0e91c5a586 Fixed refcounting 2014-03-22 01:13:15 +04:00
Dmitry Stogov 6da4759769 Fixed refcounting 2014-03-22 00:00:20 +04:00
Dmitry Stogov c36294c4da Cleanup 2014-03-21 21:48:38 +04:00
Dmitry Stogov b4b728fe85 don't mark zvals as rotts if they are already processed by GC 2014-03-21 21:36:46 +04:00
Dmitry Stogov 5c169160e6 cosure->debug_info is not a subject for GC 2014-03-21 21:35:47 +04:00
Dmitry Stogov a4280c340b Fixed reference counting 2014-03-21 21:34:15 +04:00
Dmitry Stogov 130e48d375 Typo 2014-03-21 16:37:53 +04:00
Andrey Hristov b418bea1ac Merge branch 'master' of git.php.net:php-src 2014-03-21 14:33:32 +02:00
Dmitry Stogov 37db857734 Fixed CV IS_INDIRECT support 2014-03-21 15:43:53 +04:00
Dmitry Stogov a3abf6f291 Fixed refcounting 2014-03-21 15:33:08 +04:00
Dmitry Stogov 7ce06ee5a7 don't keep useless objects till the end of the script (destroy them immediately) 2014-03-21 15:32:02 +04:00
Dmitry Stogov ef6919e6f2 Fixed static data cleanup 2014-03-21 13:51:18 +04:00
Dmitry Stogov d735434e47 Fixed refcounting 2014-03-21 12:07:27 +04:00
Dmitry Stogov 2f4e8aa5d7 Fixed refcounting 2014-03-21 11:33:20 +04:00
Nikita Popov 4290293b81 Merge branch 'PHP-5.6' 2014-03-21 01:34:46 +01:00
Nikita Popov 2b89f618ff Merge branch 'PHP-5.6' 2014-03-21 00:16:03 +01:00
Dmitry Stogov 6123deb30f Fixed refcounting (proper fix) 2014-03-21 01:08:26 +04:00
Dmitry Stogov cce7d5a1ec Fixed refcounting 2014-03-21 00:34:26 +04:00
Dmitry Stogov ee0ecc83d5 Fixed invalid free 2014-03-21 00:34:03 +04:00
Dmitry Stogov 6186bc6dff Fixed iterator dtor 2014-03-20 23:28:24 +04:00
Dmitry Stogov 24b72415cb Iterator has to be properly closed 2014-03-20 23:05:38 +04:00
Andrey Hristov e3babd3ac3 Merge branch 'PHP-5.6' 2014-03-20 17:29:02 +02:00
Andrey Hristov ea93d1fe83 Merge branch 'PHP-5.6' 2014-03-20 17:24:26 +02:00
Remi Collet 3b4fcd3f39 Merge branch 'PHP-5.6'
* PHP-5.6:
  add info: empty strings are interned
2014-03-20 15:18:50 +01:00
Andrey Hristov 8ed85557e0 Merge branch 'PHP-5.6' 2014-03-20 16:16:27 +02:00
Dmitry Stogov a9d21c1457 check if object store was freed before accessing particular object 2014-03-20 17:26:20 +04:00
Dmitry Stogov 36cd92a7d3 Fixed passing argument by refefence from internal functions 2014-03-20 17:03:32 +04:00
Anatol Belski f52f68303f Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Add default_charset handling
2014-03-20 08:58:37 +01:00
Anatol Belski 8aed7642c2 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  Add default_charset handling
  Updated UPGRADING to add three changes
  OCI8: fix prototypes for oci_field_*().  They can take a column index or name.
  Change test package name ARRAYBINDPKG1 to a per-file unique name to aid parallel testing
  fix compilation error
  fix typo
  Fix problem with mysqli_commt()/mysqli_rollback()
  Restore NEWS and UPGRADING for hash_equals().
  5.5.11RC1 preparation
  Fixed typo
  Add missing E_DEPRECATED error for https://wiki.php.net/rfc/default_encoding
2014-03-20 08:56:27 +01:00
Dmitry Stogov 1968e6be65 Fixed tests (now objects are counted only once) 2014-03-20 11:54:24 +04:00
Dmitry Stogov 1d66808dc4 Reverted 07fcdc40a0 2014-03-20 11:48:49 +04:00
Anatol Belski 10248d3b5a Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Add default_charset handling
  Updated UPGRADING to add three changes
  OCI8: fix prototypes for oci_field_*().  They can take a column index or name.
  Change test package name ARRAYBINDPKG1 to a per-file unique name to aid parallel testing
  fix compilation error
  fix typo
  Fix problem with mysqli_commt()/mysqli_rollback()
  Restore NEWS and UPGRADING for hash_equals().
  5.5.11RC1 preparation
  Fixed typo
  Add missing E_DEPRECATED error for https://wiki.php.net/rfc/default_encoding

Conflicts:
	ext/mysqli/mysqli_api.c
	ext/mysqlnd/mysqlnd.c
	ext/standard/html.c
2014-03-20 08:47:51 +01:00
Dmitry Stogov 9db5076718 Fixed GC 2014-03-20 11:38:13 +04:00
Dmitry Stogov 07fcdc40a0 Fixed circular array copying 2014-03-20 11:37:42 +04:00
Dmitry Stogov e4e7502548 fixed compilation warning 2014-03-20 11:36:59 +04:00
Yasuo Ohgaki bd9978331f Merge branch 'PHP-5.6'
* PHP-5.6:
  Add default_charset handling
2014-03-20 11:04:23 +09:00
Yasuo Ohgaki 8f5a31ff37 Add default_charset handling 2014-03-20 11:03:02 +09:00
Christopher Jones 122c69a0be Merge branch 'PHP-5.6'
* PHP-5.6:
  OCI8: fix prototypes for oci_field_*().  They can take a column index or name.
2014-03-19 15:23:40 -07:00
Dmitry Stogov 373855ef49 Fixed GC 2014-03-20 01:41:55 +04:00
Christopher Jones 3406f98439 Merge branch 'PHP-5.6'
* PHP-5.6:
  Change test package name ARRAYBINDPKG1 to a per-file unique name to aid parallel testing
2014-03-19 14:13:40 -07:00
Dmitry Stogov a6f09e48d7 Fixed memory leak 2014-03-20 01:05:06 +04:00
Dmitry Stogov 2909c72b69 Improved GC compatibility 2014-03-20 00:29:20 +04:00
Dmitry Stogov 3c0feb51bc Fixed assignment of "new" by reference 2014-03-19 23:51:28 +04:00
Dmitry Stogov 5db78476e3 Mark objects that are going to be deleted 2014-03-19 23:50:50 +04:00
Dmitry Stogov acc719766d More accurate zval comparison 2014-03-19 22:43:36 +04:00
Dmitry Stogov e884d5d8e3 Fixed assignment reference to itself 2014-03-19 22:43:06 +04:00
Andrey Hristov d22d1035cb Merge branch 'PHP-5.6' 2014-03-19 19:15:15 +02:00
Andrey Hristov e756f417b9 Merge branch 'PHP-5.6' 2014-03-19 18:55:40 +02:00
Dmitry Stogov cb411f024d GC cleanup 2014-03-19 18:11:46 +04:00
Dmitry Stogov 120dfd1e04 GC cleanup 2014-03-19 17:55:42 +04:00
Dmitry Stogov 9385ddaff9 GC related fix 2014-03-19 17:25:19 +04:00
Adam Harvey 4bac43a520 Merge branch 'PHP-5.6' 2014-03-19 06:25:06 -07:00
Dmitry Stogov 76cd829efd Fixed double free 2014-03-19 17:00:58 +04:00
Dmitry Stogov b7938ab1bd Refactored GC (incomplete) 2014-03-19 17:00:28 +04:00
Yasuo Ohgaki dc471acafe Merge branch 'PHP-5.6'
* PHP-5.6:
  Add missing E_DEPRECATED error for https://wiki.php.net/rfc/default_encoding
2014-03-19 18:14:32 +09:00
Anatol Belski 3b55f66d93 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fix macros
2014-03-19 09:46:01 +01:00
Anatol Belski fa6ba0ecdb fix macros 2014-03-19 09:45:22 +01:00
Anatol Belski 177d45ee17 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-03-19 09:43:16 +01:00
Anatol Belski c569a6502d Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  prep for 5.4.27 rc1
  remove obsolete comment
  Fixes to various stream cast on win64
  - Updated to version 2014.1 (2014a)
  Add a test
  Add hash_equals() to perform string comparisons that are not vulnerable to timing attacks.
2014-03-19 09:42:59 +01:00
Anatol Belski 87da8f58e2 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  prep for 5.4.27 rc1
  remove obsolete comment
  Fixes to various stream cast on win64
  - Updated to version 2014.1 (2014a)
  Add a test
  Add hash_equals() to perform string comparisons that are not vulnerable to timing attacks.

Conflicts:
	ext/bz2/bz2.c
	ext/standard/streamsfuncs.c
2014-03-19 08:53:59 +01:00
Stanislav Malyshev 2833c3b77d Merge branch 'PHP-5.6'
* PHP-5.6:
  prep for 5.4.27 rc1
2014-03-18 23:25:32 -07:00
Anatol Belski 6d6cce0f56 Merge branch 'PHP-5.6'
* PHP-5.6:
  remove obsolete comment
  Fixes to various stream cast on win64
2014-03-19 06:38:18 +01:00
Adam Harvey 68e479b94d Merge branch 'PHP-5.6'
* PHP-5.6:
  Add hash_equals() to perform string comparisons that are not vulnerable to timing attacks.
2014-03-18 09:33:22 -07:00
Derick Rethans 22fc261628 Merge branch 'PHP-5.6' 2014-03-18 15:02:27 +00:00
Andrey Hristov dd1670067c Merge branch 'PHP-5.6' 2014-03-18 16:19:34 +02:00
Anatol Belski 849b546ba0 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-03-18 14:12:54 +01:00
Anatol Belski 4535642ad4 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  Fixed wrong indentation
  Fix phpdbg build on FreeBSD
  Fixed off-by-one in php_url_parse_ex
  Fixed typo in UPGRADING and modified php.ini-* description for encoding related changes
  Add support for PCRE marks
  Update UPGRADING. Add more descriptions about default_charset and encoding related changes. Many thanks to Christopher.
  UPGRADING (openssl updates)
  Support async pgsql connections and non-blocking queries
2014-03-18 14:11:44 +01:00
Anatol Belski ed70f02b29 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Fixed wrong indentation
  Fix phpdbg build on FreeBSD
  Fixed off-by-one in php_url_parse_ex
  Fixed typo in UPGRADING and modified php.ini-* description for encoding related changes
  Add support for PCRE marks
  Update UPGRADING. Add more descriptions about default_charset and encoding related changes. Many thanks to Christopher.
  UPGRADING (openssl updates)
  Support async pgsql connections and non-blocking queries

Conflicts:
	ext/pcre/php_pcre.c
	ext/pgsql/pgsql.c
2014-03-18 14:03:25 +01:00
Dmitry Stogov 2e3e96b24b Fixed zend_string*/char* mess 2014-03-18 14:53:13 +04:00
Dmitry Stogov da9a2872b0 Fixed cleanup on request shutdown 2014-03-18 14:52:54 +04:00
Mateusz Kocielski 582032b659 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed wrong indentation
2014-03-18 10:50:16 +01:00
Dmitry Stogov 89ad91a8cc Fixed tests 2014-03-18 13:28:50 +04:00
Dmitry Stogov 6b6e903688 Fixed support for references 2014-03-18 13:20:11 +04:00
Mateusz Kocielski 1a5c51829a Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix phpdbg build on FreeBSD
  Fixed off-by-one in php_url_parse_ex
2014-03-18 10:03:06 +01:00
Dmitry Stogov 2adecc6dc2 Fixed reference separation 2014-03-18 12:37:51 +04:00
Dmitry Stogov e47c080ce8 Fixed stream_filter_remove() 2014-03-18 11:50:22 +04:00
Dmitry Stogov a7b33bb431 Fixed memory leak 2014-03-18 11:34:09 +04:00
Dmitry Stogov 1b2b7f410f Fixed URL scanner 2014-03-18 11:18:40 +04:00
Yasuo Ohgaki 789b10ccb5 Merge branch 'PHP-5.6'
* PHP-5.6:
 Modified php.ini-* description for encoding related changes
2014-03-18 07:29:22 +09:00
Nikita Popov 2c31b9f506 Merge branch 'PHP-5.6' 2014-03-17 22:32:45 +01:00
Dmitry Stogov 811a523c30 Fixed error logging with date 2014-03-18 01:32:03 +04:00
Dmitry Stogov dbc68b9b88 Fixed tests (scalar don't have reference counter, other values may get different counter values) 2014-03-18 01:16:12 +04:00
Dmitry Stogov 292c01d890 Fixed get_browser() 2014-03-18 00:55:25 +04:00
Dmitry Stogov 53a63dbd7d Fixed stream notifier 2014-03-18 00:08:50 +04:00
Dmitry Stogov aa5f55306b Refactored EG(active_symbol_table) to be zend_array* instead of HashTable* 2014-03-17 23:15:22 +04:00
Dmitry Stogov 1b6327fd3b Fixed string length 2014-03-17 21:38:48 +04:00
Xinchen Hui 3203c65c7c Fixed COUNT_RECURSIVE reference handling 2014-03-17 22:04:54 +08:00
Daniel Lowrey ddbd20bd29 Merge branch 'PHP-5.6'
* PHP-5.6:
  Support async pgsql connections and non-blocking queries
2014-03-17 08:03:54 -06:00
Dmitry Stogov 77f4c94114 Fixed test (the expected output and master behavior are wrong) 2014-03-17 17:55:51 +04:00
Dmitry Stogov 355b136466 Fixed ext/ereg problems 2014-03-17 17:38:15 +04:00
Dmitry Stogov 62c448ab8b Fixed serialize/unserialize problems 2014-03-17 17:23:27 +04:00
Anatol Belski 87958f8cf7 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fix macros
2014-03-17 11:15:13 +01:00
Anatol Belski 1ad45a3741 fix macros 2014-03-17 11:14:33 +01:00
Anatol Belski 81fc3398c1 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-03-17 11:08:17 +01:00
Anatol Belski 263572fbe3 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  Fix bug #66873: check if obj->src is set
  updated NEWS
  updated to oniguruma to 5.9.5
2014-03-17 11:07:54 +01:00
Anatol Belski 300a8df8f4 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Fix bug #66873: check if obj->src is set
  updated NEWS
  updated to oniguruma to 5.9.5

Conflicts:
	ext/intl/converter/converter.c
2014-03-17 10:37:46 +01:00
Stanislav Malyshev 5b6c416002 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #66873: check if obj->src is set
2014-03-17 01:20:31 -07:00
Xinchen Hui 648f1081c9 Fixed function name comparation 2014-03-17 12:32:42 +08:00
Xinchen Hui 7d8e990f29 Fixed add_ref asseration fail 2014-03-17 12:16:46 +08:00
Xinchen Hui 897a4d255a Refactor reflection_object to fix bug after default_properties changed 2014-03-17 12:15:22 +08:00
Xinchen Hui 466dbfee88 Fixed NULL pointer dereference 2014-03-17 12:05:52 +08:00
Xinchen Hui 639c4da20a Forgot fix similar issue in spl_recursive_it_get_method 2014-03-16 23:04:07 +08:00
Xinchen Hui 86aa343d3b Fixed spl_dual_it_get_method 2014-03-16 23:02:14 +08:00
Xinchen Hui b78bbe93ca Fixed segfault (invalid free handling) 2014-03-16 22:05:38 +08:00
Xinchen Hui 5ec42e9dec Fixed memory leak while cloning (All tests passes now in ext/date) 2014-03-16 18:09:27 +08:00
Xinchen Hui 10490a1eb2 Fixed tests, reflection doesn't return reference anymore 2014-03-16 18:09:06 +08:00
Xinchen Hui 6956d7e3eb Refactor date to fixed bug after default_properties changed 2014-03-16 17:14:31 +08:00
Xinchen Hui 5df7fe59f3 Fixed wrong md5 str length 2014-03-16 15:52:50 +08:00
Xinchen Hui 5639a2a8ef Reflection doesn't return ref anymore 2014-03-16 15:47:08 +08:00
Xinchen Hui 051a3eb45b Fixed string handling in ext/spl/tests/recursive_tree_iterator_001.phpt 2014-03-16 15:45:45 +08:00
Xinchen Hui bf5e00f2e6 Fixed reference handling in pcre_grep 2014-03-16 15:40:35 +08:00
Xinchen Hui 412ca11eda Fixed reference arg hanlding in pcre_replace 2014-03-16 08:45:43 +08:00
Xinchen Hui ef1e006bd6 Refactor php_pcre_replace to return zend_string 2014-03-16 08:44:07 +08:00
Anatol Belski 511ea15808 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  updated to oniguruma to 5.9.5
2014-03-15 18:00:38 +01:00
Xinchen Hui 6dd3d5cb36 Should not release container before dup 2014-03-15 22:43:40 +08:00
Xinchen Hui d0bbc227aa IS_UNDEF should never goes to user script land 2014-03-15 22:37:27 +08:00
Xinchen Hui 2a8cef80cf Fixed typo 2014-03-15 22:23:30 +08:00
Xinchen Hui b264e96497 Fixed bug codes in SplFileInfo::getExtension 2014-03-15 22:17:55 +08:00
Xinchen Hui a49781f20d Fixed refcounted 2014-03-15 22:13:55 +08:00
Xinchen Hui 9d4dca0880 Refactor Spl_Directory to fixed bug after default_properties changed 2014-03-15 22:07:40 +08:00
Xinchen Hui 34dac6ddbc Fixed several bugs in spl_autoload 2014-03-15 19:34:07 +08:00
Xinchen Hui c201896125 Fixed memory leak while add_mem faile 2014-03-15 19:33:36 +08:00
Xinchen Hui 19045f0d27 Fixed refcount asseration 2014-03-15 19:16:07 +08:00
Xinchen Hui 8558dc8eaf Refactor Spl_Heap to fixed bug after default_properties change 2014-03-15 19:14:11 +08:00
Xinchen Hui cc79496b97 Refactor Spl_Iterators to fixed default_properties change 2014-03-15 16:33:55 +08:00
Xinchen Hui 6c10f7ac36 Refactored Spl_Dllist to fixed zend_object->default_properties change 2014-03-15 14:44:50 +08:00
Xinchen Hui 4d9d08269c Refactored Spl_Arrary to fixed zend_object->default_properties change 2014-03-15 14:32:32 +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
Julio Pintos 4c70701e58 fix file descriptor leak of epollfd 2014-03-14 16:47:30 -03:00
Dmitry Stogov 232f3e915c Fixed various CLI problems 2014-03-14 18:00:42 +04:00
Dmitry Stogov c094fc11be Fixed refcounting 2014-03-14 15:54:49 +04:00
Anatol Belski aa0c920cc5 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-03-14 12:36:50 +01:00
Dmitry Stogov 51494f252f Don't include trailing zero into hash caclculation 2014-03-14 15:35:57 +04:00
Anatol Belski c302a31491 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  NEWS
  NEWS
  NEWS
  Fixed Bug #66833 Default digest algo is still MD5
  reorder the struct members which reduces its size by at least 112 bytes
  arg count is zend_size_t now, fix type
  Fix 5.5.10 NEWS
  fix declarations
  Typo fix: sicret -> secret
2014-03-14 12:27:09 +01:00
Anatol Belski 78fef11fe5 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fixed Bug #66833 Default digest algo is still MD5
  Fix 5.5.10 NEWS
  Typo fix: sicret -> secret
2014-03-14 12:21:20 +01:00
Remi Collet 90ea07a25c Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fixed Bug #66833 Default digest algo is still MD5
  Fix 5.5.10 NEWS
2014-03-14 09:53:35 +01:00
Dmitry Stogov 734db60eaa Fixed reference support 2014-03-14 12:50:20 +04:00
Dmitry Stogov 5f613c0d23 Fixed support for references 2014-03-14 12:14:59 +04:00
Dmitry Stogov dd1bd54408 Fixed support for references 2014-03-13 23:23:20 +04:00
Dmitry Stogov 493d5adab5 Fixed test (scalars don;t have reference counter any more) 2014-03-13 23:04:30 +04:00
Dmitry Stogov b8089696c4 Fixed support for references 2014-03-13 22:56:18 +04:00
Dmitry Stogov c1236214fe REFERENCE is always REFCOUNTED 2014-03-13 22:07:37 +04:00
Dmitry Stogov 5f861768d6 Fixed reference conversion 2014-03-13 22:07:14 +04:00
Anatol Belski beac52a78b reorder the struct members which reduces its size by at least 112 bytes 2014-03-13 18:28:22 +01:00
Anatol Belski 39fa14d089 arg count is zend_size_t now, fix type 2014-03-13 18:26:43 +01:00
Dmitry Stogov bfdaf6e806 Fixed reference support 2014-03-13 17:59:50 +04:00
Dmitry Stogov 25d55d16fc Fixed foreach (now we store HashPointer in additional IS_TMP_VAR slot(s)) 2014-03-13 17:01:28 +04:00
Anatol Belski 3a66f6343c fix declarations 2014-03-13 05:47:31 -07:00
Lior Kaplan 14731a7501 Merge branch 'PHP-5.6'
* PHP-5.6:
  Typo fix: sicret -> secret
2014-03-13 12:43:15 +02:00
Dmitry Stogov 918866da5f Fixed autoconversion from reference to ordinal value 2014-03-13 14:24:08 +04:00
Anatol Belski 386d326e8a Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-03-13 11:17:04 +01:00
Anatol Belski b4c627c826 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fix array types for pass by ref
  fix macro
  updated libs_version.txt
2014-03-13 11:16:55 +01:00
Anatol Belski af0bc1a306 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  updated libs_version.txt
2014-03-13 11:16:12 +01:00
Anatol Belski 65fcde6651 fix array types for pass by ref 2014-03-13 11:02:05 +01:00
Anatol Belski be0563b5b0 fix macro 2014-03-13 10:50:30 +01:00
Anatol Belski 21db15ed1d Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libs_version.txt
2014-03-13 10:31:26 +01:00
Anatol Belski 90bf37bff9 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-03-13 10:19:02 +01:00
Anatol Belski 1f094bf6f5 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fix zpp
  Remove unneeded test
  Update NEWS
  Revert "Implement Bug #54649 Create session_serializer_name()"
  Revert "Implemented Request #11100 (session_gc() function)."
  made libgd recognize the 9 version series
  fix include search
  NEWS
  NEWS
  Fix bug  #66887 imagescale - poor quality of scaled image
  NEWS
  Fixed Bug #66893i imagescale ignore method argument
  Add SKIPIF in GMP test
  Fix hash_pbkdf2() with missing $length argument
  typo in NEWS
  typo in NEWS
  NEWS
  NEWS
  Fixed Bug #66890 imagescale segfault
  Updated UPGRADING to cover PDO_pgsql changes
2014-03-13 10:18:50 +01:00
Anatol Belski 5ea53dc6df fix zpp 2014-03-13 10:16:19 +01:00
Dmitry Stogov 6c8ac33b69 Fixed test 2014-03-13 12:42:24 +04:00
Anatol Belski 3fdbb0d39f Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Remove unneeded test
  Update NEWS
  Revert "Implement Bug #54649 Create session_serializer_name()"
  Revert "Implemented Request #11100 (session_gc() function)."
  made libgd recognize the 9 version series
  fix include search
  NEWS
  NEWS
  Fix bug  #66887 imagescale - poor quality of scaled image
  NEWS
  Fixed Bug #66893i imagescale ignore method argument
  Add SKIPIF in GMP test
  Fix hash_pbkdf2() with missing $length argument
  typo in NEWS
  typo in NEWS
  NEWS
  NEWS
  Fixed Bug #66890 imagescale segfault
  Updated UPGRADING to cover PDO_pgsql changes

Conflicts:
	ext/gd/gd.c
	ext/hash/hash.c
	ext/session/session.c
2014-03-13 08:38:58 +01:00
Yasuo Ohgaki ea72093259 Merge branch 'PHP-5.6'
* PHP-5.6:
  Remove unneeded test
2014-03-13 06:55:10 +09:00
Yasuo Ohgaki 0021095c40 Merge branch 'PHP-5.6'
* PHP-5.6:
  Revert "Implement Bug #54649 Create session_serializer_name()"
  Revert "Implemented Request #11100 (session_gc() function)."
2014-03-13 06:33:28 +09:00
Dmitry Stogov e0dd8a4f4b Fixed IS_INDIRECT handling when assign array element by reference.
This might cause passing invalid pointer if the array could be resized before IS_INDIRECT usage.
Now we use IS_REFERENCE instead of IS_INDIRECT.
The following test crashed before:
<?php $a = array(0,1,2,3,4,5,6,7); $a[8] = &$a[7]; ?>
2014-03-13 00:30:53 +04:00
Anatol Belski f407482fcc Merge branch 'PHP-5.6'
* PHP-5.6:
  made libgd recognize the 9 version series
2014-03-12 19:31:21 +01:00
Anatol Belski 983e105d6b Merge branch 'PHP-5.6'
* PHP-5.6:
  fix include search
2014-03-12 19:25:44 +01:00
Remi Collet 1db6ecc235 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  Fix bug  #66887 imagescale - poor quality of scaled image
2014-03-12 17:13:55 +01:00
Remi Collet a498e64914 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  Fixed Bug #66893i imagescale ignore method argument
2014-03-12 15:36:52 +01:00
Nikita Popov e2a5859b2f Merge branch 'PHP-5.6' 2014-03-12 14:17:27 +01:00
Remi Collet bc8095350d Merge branch 'PHP-5.6'
* PHP-5.6:
  typo in NEWS
  typo in NEWS
2014-03-12 14:08:36 +01:00
Remi Collet ee06def81b Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  Fixed Bug #66890 imagescale segfault
2014-03-12 13:47:36 +01:00
Matteo Beccati f35aba1874 Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated UPGRADING to cover PDO_pgsql changes
2014-03-12 12:32:25 +01:00
Dmitry Stogov 72f738c368 Fixed reference afto conversion 2014-03-12 12:07:03 +04:00
Anatol Belski bda12b052a Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-03-12 09:06:05 +01:00
Anatol Belski c6f5be6427 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  Updated NEWS
  Added new PDO::PGSQL_ATTR_DISABLE_PREPARES that uses PQexecParams
  Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT
  Drop PDO support for extremely old libpq versions
  Fix compile error with theoretically supported versions of libcurl < 7.12.3.
2014-03-12 09:05:51 +01:00
Anatol Belski 63d06ce9b0 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Updated NEWS
  Added new PDO::PGSQL_ATTR_DISABLE_PREPARES that uses PQexecParams
  Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT
  Drop PDO support for extremely old libpq versions
  Fix compile error with theoretically supported versions of libcurl < 7.12.3.

Conflicts:
	ext/pdo_pgsql/pdo_pgsql.c
	ext/pdo_pgsql/pgsql_driver.c
2014-03-12 09:02:39 +01:00
Matteo Beccati f702bf3178 Merge branch 'PHP-5.6'
* PHP-5.6:
  Added new PDO::PGSQL_ATTR_DISABLE_PREPARES that uses PQexecParams
  Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT
  Drop PDO support for extremely old libpq versions
2014-03-11 23:30:18 +01:00
Dmitry Stogov d708d3c596 Fixed passing arguments by reference from internal functions 2014-03-11 22:33:28 +04:00
Adam Harvey 4ab192908f Merge branch 'PHP-5.6' 2014-03-11 11:07:21 -07:00
Anatol Belski 7fbf929125 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-03-11 16:36:35 +01:00
Anatol Belski 7d770a9d50 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fix path separator
  Use /dev/urandom as the default mcrypt_create_iv() source
  Add tests for bug #66872 and gmp_[rem]root
  Fixed mcrypt test case
  Removed bogus loops
  restored the old code in 5.4/5 related to bug #66872
2014-03-11 16:36:12 +01:00
Anatol Belski f224455520 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix path separator
2014-03-11 16:30:43 +01:00
Anatol Belski 664b38a21d Merge branch 'PHP-5.6'
* PHP-5.6:
  fix path separator
2014-03-11 16:29:53 +01:00
Anatol Belski adbb44537a Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Use /dev/urandom as the default mcrypt_create_iv() source
  Add tests for bug #66872 and gmp_[rem]root
  Fixed mcrypt test case
  Removed bogus loops
  restored the old code in 5.4/5 related to bug #66872

Conflicts:
	ext/mcrypt/mcrypt.c
2014-03-11 15:32:07 +01:00
Nikita Popov 32103286de Merge branch 'PHP-5.6' 2014-03-11 14:06:57 +01:00
Tjerk Meesters ea72a9b771 Merge branch 'PHP-5.6' 2014-03-11 19:17:11 +08:00
Anatol Belski 4bebb23d00 Merge branch 'PHP-5.6'
* PHP-5.6:
  restored the old code in 5.4/5 related to bug #66872
2014-03-11 11:53:42 +01:00
Dmitry Stogov 8863df3653 Fixed reference handling 2014-03-11 14:49:25 +04:00
Anatol Belski b873bb63c5 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  inject it directly. This is not C++ and I don't want to use hacks with similar structures that are binary compatible. Better be explicit.

Conflicts:
	ext/mysqlnd/mysqlnd_structs.h
2014-03-11 09:58:36 +01:00
Anatol Belski b99af06dfe Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  Fixed Bug #66875 (Improve performance of multi-row OCI_RETURN_LOB queries)
2014-03-11 09:56:44 +01:00
Anatol Belski 78bbfd7fac Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Fixed Bug #66875 (Improve performance of multi-row OCI_RETURN_LOB queries)
2014-03-11 09:46:41 +01:00
Anatol Belski 0ae46ce747 no need to fetch ts id here 2014-03-11 09:40:47 +01:00
Anatol Belski ddf306fdd2 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  updated libsqlite to 3.8.3.1 in 5.5 branch, too
  DI
  Switch from a single flag to a flag byte
  updated libmagic.patch
  updated libmagic.patch

Conflicts:
	Zend/zend_language_scanner.c
2014-03-11 09:40:08 +01:00
Anatol Belski bed93450cd Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  updated libsqlite to 3.8.3.1 in 5.5 branch, too
  DI
  Switch from a single flag to a flag byte
  updated libmagic.patch
  updated libmagic.patch
  update NEWS
  fix #66872, invalid argument crashes gmp_testbit
  fix #66872, invalid argument crashes gmp_testbit
  update news
  - fix #66869, Invalid 2nd argument crashes imageaffinematrixget
  add vc12 (2013)
  add vc12 (2013)

Conflicts:
	Zend/zend_ini_scanner.c
	Zend/zend_language_scanner.c
	ext/mysqlnd/mysqlnd_structs.h
2014-03-11 09:26:05 +01:00
Dmitry Stogov 4b5e67638e Reverted wrong fix 2014-03-11 11:34:23 +04:00
Xinchen Hui 53e312c663 Review ended
Revert "An demo(for review) to show how to fix the problem(symbol table resize)"

This reverts commit 60c354510b.
2014-03-11 14:23:14 +08:00
Christopher Jones cc409199f9 Merge branch 'master' of https://git.php.net/repository/php-src
# By Andrey Hristov (3) and Anatol Belski (1)
# Via Andrey Hristov (8) and others
* 'master' of https://git.php.net/repository/php-src:
  inject it directly. This is not C++ and I don't want to use hacks with similar structures that are binary compatible. Better be explicit.
  updated libsqlite to 3.8.3.1 in 5.5 branch, too
  DI
  Switch from a single flag to a flag byte
2014-03-10 16:46:43 -07:00
Christopher Jones de4ff2c5a4 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed Bug #66875 (Improve performance of multi-row OCI_RETURN_LOB queries)
2014-03-10 16:34:21 -07:00
Andrey Hristov fa2e8615bf Merge branch 'master' of git.php.net:php-src 2014-03-10 19:24:29 +02:00
Andrey Hristov 5e836b443c Merge branch 'PHP-5.6' 2014-03-10 19:16:22 +02:00
Andrey Hristov d2a291393a inject it directly. This is not C++ and I don't want to use hacks with similar structures
that are binary compatible. Better be explicit.
2014-03-10 19:15:30 +02:00
Anatol Belski 6cac2eec27 Merge branch 'master' of git.php.net:php-src 2014-03-10 17:52:32 +01:00
Anatol Belski 720522a24d Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libsqlite to 3.8.3.1 in 5.5 branch, too
2014-03-10 17:51:05 +01:00
Andrey Hristov 3456d47235 Merge branch 'PHP-5.6' 2014-03-10 18:19:22 +02:00
Andrey Hristov 07738a0f2b Merge branch 'PHP-5.6' 2014-03-10 17:52:48 +02:00
Andrey Hristov 2cece8574f Merge branch 'master' of git.php.net:php-src 2014-03-10 17:34:08 +02:00
Pierre Joye b1e661e0c5 Merge branch 'master' of git.php.net:php-src
# By Anatol Belski
# Via Anatol Belski
* 'master' of git.php.net:php-src:
  updated libmagic.patch
  updated libmagic.patch
  fix ZTS
2014-03-10 16:26:57 +01:00
Andrey Hristov f995187d34 Merge branch 'PHP-5.6' 2014-03-10 17:26:13 +02:00
Anatol Belski cfe1a63f4d Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libmagic.patch
  updated libmagic.patch
2014-03-10 14:18:06 +01:00
Anatol Belski 82c056235a Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  fix ZTS
  update NEWS
  fix #66872, invalid argument crashes gmp_testbit
  fix #66872, invalid argument crashes gmp_testbit
  update news
  - fix #66869, Invalid 2nd argument crashes imageaffinematrixget
  Fixed mcrypt test case
  add vc12 (2013)
  add vc12 (2013)

Conflicts:
	ext/openssl/openssl.c
2014-03-10 12:45:17 +01:00
Anatol Belski b582be1e23 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  Fix indentation
2014-03-10 12:33:02 +01:00
Anatol Belski be9c9da186 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Fix indentation
2014-03-10 12:30:09 +01:00
Anatol Belski 4b9cf5468a Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport: (48 commits)
  more fixes to ext/mcrypt
  partly revert the wrong merge
  Do not remove *.1, it's not generated by make but configure
  Fix typo: entory -> entry
  after merge fixes
  updated NEWS
  removed the libsqlite patch as it's not relevant anymore
  updated bundled libsqlite to 3.8.3.1
  add OPSYS_Z_CPM missing constant
  Update php.ini files (new openssl directives)
  Fixed null termination
  Updated NEWS for #65545
  Updated NEWS for #65545
  Add fread(length) method
  Updated news for #66822
  Allow T_POW in constant expressions
  Fix typo
  Fix #66698: Add fnv1a32 and fnv1a64 hash options
  Fix HTML entity table generation
  Add test for bug #62102 / RFC 2144
  ...

Conflicts:
	ext/openssl/openssl.c
	ext/openssl/xp_ssl.c
2014-03-10 12:28:00 +01:00
Anatol Belski dd7ecf2c5b fix ZTS 2014-03-10 12:24:32 +01:00
Pierre Joye 6d6da2f189 Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS
  fix #66872, invalid argument crashes gmp_testbit
  fix #66872, invalid argument crashes gmp_testbit
  add vc12 (2013)
2014-03-10 12:19:36 +01:00
Pierre Joye 5f88102fca Merge branch 'master' of git.php.net:php-src
# By Andrey Hristov (1) and others
# Via Andrey Hristov (3) and others
* 'master' of git.php.net:php-src:
  Fix indentation
  Do not remove *.1, it's not generated by make but configure
  Fix typo: entory -> entry
2014-03-10 12:19:32 +01:00
Andrey Hristov 9a112e00cd Merge branch 'PHP-5.6' 2014-03-10 12:55:53 +02:00
Anatol Belski 61363d4751 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Do not remove *.1, it's not generated by make but configure
  Fix typo: entory -> entry
2014-03-10 11:16:19 +01:00
Anatol Belski 8cea765858 more fixes to ext/mcrypt 2014-03-10 11:15:34 +01:00
Xinchen Hui 60c354510b An demo(for review) to show how to fix the problem(symbol table resize) 2014-03-10 16:25:05 +08:00
Xinchen Hui 80625f20e5 Revert "An demo(for review) to show how to fix the problem we meet"
This reverts commit 4aeae15706.
2014-03-10 16:24:35 +08:00
Anatol Belski 0190e37ec6 partly revert the wrong merge 2014-03-10 09:21:12 +01:00
Xinchen Hui 29500848f6 Merge branch 'PHP-5.6' 2014-03-10 15:55:20 +08:00
Xinchen Hui 4aeae15706 An demo(for review) to show how to fix the problem we meet 2014-03-10 11:29:28 +08:00
Xinchen Hui a38694be52 Fixed warning mesg 2014-03-10 10:49:53 +08:00
Lior Kaplan 7cf0931f18 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix typo: entory -> entry
2014-03-09 23:07:48 +02:00
Pierre Joye c1732700db Merge branch 'PHP-5.6'
* PHP-5.6:
  update news
  - fix #66869, Invalid 2nd argument crashes imageaffinematrixget
  add vc12 (2013)
2014-03-09 21:18:23 +01:00
Pierre Joye bf58535965 Merge branch 'master' of git.php.net:php-src
# By Nikita Popov (10) and others
# Via Remi Collet (9) and others
* 'master' of git.php.net:php-src: (41 commits)
  updated NEWS
  removed the libsqlite patch as it's not relevant anymore
  updated bundled libsqlite to 3.8.3.1
  Fixed mcrypt test case
  add OPSYS_Z_CPM missing constant
  Update php.ini files (new openssl directives)
  Fixed null termination
  Updated NEWS for #65545
  Updated NEWS for #65545
  Add fread(length) method
  Updated news for #66822
  Allow T_POW in constant expressions
  Fix typo
  Fix #66698: Add fnv1a32 and fnv1a64 hash options
  Fix HTML entity table generation
  Add test for bug #62102 / RFC 2144
  Whitespace.
  Misc cleanup including adding the version number
  Fix order in NEWS
  Add CVE ref (not known at release time)
  ...
2014-03-09 17:06:57 +01:00
Anatol Belski 2a2649ed0a after merge fixes 2014-03-09 16:17:44 +01:00
Anatol Belski 7b8ba8e3e3 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (43 commits)
  updated NEWS
  removed the libsqlite patch as it's not relevant anymore
  updated bundled libsqlite to 3.8.3.1
  add OPSYS_Z_CPM missing constant
  Update php.ini files (new openssl directives)
  Fixed null termination
  Updated NEWS for #65545
  Updated NEWS for #65545
  Add fread(length) method
  Updated news for #66822
  Allow T_POW in constant expressions
  Fix typo
  Fix #66698: Add fnv1a32 and fnv1a64 hash options
  Fix HTML entity table generation
  Add test for bug #62102 / RFC 2144
  Whitespace.
  Misc cleanup including adding the version number
  Fix order in NEWS
  Add CVE ref (not known at release time)
  Fix NEWS for 5.5.11 fix (really not in 5.5.10)
  ...

Conflicts:
	ext/mcrypt/mcrypt.c
	ext/mysqlnd/mysqlnd.h
	ext/mysqlnd/mysqlnd_ps.c
	ext/mysqlnd/mysqlnd_result.c
	ext/mysqlnd/mysqlnd_result.h
	ext/mysqlnd/mysqlnd_structs.h
	ext/openssl/openssl.c
	ext/openssl/xp_ssl.c
	ext/zip/php_zip.c
2014-03-09 15:00:36 +01:00
Xinchen Hui 43eaced19f All tests passed in ext/standard/tests/dir now 2014-03-09 20:10:02 +08:00
Xinchen Hui 2465f5c6d9 Use list_close here (by ext/standard/tests/dir/closedir_basic.phpt) 2014-03-09 20:08:06 +08:00
Anatol Belski e3776042b9 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
2014-03-09 13:06:51 +01:00
Anatol Belski efd983a40f Merge branch 'PHP-5.6'
* PHP-5.6:
  removed the libsqlite patch as it's not relevant anymore
2014-03-09 13:04:14 +01:00
Xinchen Hui 661df93ea8 IS_REFERENCE is unfrequent 2014-03-09 20:03:24 +08:00
Anatol Belski c34aa1cd63 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated bundled libsqlite to 3.8.3.1
2014-03-09 13:02:33 +01:00
Xinchen Hui 9f3687d4db Use list_close here to fix ext/standard/tests/file/popen_pclose_basic.phpt 2014-03-09 19:56:48 +08:00
Xinchen Hui 6c557d867c Fixed ref hanlding in ADD_ARRAY_ELEMENT (by ext/standard/tests/array/bug30074.phpt) 2014-03-09 19:45:45 +08:00
Xinchen Hui b2b457a7e0 Fixed wrong addref usage in extract 2014-03-09 11:53:06 +08:00
Xinchen Hui 4b40e40ad0 Fixed memleak while sending IS_REFERENCE 2014-03-09 11:48:09 +08:00
Xinchen Hui f1ed4f6bf9 Fixed parse_ini_file 2014-03-09 11:35:20 +08:00
Xinchen Hui 7668f7f95a Fixed double free in parse_ini_string 2014-03-09 11:06:06 +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
Tjerk Meesters 84efa66e4d Updated test case with expected output 2014-03-08 16:17:30 +08:00
Tjerk Meesters d09eb1504a Fixed mcrypt test case 2014-03-08 16:16:46 +08:00
Xinchen Hui 1d4cea40e3 Refactor SplObjectStorage make it works 2014-03-08 14:47:55 +08:00
Dmitry Stogov 7cd78822ab Fixed assignment to reference 2014-03-08 00:02:12 +04:00
Xinchen Hui 3f794ba743 Improve codes 2014-03-07 22:33:36 +08:00
Dmitry Stogov f0989e332f Fixed char*/zend_string* inconsistency 2014-03-07 18:23:57 +04:00
Dmitry Stogov 6ad3abcd3e Temporary fix memory leaks 2014-03-07 17:21:29 +04:00
Dmitry Stogov b671c3a28a Fixed refcounting 2014-03-07 17:17:35 +04:00
Dmitry Stogov d599d0cecd Temporary fix memory leaks 2014-03-07 17:14:16 +04:00
Remi Collet 397b8aa2ad Merge branch 'PHP-5.6'
* PHP-5.6:
  add OPSYS_Z_CPM missing constant
2014-03-07 14:10:31 +01:00
Dmitry Stogov ab3d1e0d03 Temporary fix memory leaks 2014-03-07 17:09:45 +04:00
Dmitry Stogov 97156bc141 Fixed string length 2014-03-07 17:06:13 +04:00
Dmitry Stogov e9855b1992 Fixed pass by reference special cases 2014-03-07 16:45:32 +04:00
Daniel Lowrey ddd855cbc2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Update php.ini files (new openssl directives)
2014-03-07 05:26:48 -07:00
Dmitry Stogov 6d67dd3103 Fixed refcounting 2014-03-07 15:58:09 +04:00
Tjerk Meesters 777831a24b Merge branch 'PHP-5.6' 2014-03-07 19:24:50 +08:00
Tjerk Meesters 7137775ec2 Merge branch 'PHP-5.6' 2014-03-07 19:01:53 +08:00
Xinchen Hui 5edbe296ef Fixed bug codes in stream_resolve_include_path.... 2014-03-07 18:01:22 +08:00
Xinchen Hui be6e417fdc Fixed memory leak (double array_init) 2014-03-07 17:48:54 +08:00
Xinchen Hui 3da247e7a8 Forgot to remove unused codes 2014-03-07 17:41:02 +08:00
Xinchen Hui 4b3e6fc129 Refactor reference handling 2014-03-07 17:08:14 +08:00
Xinchen Hui cc03c3faae Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-07 16:51:55 +08:00
Xinchen Hui c2933c234c Fixed invalid pointer usage (tests/output/ob_start_callbacks.phpt) 2014-03-07 16:49:01 +08:00
Dmitry Stogov 03c7ab5a95 Fixed return by reference 2014-03-07 12:25:55 +04:00
Dmitry Stogov 81531116c1 Fixed support for references 2014-03-07 11:32:07 +04:00
Xinchen Hui 7c623c0e89 Fixed asseration failed in ob_get_status 2014-03-07 15:12:52 +08:00
Bob Weinand 75435e30ae Merge branch 'PHP-5.6' 2014-03-07 07:41:16 +01:00
Xinchen Hui 7003e76512 Fixed numeric string handling length 2014-03-07 14:35:14 +08:00
Xinchen Hui ecc0687398 Fixed IS_REFERENCE handling in sort() 2014-03-07 13:51:39 +08:00
Xinchen Hui f3a6c30cca IS_REFERENCE is unfrequent 2014-03-07 13:51:04 +08:00
Nikita Popov 45ed85941e Merge branch 'PHP-5.6' 2014-03-06 23:39:21 +01:00
Nikita Popov 4c3454fbdc Merge branch 'PHP-5.6' 2014-03-06 23:15:37 +01:00
Dmitry Stogov 5343cd3216 Fixed guard support in magic method __set() 2014-03-07 02:03:25 +04:00
Nikita Popov 7220eddf9e Merge branch 'PHP-5.6' 2014-03-06 22:40:31 +01:00
Dmitry Stogov 85a5712955 Fixed __FILE__ and __METHOD__ constants 2014-03-07 01:34:03 +04:00
Dmitry Stogov 6b303a6bd6 Fixed refcounting 2014-03-07 01:33:33 +04:00
Dmitry Stogov 6fd8d0d8f6 Fixed test 2014-03-07 01:00:26 +04:00
Dmitry Stogov b146ed1607 Fixed dynamic properties cloning 2014-03-07 00:50:02 +04:00
Dmitry Stogov 70260d133e Fixed memory leak 2014-03-07 00:26:21 +04:00
Dmitry Stogov fff3c54f9e Added check 2014-03-06 22:07:28 +04:00
Xinchen Hui 10c7f2ddbc Fixed IS_REFERENCE handling in preg_match 2014-03-06 23:39:34 +08:00
Xinchen Hui 2d45dce4aa Second argument of call_user_method is ref 2014-03-06 23:32:47 +08:00
Xinchen Hui 00cf4e5a58 Have no idea why I changed it to 0 in 70ddc853 2014-03-06 23:28:31 +08:00
Xinchen Hui 95d31d773f Fixed refcounted on INTERNED string 2014-03-06 23:18:48 +08:00
Xinchen Hui e1a29600bc To be consistent with old PHP in is_callable(do we really need it?) 2014-03-06 23:16:06 +08:00
Dmitry Stogov 9ed631a4d0 Fixed ArrayAccess behavior 2014-03-06 17:59:17 +04:00
Dmitry Stogov 3e4c22b499 Fixed possible HashTable modification in its destructor 2014-03-06 16:53:13 +04:00
Dmitry Stogov dfe1fd73bf Fixed uninitialized value 2014-03-06 16:09:00 +04:00
Dmitry Stogov 60eac8b860 Fixed string offset handling 2014-03-06 16:00:38 +04:00
Xinchen Hui a1052c51f8 Fixed wrong fix for tmpbuf 2014-03-06 19:22:59 +08:00
Xinchen Hui 9e9737061e Fixed IS_REFERENCE handling 2014-03-06 19:07:59 +08:00
Xinchen Hui 3290476a9f Fixed wrong merges 2014-03-06 19:06:05 +08:00
Xinchen Hui 9eb9ba3aa8 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2
Conflicts:
	ext/standard/formatted_print.c
2014-03-06 19:03:22 +08:00
Xinchen Hui 11166882c0 Fixed memory leak in ext/standard/tests/strings/str_word_count.php 2014-03-06 19:00:51 +08:00
Xinchen Hui 9a81b6dea4 Fixed memory leak in ext/standard/tests/time/strptime_parts.php 2014-03-06 18:51:20 +08:00
Xinchen Hui bbacddaf90 Fixed memory leak in vfprintf 2014-03-06 18:47:43 +08:00
Dmitry Stogov 08aadb0638 Fixed memory leak 2014-03-06 14:42:16 +04:00
Xinchen Hui e4f5b9ac38 Fixed memory leak in getimagesize 2014-03-06 18:30:32 +08:00
Dmitry Stogov 0b6af57256 Fixed memory leaks 2014-03-06 14:29:36 +04:00
Xinchen Hui b212461297 IS_REFERENCE is unfrequent 2014-03-06 18:23:16 +08:00
Xinchen Hui 6ee7240119 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-06 18:07:42 +08:00
Xinchen Hui ddf3861923 Fixed memory leak in vsprintf 2014-03-06 18:06:41 +08:00
Remi Collet 4e87968821 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix order in NEWS
  Add CVE ref (not known at release time)
  Fix NEWS for 5.5.11 fix (really not in 5.5.10)
  5.5.10 release date for NEWS
2014-03-06 11:02:48 +01:00
Dmitry Stogov 076da5a372 Fixed IS_REFERENCE support 2014-03-06 13:59:15 +04:00
Xinchen Hui 66dead5239 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-06 17:39:00 +08:00
Xinchen Hui 089820e102 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-06 17:33:22 +08:00
Dmitry Stogov 8d2fb9d479 Internal functions may return (e.g. on wrong arguments) keeping the original return_value. So we have to initialize return_value as IS_NULL. 2014-03-06 13:32:43 +04:00
Dmitry Stogov 9ae9460bd0 Fixed refcounting 2014-03-06 13:32:26 +04:00
Remi Collet b4d65a0e94 Merge branch 'PHP-5.6'
* PHP-5.6:
  Set default Digest Message to use SHA1 instead of MD5 in openssl tests as MD5 signature are now rejected by newer openssl Version.
  Add NEWS/UPGRADING notes (openssl + curl)
2014-03-06 10:16:40 +01:00
Dmitry Stogov 9727b47418 Fixed ArrayAccess handling 2014-03-06 13:11:23 +04:00
Xinchen Hui bc18a22e44 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-06 16:44:11 +08:00
Dmitry Stogov 2eb980f614 IS_REFERENCE with refcount==1 should be handled as ordinal value 2014-03-06 12:37:46 +04:00
Xinchen Hui 86227d3403 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-06 14:17:49 +08:00
Dmitry Stogov f3b4b16883 Fixed passing reference by value in call_user_func() 2014-03-06 01:04:28 +04:00
Dmitry Stogov 9ebd9388ee Fixed Generator::throw() 2014-03-06 00:45:53 +04:00
Dmitry Stogov 018be97c0d Fixed support for undefined constants in RECV_INIT 2014-03-06 00:15:56 +04:00
Dmitry Stogov 712dd6c68e Fixed "foreach ($reference as $val)" 2014-03-05 23:22:50 +04:00
Daniel Lowrey 1f5459572e Merge branch 'PHP-5.6'
* PHP-5.6:
  Add encrypted server SNI support
  Raise timeout to 2s, reworded ssl timeout warning
  Refactor + reorganize openssl files
2014-03-05 10:23:54 -07:00
Andrey Hristov 1c1ee4672d Merge branch 'master' of git.php.net:php-src 2014-03-05 16:46:45 +02:00
Nikita Popov 94e308da7a Merge branch 'PHP-5.6' 2014-03-05 15:38:56 +01:00
Xinchen Hui 9a4e16db6f Fixed zend_is_true to support IS_REFERENCE 2014-03-05 22:31:02 +08:00
Andrey Hristov 529fdd5bb0 Merge branch 'PHP-5.6' 2014-03-05 16:24:43 +02:00
Xinchen Hui 84f20dc212 Invalid free of args("+") 2014-03-05 22:19:02 +08:00
Dmitry Stogov c5af715f2b Fixed hidden property handling 2014-03-05 17:57:21 +04:00
Dmitry Stogov 28aacbfe15 It's not possible to create reference to string-offset 2014-03-05 17:32:23 +04:00
Dmitry Stogov 47f9014458 Fixed array_nultisort() to support IS_REFERENCE 2014-03-05 17:23:40 +04:00
Dmitry Stogov 84c092f6d6 Fixed by reference parameter passing from internal functions 2014-03-05 16:17:00 +04:00
Dmitry Stogov da75df6faa Fixed string lengths 2014-03-05 16:04:28 +04:00
Dmitry Stogov 7320abbaa9 Reverted "efree(args);" removed by mistake 2014-03-05 15:49:24 +04:00
Dmitry Stogov 50d899dda3 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-05 15:34:50 +04:00
Dmitry Stogov b763baff97 Temporary fix for lazy symbol table initialization called from zemd_error(), that converts CV variables into IS_INDIRECT 2014-03-05 15:33:31 +04:00
Xinchen Hui ef01b7937e Fixed wrong hash value in ext/standard/tests/array/array_combine.php 2014-03-05 18:39:20 +08:00
Xinchen Hui 70b7887712 Fixed refcounted handling 2014-03-05 18:17:16 +08:00
Xinchen Hui 74c2deecd8 Fixed refcounted 2014-03-05 18:11:22 +08:00
Xinchen Hui 581fa5822e Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2
Conflicts:
	ext/standard/array.c
2014-03-05 18:02:35 +08:00
Xinchen Hui bfaa9669a6 Fixed refcounted 2014-03-05 18:00:46 +08:00
Dmitry Stogov 3733737328 Handle interned strings as non-refcounted scalars 2014-03-05 13:55:56 +04:00
Xinchen Hui 0791bdb562 retval might be IS_UNDEF even the call is successed 2014-03-05 17:53:01 +08:00
Remi Collet 1a94fca35e Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
2014-03-05 10:46:01 +01:00
Pierre Joye d1ac107077 Merge branch 'master' of git.php.net:php-src
# By krakjoe (558) and others
# Via Anatol Belski (126) and others
* 'master' of git.php.net:php-src: (1484 commits)
  NEWS
  NEWS
  Fixed Bug #66820 out-of-bounds memory access in fileinfo
  Improves fix for memory leak, keep in sync with upstream.
  Add notice about tsrm_virtual_cwd.h moved to zend_virtual_cwd.h as this introduce need for awfull hacks...
  Fixed NEWS for #60602
  Fixed news for #60602
  Updated news for #60602
  proc_open(): separate environment values that aren't strings
  Added DateTimeImmutable::createFromMutable.
  Sort alphabetically
  Fixed NEWS.
  Capture peer cert even if verify fails
  Windows cert verify improvements + leak fixes
  turn off some false positives
  support for static analyzers other than visual studio
  fix wording
  reveal more info on the configure options
  Updated news for #66535 and #66109
  Updated news for #66535 and #66109
  ...
2014-03-05 10:45:58 +01:00
Remi Collet 3686b6bd90 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  Fixed Bug #66815 imagecrop(): insufficient fix for NULL defer CVE-2013-7327
2014-03-05 10:44:12 +01:00
Xinchen Hui 75d567ef9a Fixed NULL pointer def in ext/standard/tests/array/array_fill_keys_variation2.php 2014-03-05 17:31:10 +08:00
Xinchen Hui 36f01f158c Fixed NULL pointer dereference 2014-03-05 17:29:29 +08:00
Xinchen Hui 2ee6bc1309 Remove "efree(args") 2014-03-05 17:07:09 +08:00
Xinchen Hui 57ae19a0b7 Checkout refcounted before doing addref 2014-03-05 17:02:50 +08:00
Xinchen Hui cb5e9eac9f Fixed memory leak (ext/standard/tests/file/stream_002.phpt) 2014-03-05 16:03:05 +08:00
Xinchen Hui dc889b69ef Fixed segfault (op2 maybe equal to result) 2014-03-05 15:43:57 +08:00
Dmitry Stogov dd7c7e6fb2 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2
Conflicts:
	ext/standard/formatted_print.c
2014-03-05 11:26:35 +04:00
Dmitry Stogov 040dea8b82 Arguments taken by internal functions using zend_parse_parameters() with "+" and "*" specifications must not be deallocated anymore. 2014-03-05 11:10:52 +04:00
Xinchen Hui 8218ab7724 Fixed memory leak 2014-03-05 14:43:20 +08:00
Xinchen Hui d6d28458d5 Fixed unlink file 2014-03-05 14:40:49 +08:00
Xinchen Hui f76a64fd3a Fixed variable name register 2014-03-05 14:20:47 +08:00
Xinchen Hui d5fa6b2467 Fixed name length in get_include_path 2014-03-05 12:16:57 +08:00
Xinchen Hui 37343cc17d Fixed var_export reference handling 2014-03-05 12:10:43 +08:00
Xinchen Hui 53a3210750 Fixed refcount showing 2014-03-05 12:06:56 +08:00
Xinchen Hui 91a1e7b90b Fixed warning mesgs 2014-03-05 12:05:28 +08:00
Xinchen Hui 63a1b34924 Fixed segfault 2014-03-05 11:44:51 +08:00
Xinchen Hui 1c42751316 Refactor stream_get_record to return zend_string 2014-03-05 11:41:21 +08:00
Xinchen Hui 2cdc90bd94 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-05 11:30:51 +08:00
Xinchen Hui 1a828f42ea Fixed stream_cast 2014-03-05 11:28:31 +08:00
Dmitry Stogov 19670c2bbc Fixied calling object closures from internal functions 2014-03-05 01:54:21 +04:00
Dmitry Stogov db7b5325f0 Fixed IS_REFERENCE separation 2014-03-05 00:28:01 +04:00
Dmitry Stogov 6b8c46dc76 Fixed passing by reference 2014-03-04 23:54:05 +04:00
Remi Collet eaaf3f0f57 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  Fixed Bug #66820 out-of-bounds memory access in fileinfo
2014-03-04 20:39:11 +01:00
Dmitry Stogov 58918431e9 Fixed test 2014-03-04 23:30:56 +04:00
Anatol Belski 902824b70e Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-03-04 20:23:15 +01:00
Anatol Belski 30cad90261 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  Improves fix for memory leak, keep in sync with upstream.
  Add notice about tsrm_virtual_cwd.h moved to zend_virtual_cwd.h as this introduce need for awfull hacks...
  Fixed NEWS for #60602
  Fixed news for #60602
  Updated news for #60602
  proc_open(): separate environment values that aren't strings
  Added DateTimeImmutable::createFromMutable.
  Sort alphabetically
  Fixed NEWS.
  Capture peer cert even if verify fails
  Windows cert verify improvements + leak fixes
  Updated news for #66535 and #66109
  Updated NEWS for #66535

Conflicts:
	ext/openssl/xp_ssl.c
2014-03-04 20:20:15 +01:00
Anatol Belski b186b2774a Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Improves fix for memory leak, keep in sync with upstream.
  Add notice about tsrm_virtual_cwd.h moved to zend_virtual_cwd.h as this introduce need for awfull hacks...
  Fixed NEWS for #60602
  Fixed news for #60602
  Updated news for #60602
  proc_open(): separate environment values that aren't strings
  Added DateTimeImmutable::createFromMutable.
  Sort alphabetically
  Fixed NEWS.
  Capture peer cert even if verify fails
  Windows cert verify improvements + leak fixes
  Updated news for #66535 and #66109
  Updated NEWS for #66535

Conflicts:
	ext/standard/proc_open.c
2014-03-04 19:50:25 +01:00
Dmitry Stogov 8b82b3e735 Fixed return of references by value 2014-03-04 17:38:19 +04:00
Dmitry Stogov 38151a38ec Fixed dereferencing of value returned from function (foo()[1] = ...) 2014-03-04 17:23:23 +04:00
Dmitry Stogov ba30f1e946 Fixed assign by reference 2014-03-04 17:04:46 +04:00
Remi Collet 93f4ca0ea9 Merge branch 'PHP-5.6'
* PHP-5.6:
  Improves fix for memory leak, keep in sync with upstream.
2014-03-04 13:46:33 +01:00
Dmitry Stogov dbb6837627 EG(error_zval) must be passed as IS_INDIRECT 2014-03-04 16:32:40 +04:00
Xinchen Hui 12478f7287 Fixed warning msg 2014-03-04 20:31:24 +08:00
Xinchen Hui f853449ce8 Fixed memory leak temporary 2014-03-04 20:29:48 +08:00
Xinchen Hui c1ec21e265 Fixed memory leak 2014-03-04 20:25:26 +08:00
Xinchen Hui 851ba9a198 Fixed warning mesg 2014-03-04 20:10:41 +08:00
Xinchen Hui 4358e4b7cd Fixed base64decode usage 2014-03-04 20:08:06 +08:00
Dmitry Stogov f88816acbb Fixed next index insetion through magic function ($obj[] = ...) 2014-03-04 16:07:42 +04:00
Dmitry Stogov 1de1fa2821 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-04 15:13:38 +04:00
Xinchen Hui bab58ab97e Fixed stream_select (incompeleted) 2014-03-04 19:12:43 +08:00
Xinchen Hui d28af8ef3d Fixed wrapper errors realted tests 2014-03-04 18:22:15 +08:00
Dmitry Stogov e0f6bae56b Passing symbol_table into user error handlers 2014-03-04 14:17:17 +04:00
Dmitry Stogov 7bc5d0b1f4 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-04 12:29:09 +04:00
Dmitry Stogov 1be0df935f Fixed destruction of VM handler operands (FREE_OP1 and family) 2014-03-04 12:27:50 +04:00
Xinchen Hui e3de898d98 Paramter are references 2014-03-03 23:14:57 +08:00
Xinchen Hui d821c90148 Return empty string 2014-03-03 23:09:31 +08:00
Xinchen Hui 1f228e46d0 Error message has been changed 2014-03-03 22:39:20 +08:00
Remi Collet 945d50c25c Merge branch 'PHP-5.6'
* PHP-5.6:
  Add notice about tsrm_virtual_cwd.h moved to zend_virtual_cwd.h as this introduce need for awfull hacks...
2014-03-03 15:34:02 +01:00
Dmitry Stogov 27d3b5b5b4 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-03 15:40:36 +04:00
Dmitry Stogov fe8c0b889f Fixed return_value destruction 2014-03-03 15:36:58 +04:00
Xinchen Hui eb7a9c7c47 Fixed wrong data type (all tests passed in ext/network now) 2014-03-03 18:27:45 +08:00
Xinchen Hui 4e9f2c7c00 Temorary fixed memleak 2014-03-03 18:24:06 +08:00
Xinchen Hui 6374fce5db Wrong type check 2014-03-03 18:23:12 +08:00
Xinchen Hui dae6e672c2 Fixed reference arguments handling 2014-03-03 18:20:53 +08:00
Xinchen Hui b4ccb6a9fd Refactor gethostbyname to returing zend_string 2014-03-03 18:19:16 +08:00
Xinchen Hui 93ea0dfe98 Fixed fsockopen's reference argument handling 2014-03-03 18:14:59 +08:00
Xinchen Hui ebfa9e0415 Fixed NULL pointer def 2014-03-03 18:12:13 +08:00
Xinchen Hui 1aecda4c43 Fixed php_mail log 2014-03-03 18:00:56 +08:00
Xinchen Hui ca146a6e14 Elements in array could be reference 2014-03-03 17:44:21 +08:00
Xinchen Hui 5de87fe680 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-03 17:34:01 +08:00
Xinchen Hui 70ddc853fd Refactor php_escape_shell_* to return zend_string 2014-03-03 17:33:40 +08:00
Dmitry Stogov e73c32c229 Fixed macros 2014-03-03 13:09:56 +04:00
Xinchen Hui d50782286f Fixed get_cfg_var 2014-03-03 17:09:06 +08:00
Xinchen Hui dc96140721 Fixed typo in get_extension_funcs 2014-03-03 17:06:04 +08:00
Xinchen Hui 7735226e36 Fixed memory leak in php_uname 2014-03-03 16:56:54 +08:00
Xinchen Hui ec30d8178d Fixed proc_open's reference argument 2014-03-03 16:50:35 +08:00
Xinchen Hui 3e93cd9fd7 Fixed serval segfaults 2014-03-03 16:46:18 +08:00
Xinchen Hui 07eb0f4970 Fixed NULL pointer def 2014-03-03 16:42:34 +08:00
Xinchen Hui be4878edd0 Use stack memory here to avoid mem leak 2014-03-03 16:39:29 +08:00
Xinchen Hui b07d5913dd Refactor php_url_(en|de)code to return zend_string 2014-03-03 16:34:43 +08:00
Xinchen Hui 8ca824d673 Fixed memory leak 2014-03-03 16:13:03 +08:00
Xinchen Hui e1d1be148e Fixed NULL pointer dereference 2014-03-03 16:10:15 +08:00
Tjerk Meesters 8a825de5b0 Merge branch 'PHP-5.6' 2014-03-03 06:00:01 +08:00
Derick Rethans 18178aa013 Merge branch 'PHP-5.6' 2014-03-02 14:18:58 -05:00
Daniel Lowrey 41bde3f0a7 Merge branch 'PHP-5.6'
* PHP-5.6:
  Capture peer cert even if verify fails
  Windows cert verify improvements + leak fixes
2014-03-02 10:39:03 -07:00
Xinchen Hui 0fe209e317 Refactor _php_stream_scandir to avoid memleak 2014-03-02 22:47:59 +08:00
Xinchen Hui ce03111e50 Fixed segfault in closedir 2014-03-02 22:35:24 +08:00
Xinchen Hui 38b72bd783 Fixed bug55871.phpt in another way, test script should be changed? 2014-03-02 22:28:36 +08:00
Xinchen Hui 0f117ef4d9 Fixed php_implode with reference 2014-03-02 22:14:25 +08:00
Xinchen Hui 92eda10261 Fixed str_replace count handling 2014-03-02 22:07:32 +08:00
Xinchen Hui 6ed82f7104 Use zend_string to avoid memleak 2014-03-02 22:00:30 +08:00
Anatol Belski b1dbe97bb6 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-03-02 14:59:21 +01:00
Anatol Belski 4358b8e447 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  turn off some false positives
  fixes signed/unsigned in ext/pgsql
  more signature fixes
  fixed signatures php_uint_t vs php_size_t for len
  removed senseless unsigned < 0 check
  more zpp fixes
  fix reading unsigned from zpp
  support for static analyzers other than visual studio
  fix wording
  reveal more info on the configure options
  fixes unsigned < 0 comparsion
  Updated news for #66535 and #66109
2014-03-02 14:59:07 +01:00
Xinchen Hui 8cb468d5e3 Fixed wrong condition (introduced by previous ci) 2014-03-02 21:48:38 +08:00
Xinchen Hui 18363f42b2 Fixed invalid free 2014-03-02 21:44:17 +08:00
Xinchen Hui 35742a74e2 Fixed zend_string 2014-03-02 21:42:21 +08:00
Xinchen Hui 4eeee08ec8 Fixed getClosureThis() 2014-03-02 21:40:20 +08:00
Xinchen Hui 81271854e8 Fixed test 2014-03-02 21:38:00 +08:00
Xinchen Hui 30c20084d7 Fixed memory leak 2014-03-02 21:36:51 +08:00
Xinchen Hui 069c158c20 Fixed php_info related 2014-03-02 21:31:38 +08:00
Anatol Belski 816e21982e Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  turn off some false positives
2014-03-02 13:14:04 +01:00
Anatol Belski ec7935f7b5 Merge branch 'PHP-5.6'
* PHP-5.6:
  turn off some false positives
2014-03-02 12:49:58 +01:00
Anatol Belski 43d15abf72 fixes signed/unsigned in ext/pgsql 2014-03-02 11:55:32 +01:00
Anatol Belski 17a7912eff more signature fixes 2014-03-02 11:37:01 +01:00
Anatol Belski e7a92a913f fixed signatures php_uint_t vs php_size_t for len 2014-03-02 11:30:22 +01:00
Anatol Belski e993862fb5 removed senseless unsigned < 0 check 2014-03-02 11:29:37 +01:00
Anatol Belski 549b251691 more zpp fixes 2014-03-02 11:10:27 +01:00
Anatol Belski 16e4b43f8c fix reading unsigned from zpp 2014-03-02 11:05:11 +01:00
Xinchen Hui 26e993a7ae Fixed zend_string 2014-03-02 16:07:44 +08:00
Xinchen Hui 5a9e8a5e26 Not reference anymore 2014-03-02 15:47:08 +08:00
Xinchen Hui 8d2c1f58a1 Fixed refcounting 2014-03-02 15:15:51 +08:00
Xinchen Hui ff5870a288 Fixed reflection (incompeleted) 2014-03-02 15:14:00 +08:00
Xinchen Hui 05e8f28533 This should be a real problem 2014-03-02 14:35:41 +08:00
Anatol Belski 7b5c1cd562 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  support for static analyzers other than visual studio
2014-03-01 20:22:03 +01:00
Anatol Belski c0b5c290bb Merge branch 'PHP-5.6'
* PHP-5.6:
  support for static analyzers other than visual studio
2014-03-01 20:18:44 +01:00
Anatol Belski 586f3a87f0 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix wording
  reveal more info on the configure options
  Updated news for #66535 and #66109
2014-03-01 15:12:22 +01:00
Anatol Belski 4b50f20504 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix wording
  Updated news for #66535 and #66109
2014-03-01 13:28:24 +01:00
Anatol Belski 91d61a2096 Merge branch 'PHP-5.6'
* PHP-5.6:
  reveal more info on the configure options
2014-03-01 13:12:08 +01:00
Anatol Belski a54d442de1 fixes unsigned < 0 comparsion 2014-03-01 11:30:49 +01:00
Xinchen Hui 171fde5491 Fixed SplPriorityQueue's free_obj 2014-03-01 12:44:33 +08:00
Anatol Belski ef7c911c9e Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-02-28 21:10:16 +01:00
Anatol Belski 9c1dd320d6 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport: (33 commits)
  remove temp test files
  fix typo replacement
  don't compare constants on run time
  fix macros
  more descriptor fixes
  substr_compare(): Allow zero length comparison
  Fixed test case title
  [bug 66535] X-PHP-Originating-Script adds newline if no custom headers are given
  Fixed expected output of a few cURL test cases
  Allow NULL as value for CURLOPT_CUSTOMREQUEST option.
  primitive test fixes
  man page: long option name is --strip, not --stripped
  --global have be removed in 5.2
  remove pcntl leftover from the test code
  list the fpm change hat rfc in UPGRADING
  mention the apparmor support in fpm
  typo spotted by Lajos Veres
  update libs_version.txt
  update libs_version.txt
  NEWS
  ...

Conflicts:
	ext/openssl/openssl.c
2014-02-28 21:09:55 +01:00
Anatol Belski e6ccba4b14 remove temp test files 2014-02-28 21:06:00 +01:00
Dmitry Stogov 46ab80b48e Temporary fix for reference counting 2014-02-28 23:42:32 +04:00
Dmitry Stogov 29d61b6527 Fixed refcounting 2014-02-28 23:25:06 +04:00
Anatol Belski 3eeda5e804 fix typo replacement 2014-02-28 20:15:37 +01:00
Dmitry Stogov 843423716b Fixed user stream filters 2014-02-28 23:05:22 +04:00
Anatol Belski 3b37fe3bde Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  don't compare constants on run time
2014-02-28 19:42:31 +01:00
Anatol Belski 3f779b9bd2 Merge branch 'PHP-5.6'
* PHP-5.6:
  don't compare constants on run time
2014-02-28 19:39:50 +01:00
Anatol Belski 65f17d672d fix macros 2014-02-28 19:19:32 +01:00
Anatol Belski 28dbadeb1d Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (28 commits)
  substr_compare(): Allow zero length comparison
  Fixed test case title
  [bug 66535] X-PHP-Originating-Script adds newline if no custom headers are given
  Fixed expected output of a few cURL test cases
  Allow NULL as value for CURLOPT_CUSTOMREQUEST option.
  primitive test fixes
  man page: long option name is --strip, not --stripped
  --global have be removed in 5.2
  remove pcntl leftover from the test code
  list the fpm change hat rfc in UPGRADING
  mention the apparmor support in fpm
  typo spotted by Lajos Veres
  update libs_version.txt
  update libs_version.txt
  NEWS
  NEWS
  NEWS
  test for bug #66762
  Fixed Bug #66762 Segfault in mysqli_stmt::bind_result() when link closed
  fix tests broken by 633f898f15
  ...

Conflicts:
	ext/curl/interface.c
	ext/standard/mail.c
	ext/standard/string.c
2014-02-28 19:18:18 +01:00
Anatol Belski 2d83dca7be more descriptor fixes 2014-02-28 18:49:02 +01:00
Xinchen Hui dd3a7e97e0 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-01 00:46:11 +08:00
Xinchen Hui 7235048ca1 Fixing spl_autoload functional (one test failed due to get_closure) 2014-03-01 00:44:02 +08:00
Tjerk Meesters 0d26d655b7 Merge branch 'PHP-5.6'
* PHP-5.6:
  substr_compare(): Allow zero length comparison
2014-02-28 23:50:27 +08:00
Xinchen Hui 7208b9660c Fixed autoload_func_info using zval instead of zval * 2014-02-28 23:05:13 +08:00
Xinchen Hui 237dbd972e Fixed uninilized intern 2014-02-28 22:55:59 +08:00
Xinchen Hui 4340f1a561 Fixed offset_key 2014-02-28 22:52:18 +08:00
Xinchen Hui 0680cdb4ac Fixed refcount handling 2014-02-28 22:47:24 +08:00
Tjerk Meesters d4d726bb6b Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed test case title
  [bug 66535] X-PHP-Originating-Script adds newline if no custom headers are given
2014-02-28 22:33:08 +08:00
Xinchen Hui 2a82660923 Temporary fix zcontext 2014-02-28 22:21:51 +08:00
Dmitry Stogov 4865ec6ff0 Fixed ini_get_all() 2014-02-28 17:47:00 +04:00
Dmitry Stogov 53128644f3 Redesigned SRR_OFFSET handling 2014-02-28 17:39:08 +04:00
Dmitry Stogov e26722c2fa Fixed access to undefined properties 2014-02-28 16:56:52 +04:00
Dmitry Stogov cb7797a43c Fixed NULL pointer dereferencing 2014-02-28 16:16:15 +04:00
Dmitry Stogov 08d9a4ffa2 Fixed closures in static methods 2014-02-28 16:06:38 +04:00
Dmitry Stogov a18a95f70a Fixed support for references 2014-02-28 15:58:11 +04:00
Dmitry Stogov 2bf3018169 Fixed array_push() 2014-02-28 15:48:39 +04:00
Dmitry Stogov feeca5aba6 Fixed uninitialized zval 2014-02-28 15:47:37 +04:00
Dmitry Stogov d0311ad28e Fixed method argument parsing 2014-02-28 15:47:12 +04:00
Tjerk Meesters 060643f5ba Merge branch '5.6'
* 5.6:
  Fixed expected output of a few cURL test cases
  Allow NULL as value for CURLOPT_CUSTOMREQUEST option.
2014-02-28 19:14:18 +08:00
Xinchen Hui 670ef9decd Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-02-28 19:08:08 +08:00
Xinchen Hui 990c923ef4 Refactored spl_filesystem_iterator 2014-02-28 19:07:54 +08:00
Dmitry Stogov 04d04d01c8 Fixed memory leak 2014-02-28 14:24:35 +04:00
Dmitry Stogov a72a1b1391 Fixed memory leak 2014-02-28 13:43:52 +04:00
Dmitry Stogov 045c5fddfa Fixed memory leaks 2014-02-28 13:37:55 +04:00
Dmitry Stogov 9d1294e33d Fixed memory leak 2014-02-28 13:29:18 +04:00
Dmitry Stogov 339d82c72d Fixed __COMPILER_HALT_OFFSET handling 2014-02-28 13:15:40 +04:00
Xinchen Hui 7dcb14ebcd We need to stash the object_ptr in fci 2014-02-28 17:12:53 +08:00
Dmitry Stogov 663990284b Fixed get_defined_functions() 2014-02-28 13:10:07 +04:00
Dmitry Stogov 17a009ddce Fixed isset($str[$double]) 2014-02-28 13:04:46 +04:00
Dmitry Stogov 3ed445f749 Fixed IS_REFERENCE support 2014-02-28 12:54:38 +04:00
Anatol Belski bad0b4fc8c Merge branch 'PHP-5.6'
* PHP-5.6:
  primitive test fixes
2014-02-28 09:45:02 +01:00
Dmitry Stogov cee824bbef Fixed SEPARATE_ZVAL_IF_REF() 2014-02-28 12:21:12 +04:00
Xinchen Hui b353d5abe9 Fixed un-initilized iterator in DirectoyItrator 2014-02-28 16:06:47 +08:00
Xinchen Hui 0def388427 Fixed Z_ADDREF 2014-02-28 15:29:00 +08:00
Xinchen Hui 142dd01006 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-02-28 15:25:18 +08:00
Dmitry Stogov 5b5367ddbb Fixed SEPARATE_ZVAL() to support objects and resources 2014-02-28 11:21:15 +04:00
Remi Collet 0821d3942e Merge branch 'PHP-5.6'
* PHP-5.6:
  man page: long option name is --strip, not --stripped
  --global have be removed in 5.2
2014-02-28 08:12:38 +01:00
Xinchen Hui 1265850fef Add zend_iterator_dtor 2014-02-28 15:03:43 +08:00
Dmitry Stogov 54095e8c56 Converting from reference to regular value 2014-02-28 11:03:05 +04:00
Dmitry Stogov 855a030b7b Fixed return value handling in ZEND_ASSIGN_OBJ 2014-02-28 10:41:28 +04: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 3231174749 Fixed typo in previous commit 2014-02-28 13:15:51 +08:00
Xinchen Hui fb825a95d0 Fixed module name printing 2014-02-28 13:02:28 +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 4318e57604 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-02-28 11:44:39 +08:00
Dmitry Stogov 08da14adac Fixed support for IS_REFERENCE 2014-02-28 00:21:12 +04:00
Dmitry Stogov 6f578b57bc Fixed FETCH_OBJ_UNSET, FETCH_DIM_UNSET 2014-02-28 00:09:43 +04:00
Rouven Weßling 09f69ca02d Fix a compiler warning in php_rand.h 2014-02-27 20:57:31 +01:00
Dmitry Stogov cb181c512a I don't know how to fix it 2014-02-27 23:51:00 +04:00
Dmitry Stogov 3960b0acc4 Temporarry commented 2014-02-27 23:50:43 +04:00
Dmitry Stogov 10fd93343e Fixed reference counting 2014-02-27 23:25:41 +04:00
Dmitry Stogov e43d0d1717 fixed refcounting in "$a->magic_prop += 2" 2014-02-27 23:18:37 +04:00
Dmitry Stogov 5e4a97f365 Fixed ASSIGN_OBJ with IS_TMP and IS_CONST operand 2014-02-27 22:53:56 +04:00
Dmitry Stogov 3f4759515c Fixed memory leak 2014-02-27 22:21:02 +04:00
Dmitry Stogov 0e44e0611d Fixed ASSIGN of IS_REFERENCE (it should be separated) 2014-02-27 22:16:15 +04:00
Anatol Belski 79063d16b9 Merge branch 'PHP-5.6'
* PHP-5.6:
  remove pcntl leftover from the test code
2014-02-27 15:51:28 +01:00
Xinchen Hui cfa93d08f5 Unused element 2014-02-27 22:50:31 +08:00
Xinchen Hui 0817cee164 Fixed object creating (std_init calls store_put now) 2014-02-27 22:47:30 +08:00
Dmitry Stogov c5a508582f Fixed refcounting 2014-02-27 18:10:42 +04:00
Dmitry Stogov 9d6cce629a Fixed __get() related memleak 2014-02-27 16:58:18 +04:00
Dmitry Stogov 3810b4ab4a Fixed constant expressions in array indeces handling 2014-02-27 16:41:41 +04:00
Dmitry Stogov 3696e038e5 Various fixes related to read_property(), read_dimension() and iterators refactoring 2014-02-27 16:07:36 +04:00
Ferenc Kovacs e77131f5d1 Merge branch 'PHP-5.6'
* PHP-5.6:
  list the fpm change hat rfc in UPGRADING
2014-02-27 12:54:53 +01:00
Ferenc Kovacs 4d8c167ccd Merge branch 'PHP-5.6'
* PHP-5.6:
  mention the apparmor support in fpm
2014-02-27 12:43:58 +01:00
Dmitry Stogov 4ba590697e Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-02-27 15:40:51 +04:00
Dmitry Stogov 1c3ba95bb5 Refactored read_property() and read_dimension() handlers 2014-02-27 15:40:13 +04:00
Xinchen Hui 382b0dfdb7 Refactoring zend_iterator (incompleted) 2014-02-27 19:19:02 +08:00
Ferenc Kovacs 1bb0500a91 Merge branch 'PHP-5.6'
* PHP-5.6:
  typo spotted by Lajos Veres
2014-02-27 11:31:04 +01:00
Dmitry Stogov ee3254a2e8 Temporary refcounting fix 2014-02-27 13:06:11 +04:00
Xinchen Hui 122cc5f495 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-02-27 16:56:17 +08:00
Dmitry Stogov 1493b30501 Temporarry refcounting fix 2014-02-27 12:53:40 +04:00
Dmitry Stogov 054917619a Fixed empty() 2014-02-27 12:48:53 +04:00
Dmitry Stogov 0548ac59a5 Resource closing without destruction 2014-02-27 12:28:55 +04:00
Anatol Belski 70b2d1d59a Merge branch 'PHP-5.6'
* PHP-5.6:
  update libs_version.txt
  update libs_version.txt
2014-02-27 09:27:06 +01:00
Remi Collet a5f5855db9 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  test for bug #66762
  Fixed Bug #66762 Segfault in mysqli_stmt::bind_result() when link closed
2014-02-27 08:50:41 +01:00
Ferenc Kovacs 6dd8a4d4f0 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix tests broken by 633f898f15
2014-02-27 02:33:20 +01:00
Ferenc Kovacs 1b60d39e5e Merge branch 'PHP-5.6'
* PHP-5.6:
  add missing NEWS entry
  add missing NEWS entry
  add missing NEWS entry
  add missing NEWS entry
  add missing NEWS entry
  add missing NEWS entry
2014-02-27 01:29:21 +01:00
Daniel Lowrey 1d2181b615 Merge branch 'PHP-5.6'
* PHP-5.6:
  Remove cURL close policy related constants
2014-02-26 13:41:04 -07:00
Daniel Lowrey ed00de58bf Merge branch 'PHP-5.6'
* PHP-5.6:
  Deprecate CN_match in favor of peer_name in SSL contexts
2014-02-26 13:24:07 -07:00
Anatol Belski f34e4283ce Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-02-26 20:11:51 +01:00
Anatol Belski 9b4dc3a5a1 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  Update stack size in tests/func/010.phpt
  Don't add num_additional_args in SEND opcodes
  Disallow use of positional args after unpacking
  Store arg_num in fcall entry
  Introduce zend_function_call_entry structure
2014-02-26 20:11:31 +01:00
Anatol Belski 8647f4e7f5 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Update stack size in tests/func/010.phpt
  Don't add num_additional_args in SEND opcodes
  Disallow use of positional args after unpacking
  Store arg_num in fcall entry
  Introduce zend_function_call_entry structure

Conflicts:
	Zend/zend_compile.c
	Zend/zend_language_parser.y
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2014-02-26 19:17:23 +01:00
Anatol Belski 758f73630a Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport: (23 commits)
  after merge fix
  move the default encoding NEWS entry to alpha3, as it was pushed after beta2 was tagged
  rearrange the NEWS blocks a bit
  add NEWS block for 5.6.0 beta1
  restored that test part in ext/openssl to enable notify/wait
  remove echo
  fix stdin reading in new openssl tests
  kick redundant include
  Prevent implicit function declaration when TLSEXT unavailable
  Update NEWS+UPGRADING (openssl)
  Remove test case invalidated by openssl.cafile accessibility change
  Tolerate non-standard newlines when parsing stream CA files
  Remove openssl tests that shouldn't have survived last merge
  Add openssl.cafile ini check when loading cainfo
  Change openssl directives to PHP_INI_PERDIR
  Update openssl tests with new server/client test harness
  Add peer certificate verification on windows
  add news entry
  add news entry
  add clear_env option to FPM config
  ...
2014-02-26 17:16:20 +01:00
Anatol Belski d753db3a81 after merge fix 2014-02-26 17:01:24 +01:00
Anatol Belski bd9a370701 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (22 commits)
  move the default encoding NEWS entry to alpha3, as it was pushed after beta2 was tagged
  rearrange the NEWS blocks a bit
  add NEWS block for 5.6.0 beta1
  restored that test part in ext/openssl to enable notify/wait
  remove echo
  fix stdin reading in new openssl tests
  kick redundant include
  Prevent implicit function declaration when TLSEXT unavailable
  Update NEWS+UPGRADING (openssl)
  Remove test case invalidated by openssl.cafile accessibility change
  Tolerate non-standard newlines when parsing stream CA files
  Remove openssl tests that shouldn't have survived last merge
  Add openssl.cafile ini check when loading cainfo
  Change openssl directives to PHP_INI_PERDIR
  Update openssl tests with new server/client test harness
  Add peer certificate verification on windows
  add news entry
  add news entry
  add clear_env option to FPM config
  add clear_env option to FPM config
  ...

Conflicts:
	ext/openssl/openssl.c
2014-02-26 16:47:49 +01:00
Nikita Popov bfd967c11f Merge branch 'PHP-5.6' 2014-02-26 16:42:55 +01:00
Ferenc Kovacs 45ec37fb89 Merge branch 'PHP-5.6'
* PHP-5.6:
  move the default encoding NEWS entry to alpha3, as it was pushed after beta2 was tagged
  rearrange the NEWS blocks a bit
2014-02-26 15:41:46 +01:00
Ferenc Kovacs 25941c293f Merge branch 'PHP-5.6'
* PHP-5.6:
  add NEWS block for 5.6.0 beta1
  add news entry
  add news entry
  add clear_env option to FPM config
  add clear_env option to FPM config
  Reduce test noise on cross Oracle client <-> server version tests. This fix is already in PHP 5.6+
  Reduce test noise in cross Oracle client <-> server version testing. This change is already in PHP 5.6+
2014-02-26 15:14:50 +01:00
Dmitry Stogov 60eadc80b8 Fixed return anf yield by reference 2014-02-26 18:07:16 +04:00
Dmitry Stogov e49c0804da Temporary memory leak fix (should be done in a better way) 2014-02-26 17:36:39 +04:00
Anatol Belski e15fdcb09c Merge branch 'PHP-5.6'
* PHP-5.6:
  restored that test part in ext/openssl to enable notify/wait
2014-02-26 13:38:04 +01:00
Dmitry Stogov 39c466147a Fixed user iterator creation 2014-02-26 16:28:04 +04:00
Dmitry Stogov 0bde8c9857 Fixed argument unpacking 2014-02-26 16:17:28 +04:00
Anatol Belski 38f349da1f Merge branch 'PHP-5.6'
* PHP-5.6:
  remove echo
2014-02-26 12:41:57 +01:00
Dmitry Stogov 6829be6c26 ifixed foreach() by reference 2014-02-26 15:38:58 +04:00
Dmitry Stogov ff1778a89f Temorary fix for implicit IS_CV conversion into IS_INDIRECTR 2014-02-26 15:17:08 +04: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
Anatol Belski 83b2593b23 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix stdin reading in new openssl tests
2014-02-26 11:27:48 +01:00
Anatol Belski 8ece03a679 Merge branch 'PHP-5.6'
* PHP-5.6:
  kick redundant include
2014-02-26 11:24:22 +01:00
Dmitry Stogov a4a86df3c0 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-02-26 13:59:20 +04:00
Dmitry Stogov d062fb3344 Generator related fixes 2014-02-26 13:58:59 +04:00
Xinchen Hui 95320f1f46 Fixed memory leak 2014-02-26 16:33:27 +08:00
Xinchen Hui 4b6eb998da Fixed error msg 2014-02-26 16:24:44 +08:00
Xinchen Hui a0ab299f7f Fixed memory leak 2014-02-26 16:22:03 +08:00
Xinchen Hui 24540362b0 Re-fixed unserialize 2014-02-26 15:51:53 +08:00
Xinchen Hui b7052ef16d Revert "Fixed unserialize implementation (it's complicated, this issue took me 4 hours :<, need some review)"
This reverts commit 80a178015d.
2014-02-26 13:33:55 +08:00
Xinchen Hui 66b7f6722d Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-02-26 12:52:43 +08:00
Xinchen Hui 80a178015d Fixed unserialize implementation (it's complicated, this issue took me 4 hours :<, need some review) 2014-02-26 12:51:23 +08:00
Xinchen Hui 0c0e9c3cd7 Fixed class name usage 2014-02-26 11:26:08 +08:00
Xinchen Hui c146752812 Fixed reference handling in zif_unserialize 2014-02-26 11:21:52 +08:00
Xinchen Hui f4a70fa759 Fixed has_propery 2014-02-26 11:18:19 +08:00
Xinchen Hui 7f527d8047 Fixed reference handling in serialize/unserialize 2014-02-26 11:08:13 +08:00
Daniel Lowrey b3b709f1fc Merge branch 'PHP-5.6'
* PHP-5.6:
  Prevent implicit function declaration when TLSEXT unavailable
2014-02-25 19:12:49 -07:00
Dmitry Stogov 4a1ecf0e8b Reflection related fixes 2014-02-26 02:02:57 +04:00
Dmitry Stogov bb27b4ac95 Fixed refcounting 2014-02-26 01:09:58 +04:00
Dmitry Stogov 78fc6b3570 Fixed refcounting 2014-02-26 01:09:34 +04:00
Dmitry Stogov 9c317c57bc Fixed user streams handling 2014-02-26 01:00:39 +04:00
Daniel Lowrey 33914b5166 Merge branch 'PHP-5.6'
* PHP-5.6:
  Remove test case invalidated by openssl.cafile accessibility change
  Tolerate non-standard newlines when parsing stream CA files
  Remove openssl tests that shouldn't have survived last merge
  Add openssl.cafile ini check when loading cainfo
  Change openssl directives to PHP_INI_PERDIR
  Update openssl tests with new server/client test harness
  Add peer certificate verification on windows
2014-02-25 13:27:10 -07:00
Dmitry Stogov e4b5848859 Fixed handling of "static" variables 2014-02-25 23:56:09 +04:00
Dmitry Stogov 329a576f39 Fixed EG(error_zval) handling 2014-02-25 23:39:25 +04:00
Dmitry Stogov f0e9a108a7 Fixed support for references 2014-02-25 23:26:04 +04:00
Anatol Belski 4d1ab57e4f Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  add clear_env option to FPM config
2014-02-25 20:20:55 +01:00
Anatol Belski 148058cc46 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fixed typo
  Use API instead of directly acessing the structure
  zpp readme adjustment

Conflicts:
	README.PARAMETER_PARSING_API
2014-02-25 20:20:44 +01:00
Anatol Belski 05db0cbcc0 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Use API instead of directly acessing the structure

Conflicts:
	ext/mysqli/mysqli_prop.c
2014-02-25 20:19:04 +01:00
Dmitry Stogov 1ac966d524 Fixed memory leaks 2014-02-25 23:12:25 +04:00
Anatol Belski 1ccc6d0a73 fixed typo 2014-02-25 17:28:12 +01:00
Andrey Hristov ee2d5776fa Merge branch 'PHP-5.6' 2014-02-25 17:40:59 +02:00
Dmitry Stogov 4fd84823f6 Fixed foreach() over object properties 2014-02-25 17:56:03 +04:00
Dmitry Stogov fdd1f74e37 Fixed debug backtrace 2014-02-25 17:11:55 +04:00
Dmitry Stogov c077742b2a Fixed reflection object destruction 2014-02-25 17:03:48 +04:00
Dmitry Stogov 068ea84a84 THIS MAY BE A REAL PROBLEM 2014-02-25 16:38:18 +04:00
Dmitry Stogov fe5c1cc48f Fixed crach because of dereferencing of NULL pointer 2014-02-25 16:25:45 +04:00
Dmitry Stogov 77abd35b78 Fixed memory leak 2014-02-25 16:20:42 +04:00
Dmitry Stogov 639e4e1afa Changes zend_is_callable() to use zend_string* instead of char* 2014-02-25 16:03:34 +04:00
Dmitry Stogov b965647e44 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2
Conflicts:
	Zend/zend_object_handlers.c
2014-02-25 15:23:06 +04:00
Xinchen Hui 40a9132de8 zend_hash_add might return NULL in ext/standard/tests/serialize/serialization_objects_011.php 2014-02-25 18:29:20 +08:00
Xinchen Hui 346d52c2c4 Fixed asseration fail 2014-02-25 18:22:54 +08:00
Xinchen Hui f298ade89a Fixed wrong hash_zval_identical_function 2014-02-25 18:20:35 +08:00
Xinchen Hui 499b553c18 Fixed NULL pointer dereference 2014-02-25 18:14:22 +08:00
Anatol Belski b643fcddd1 zpp readme adjustment 2014-02-25 11:05:35 +01:00
Xinchen Hui 595741f6ec Fixed test fail in ext/standard/tests/serialize/bug64354_1.php 2014-02-25 17:58:01 +08:00
Dmitry Stogov cabfbf7128 Fixed IS_REFERENCE handling 2014-02-25 13:47:33 +04:00
Anatol Belski feedfe178c corrections to the zpp readme 2014-02-25 10:39:38 +01:00
Dmitry Stogov 6b8253af27 Fixed user error handler invocation (temporary disabled symbol table passing) 2014-02-25 13:35:39 +04:00
Dmitry Stogov 820184dd00 Fixed converting IS_REFERENCE to string 2014-02-25 13:21:03 +04:00
Dmitry Stogov 4e63cf9b16 Fixed POST_INC/POST_DEC 2014-02-25 13:20:43 +04:00
Dmitry Stogov 6ee86d0c29 Fixed dynamic properies table construction 2014-02-25 13:02:34 +04:00
Xinchen Hui dc2d758c93 Fixed segfaults 2014-02-25 16:54:26 +08:00
Xinchen Hui 71dac3d54f Don't add_ref in add_*_str functions 2014-02-25 15:47:24 +08:00
Xinchen Hui bfcb3defdd Fixed memory leak in ext/standard/tests/strings/quotemeta_basic.php 2014-02-25 13:08:16 +08:00
Xinchen Hui f482092cab Fixed momory leak in heberv 2014-02-25 13:04:00 +08:00
Xinchen Hui 2ed1f00869 Refactor php_crypt to returning zend_string 2014-02-25 12:46:51 +08:00
Xinchen Hui 9e4da2d0ec Fixed segfault in ext/standard/tests/strings/money_format_variation1.phpt 2014-02-25 12:36:33 +08:00
Xinchen Hui d35a068aa6 Fixed array comparation 2014-02-25 12:31:35 +08:00
Xinchen Hui 1dc69e86f9 Fixed memory leak in setlocale 2014-02-25 12:30:50 +08:00
Xinchen Hui e0a32353af Fixed NULL pointer dereference in ext/standard/tests/strings/setlocale_basic2.php 2014-02-25 12:09:39 +08:00
Dmitry Stogov ff162410f0 Fixed traits support 2014-02-25 01:18:06 +04:00
Dmitry Stogov fea971e1e4 Better IS_REFERENCE handling 2014-02-25 00:17:13 +04:00
Andrew Kehrig 85c06f17f3 Fix #50444: PDO-ODBC changes for 64-bit
This bug is also referenced in
[#61777](https://bugs.php.net/bug.php?id=61777) and is still present in
the latest stable release of the 5.5 branch. I see two tickets exist for
this problem already, and I'm just submitting these changes via github
as a reminder that this is a serious problem for anyone using PDO_ODBC
on the x64 builds.
2014-02-24 13:48:39 -05:00
Dmitry Stogov e9cde67d47 Fixed double free 2014-02-24 18:00:24 +04:00
Dmitry Stogov 0907f22bbd Fixed debug_backtrace 2014-02-24 17:29:45 +04:00
Dmitry Stogov 760fe72af6 Fixed comparison od references 2014-02-24 17:29:28 +04:00
Dmitry Stogov 55bca5868a Fixed $this handling 2014-02-24 17:07:44 +04:00
Dmitry Stogov a3448b7cfa Support for IS_REFERENCE 2014-02-24 16:51:38 +04:00
Dmitry Stogov 789eb6dfc3 Fixed create_function() 2014-02-24 16:35:55 +04:00
Dmitry Stogov 595fc4d901 More constant related fixes 2014-02-24 15:49:15 +04:00
Dmitry Stogov abb57cc1c2 Merge branch 'refactoring2' of github.com:zend-dev/php into refactoring2 2014-02-24 15:25:43 +04:00
Dmitry Stogov f4c2810ab4 fixed support for constant expressions 2014-02-24 15:25:24 +04:00
Xinchen Hui 93428dc6b9 Refactor base64 to returning zend_string 2014-02-24 18:48:22 +08:00
Xinchen Hui 1e5a4f281d Refactor php_uu(en/de)code to returning zend_string 2014-02-24 18:32:09 +08:00
Anatol Belski 56d4d97393 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fixed macro
  add clear_env option to FPM config
  Make sure value is initialized
  We can't dereference dbh if it is NULL
2014-02-24 11:30:26 +01:00
Xinchen Hui 5fccb0724b Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-02-24 18:18:39 +08:00
Xinchen Hui 57a3feb422 Fixed memory leak in strrev 2014-02-24 18:15:40 +08:00
Xinchen Hui 5adeaa147d Refactoring php_stream_copy_to_mem to return zend_string 2014-02-24 18:12:30 +08:00
Dmitry Stogov 73b8e9aef4 Fixed wrong condition 2014-02-24 14:06:39 +04:00
Dmitry Stogov 454e9911ad Fixed new dynamic propery creation 2014-02-24 14:00:52 +04:00
Dmitry Stogov 1770ace249 Fixed object to string conversion 2014-02-24 13:49:53 +04:00
Xinchen Hui 9e9f6c7123 Fixed memory leak in str_pad 2014-02-24 17:44:42 +08:00
Xinchen Hui b529155635 Fixed memory leak in nlbr 2014-02-24 17:40:18 +08:00
Xinchen Hui a9529b8ad3 Refactor chunk_split returning zend_string to avoid memleak 2014-02-24 17:35:47 +08:00
Dmitry Stogov 62e7ac77e5 Fixed arg_info[].class_name destruction 2014-02-24 13:33:30 +04:00
Xinchen Hui e687939f01 Fixed wrong array to string convertion 2014-02-24 17:30:39 +08:00
Xinchen Hui 479b82c0d4 Fixed invalid write in vsprintf tests 2014-02-24 17:26:09 +08:00
Dmitry Stogov fd87bde4d6 Fixed error messages 2014-02-24 13:19:32 +04:00
Dmitry Stogov b6c5e55b5a Merge branch 'refactoring2' of github.com:zend-dev/php into refactoring2 2014-02-24 13:19:22 +04:00
Anatol Belski 94cfa3a120 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fixed macro
  add clear_env option to FPM config
  Make sure value is initialized
  We can't dereference dbh if it is NULL
2014-02-24 10:16:31 +01:00
Anatol Belski 5c3b9db84c Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed macro
  add clear_env option to FPM config
2014-02-24 10:14:09 +01:00
Dmitry Stogov 844887ed56 Fixed IS_RESOURCE handling 2014-02-24 13:12:53 +04:00
Xinchen Hui 0b37b90ec4 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-02-24 16:37:43 +08:00
Xinchen Hui 1bb59c73c4 Fixed NULL pointer dereference in ext/standard/tests/strings/strtr_variation* 2014-02-24 16:36:48 +08:00
Dmitry Stogov 448e28cc84 Merge branch 'refactoring2' of github.com:zend-dev/php into refactoring2 2014-02-24 12:30:21 +04:00
Dmitry Stogov 074391de88 ZEND_CATCH support for IS_INDIRECT 2014-02-24 12:29:35 +04:00
Xinchen Hui 4fb57d7f4f Fixed wrong size of key length 2014-02-24 16:24:08 +08:00
Xinchen Hui 22e42c25ab Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-02-24 16:15:43 +08:00
Dmitry Stogov f1dcbf4750 ASSIGN_REF related fixes 2014-02-24 12:15:11 +04:00
Xinchen Hui 6c3c1f0949 Fixed memory leak in ext/standard/tests/strings/bug24098.phpt 2014-02-24 16:14:46 +08:00
Xinchen Hui 4dac68221f Fixed NULL pointer dereference in php_url_encode_hash_ex 2014-02-24 16:07:02 +08:00
Xinchen Hui 94e30a8197 Fixed memory leak in substr_replace 2014-02-24 15:58:38 +08:00
Antony Dovgal 29a4407914 Merge branch 'pull-request/598'
* pull-request/598:
  add clear_env option to FPM config
2014-02-24 11:52:56 +04:00
Paul Annesley a16304f836 add clear_env option to FPM config
This makes it possible to leave the envoronment as is on startup and
pass all the variables to the workers.
The default value of clear_env is "yes", preserving previous behaviour.
Patch by Paul Annesley.
2014-02-24 11:47:44 +04:00
Dmitry Stogov 23c9d3eb01 Fixed zend_rebuild_symbol_table() using IS_INDIRECT 2014-02-24 11:31:46 +04:00
Dmitry Stogov e43f57e215 Fixed ++/-- of references 2014-02-24 11:23:25 +04:00
Xinchen Hui 948a00ff59 Now we always ZVAL_DUP args[argnum] now (in ed8691b2) 2014-02-24 15:13:06 +08:00
Xinchen Hui 737a84ed04 Revert "Fixed segfault in ext/standard/tests/strings/bug24208.php"
This reverts commit b1fb93b482.
2014-02-24 15:04:05 +08:00
Xinchen Hui 6f6573ef6a Fixed several memory leaks 2014-02-24 15:03:35 +08:00
Xinchen Hui 077b02326a Refactor php_addslashes using zend_string 2014-02-24 12:07:09 +08:00
Xinchen Hui ed8691b24b Fixed segfault in ext/standard/tests/strings/fprintf_variation_001.php 2014-02-23 22:33:10 +08:00
Johannes Schlüter a61d7e6278 Merge branch 'PHP-5.6' 2014-02-23 15:00:06 +01:00
Xinchen Hui 69a93d2fd7 Fixed segfault in ext/standard/tests/strings/bug49785.phpt 2014-02-23 21:53:48 +08:00
Xinchen Hui 70baf8f419 Fixed the memroy leak first (refactor it later) 2014-02-23 21:43:59 +08:00
Xinchen Hui 91e2a91396 Missing handling of IS_REF in ext/standard/tests/strings/bug47842.php 2014-02-23 19:36:38 +08:00
Xinchen Hui b287591a87 Refactor php_str_to_str returning zend_string 2014-02-23 19:25:26 +08:00
Xinchen Hui bd3bd63571 Fixed wrong zend_string usage in ext/standard/tests/strings/bug47443.php 2014-02-23 19:04:40 +08:00
Xinchen Hui 6a856d4aa9 Fixed inproper IS_REF handling in ext/standard/tests/strings/bug27295.phpt 2014-02-23 18:48:15 +08:00
Xinchen Hui f21eb59cda Fixed memory leak ext/standard/tests/strings/bug21453.phpt 2014-02-23 18:28:00 +08:00
Xinchen Hui 915a8a2d42 Fixed test ext/standard/tests/strings/bug26817.php 2014-02-23 18:22:53 +08:00
Xinchen Hui 5db2503fc0 Fixed memory leak in ext/standard/tests/strings/bug20927.phpt 2014-02-23 18:17:39 +08:00
Xinchen Hui c0aba2c641 Refactor basename using zend_string 2014-02-23 18:08:35 +08:00
Xinchen Hui 0e4cfad1e8 Refactor php_addcslashes using zend_string 2014-02-22 20:51:26 +08:00
Xinchen Hui 257853cade Fixed memory leak in ext/standard/tests/strings/005.php 2014-02-22 20:36:12 +08:00
Xinchen Hui b1fb93b482 Fixed segfault in ext/standard/tests/strings/bug24208.php
it still ugly,, maybe we should make EG(active_symbol_table) a zend_array?
2014-02-22 20:19:12 +08:00
Xinchen Hui 3cf418c50a No refcounted type 2014-02-22 20:05:04 +08:00
Anatol Belski eb48e0181e Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Fix build against older OpenSSL libs

Conflicts:
	UPGRADING
2014-02-21 23:24:51 +01:00
Anatol Belski 592a73fbca Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fix linkage
  More openssl UPGRADING updates
  Fix build against older OpenSSL libs
  Update NEWS/UPGRADING with openssl additions
  fix macro names

Conflicts:
	NEWS
	UPGRADING
2014-02-21 23:22:02 +01:00
Anatol Belski 734d1b8e6f Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  fix linkage
2014-02-21 23:17:41 +01:00
Anatol Belski 38d02db86d Merge branch 'PHP-5.6'
* PHP-5.6:
  fix linkage
  More openssl UPGRADING updates
  Fix build against older OpenSSL libs
  Update NEWS/UPGRADING with openssl additions
2014-02-21 23:14:48 +01:00
Anatol Belski 90d31780c9 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  More openssl UPGRADING updates
  Fix build against older OpenSSL libs
  Update NEWS/UPGRADING with openssl additions
2014-02-21 21:55:21 +01:00
Dmitry Stogov 2711e368b8 Fixed error messages 2014-02-22 00:41:06 +04:00
Dmitry Stogov bc3fb147cf Fixed char/zend_string mesh 2014-02-22 00:31:39 +04:00
Dmitry Stogov efae48d996 Fixed constant name construction 2014-02-22 00:20:57 +04:00
Dmitry Stogov 598a51844c Fixed improper deallocation 2014-02-22 00:20:36 +04:00
Daniel Lowrey a27db7d2da Fix build against older OpenSSL libs 2014-02-21 13:01:04 -07:00
Dmitry Stogov d149228b69 Use better data structures (incomplete) 2014-02-21 23:51:08 +04:00
Dmitry Stogov 6454684212 Use better data structures (incomplete) 2014-02-21 22:59:51 +04:00
Anatol Belski a4de08ea89 fix macro names 2014-02-21 18:21:05 +01:00
Dmitry Stogov 008a42e7c8 Fixed error messages 2014-02-21 20:53:09 +04:00
Anatol Belski ff5f498f58 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Mitigate client-initiated SSL renegotiation DoS
2014-02-21 17:52:53 +01:00
Anatol Belski 76e711fe59 after merge fix 2014-02-21 17:49:21 +01:00
Anatol Belski 264c68aed7 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Mitigate client-initiated SSL renegotiation DoS

Conflicts:
	ext/openssl/xp_ssl.c
2014-02-21 17:46:15 +01:00
Anatol Belski 14af491490 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  after merge fix
  C89 compat
  Added information about interned strings usage
  Updated opcache version
  Added function opcache_is_script_cached(). (Danack)
  Improve OpenSSL compile flag compatibility, minor updates
  Use crypto method flags; add tlsv1.0 wrapper; add wrapper tests
  Improve server forward secrecy, refactor client SNI
  Add 'honor_cipher_order' server context option
  Add 'capture_session_meta' context option
  Disable TLS compression by default in both clients and servers
  Release ssl buffers
  Add openssl_get_cert_locations() function
  Explicitly set cert verify depth if not specified
  Strengthen default cipher list

Conflicts:
	ext/openssl/xp_ssl.c
2014-02-21 17:45:04 +01:00
Dmitry Stogov c8663929a2 Fixed error messages 2014-02-21 20:44:26 +04:00
Dmitry Stogov 52bd62eca8 Fixed assertions 2014-02-21 20:35:40 +04:00
Daniel Lowrey 1268bd6045 Merge branch 'PHP-5.6'
* PHP-5.6:
  Mitigate client-initiated SSL renegotiation DoS
2014-02-21 09:15:53 -07:00
Anatol Belski bb9b9d7d29 after merge fix 2014-02-21 17:09:29 +01:00
Dmitry Stogov 2520f0801d Fix Z_COUNTED() -> Z_REFCOUNTED() 2014-02-21 19:19:52 +04:00
Dmitry Stogov 3496950e54 Fixed get_object_vars() 2014-02-21 19:19:44 +04:00
Dmitry Stogov 6d5ce339e6 Merge branch 'refactoring2' of github.com:zend-dev/php into refactoring2 2014-02-21 19:05:15 +04:00
Xinchen Hui 47fb198533 Revert "Use zend_string for arg_info to fixed segfault in Zend/tests/argument_restriction_003.phpt"
This reverts commit b96318105b.
2014-02-21 23:02:24 +08:00
Dmitry Stogov a4f2c6ea15 Merge branch 'refactoring2' of github.com:zend-dev/php into refactoring2 2014-02-21 18:55:26 +04:00
Dmitry Stogov 686ea7f20e Fixed compound name resolution 2014-02-21 18:55:04 +04:00
Xinchen Hui 013cc55395 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2
Conflicts:
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner.l
2014-02-21 22:41:48 +08:00
Xinchen Hui 76c28f878a Fixed missed REFCOUNTED checking 2014-02-21 22:39:27 +08:00
Xinchen Hui b96318105b Use zend_string for arg_info to fixed segfault in Zend/tests/argument_restriction_003.phpt 2014-02-21 22:34:30 +08:00
Dmitry Stogov 2549010278 Fixed error messages 2014-02-21 18:23:56 +04:00
Dmitry Stogov 5fa6dbba8e Fixed class_alias() 2014-02-21 18:19:46 +04:00
Dmitry Stogov b2e7b89041 Fix non-zero terminated strings 2014-02-21 18:14:47 +04:00
Dmitry Stogov ca729cb4e3 Fixed __METHOD__ handling 2014-02-21 17:52:43 +04:00
Xinchen Hui 92450f9d6c Fixed test tests/classes/__call_007.php 2014-02-21 21:47:41 +08:00
Dmitry Stogov d0eccdeea1 Fixed array_unshift() 2014-02-21 17:38:12 +04:00
Dmitry Stogov 0907a1b3f8 Fixed error messages 2014-02-21 17:35:19 +04:00
Dmitry Stogov 0fc85fbdff Fixed error messages 2014-02-21 17:27:53 +04:00
Dmitry Stogov 7113ae0b24 Fixed include_once() handling 2014-02-21 17:23:13 +04:00
Dmitry Stogov 7e03f3712b All zend_parse_parameters("Z") has to be replaced with zend_parse_parameters("z") 2014-02-21 17:22:02 +04:00
Xinchen Hui 882b0a3c24 Fixed segfault due to invalid write 2014-02-21 21:20:50 +08:00
Xinchen Hui 2b7ca1c756 Fixed segfault due to missing REFCOUNTED check 2014-02-21 21:12:12 +08:00
Xinchen Hui f4f7a80a2c Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-02-21 21:02:12 +08:00
Anatol Belski 93e8fb39df Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  C89 compat
  Added information about interned strings usage
  Updated opcache version
  Added function opcache_is_script_cached(). (Danack)

Conflicts:
	ext/openssl/xp_ssl.c
2014-02-21 13:56:14 +01:00
Anatol Belski befb267ddf Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6:
  Improve OpenSSL compile flag compatibility, minor updates
  Use crypto method flags; add tlsv1.0 wrapper; add wrapper tests
  Improve server forward secrecy, refactor client SNI
  Add 'honor_cipher_order' server context option
  Add 'capture_session_meta' context option
  Disable TLS compression by default in both clients and servers
  Release ssl buffers
  Add openssl_get_cert_locations() function
  Explicitly set cert verify depth if not specified
  Strengthen default cipher list

Conflicts:
	ext/openssl/openssl.c
	ext/openssl/xp_ssl.c
	ext/standard/file.c
2014-02-21 13:37:35 +01:00
Dmitry Stogov 6fbea9ce6a Fixed exception constructor 2014-02-21 16:14:42 +04:00
Dmitry Stogov 51d7c4828a Fixed tests/run-test/test009.phpt 2014-02-21 15:48:56 +04:00
Dmitry Stogov bdeaf2ef55 Wrong string destruction 2014-02-21 15:26:41 +04:00
Anatol Belski 04a10be9db Merge branch 'PHP-5.6'
* PHP-5.6:
  C89 compat
2014-02-21 11:24:18 +01:00
Xinchen Hui e193944b3e Fixed segfault in ext/standard/tests/strings/addslashes_variation1.php 2014-02-21 16:56:23 +08:00
Dmitry Stogov b0927faf48 Merge branch 'PHP-5.6'
* PHP-5.6:
  Added information about interned strings usage
2014-02-21 12:45:12 +04:00
Xinchen Hui 8211026fa7 Fixed segfault in ext/standard/tests/strings/add-and-stripslashes.phpt 2014-02-21 16:39:59 +08:00
Xinchen Hui 29e2ce597b Fixed segfault in file_get_contents 2014-02-21 16:32:46 +08:00
Dmitry Stogov f786eec680 Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated opcache version
2014-02-21 12:06:46 +04:00
Dmitry Stogov c3b35e2519 Merge branch 'PHP-5.6'
* PHP-5.6:
  Added function opcache_is_script_cached(). (Danack)
2014-02-21 12:01:06 +04:00
Daniel Lowrey 86d9235de5 Merge branch 'PHP-5.6'
* PHP-5.6:
  Improve OpenSSL compile flag compatibility, minor updates
  Use crypto method flags; add tlsv1.0 wrapper; add wrapper tests
  Improve server forward secrecy, refactor client SNI
  Add 'honor_cipher_order' server context option
  Add 'capture_session_meta' context option
  Disable TLS compression by default in both clients and servers
  Release ssl buffers
  Add openssl_get_cert_locations() function
  Explicitly set cert verify depth if not specified
  Strengthen default cipher list
2014-02-20 17:46:54 -07:00
Anatol Belski f629a3b84d Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
2014-02-21 00:32:03 +01:00
Anatol Belski d6591ba1e3 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport:
  fixed path separator in the tests
  Add more tests for __debugInfo() and fix leak
  updated libmagic.patch for 5.6+
  updated libmagic.patch in 5.4/5
  fixed leak introduced after CVE/upgrade
  Use nicer output for characters < 32 and > 126 in exception strings Using question marks might confuse more than it helps. Users are wondering what happened to their string...
  Update pgsql document
  Fixes #66714: imageconvolution breakage in 5.5.9

Conflicts:
	UPGRADING
2014-02-21 00:31:32 +01:00
Anatol Belski 175ab77029 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport 2014-02-21 00:25:08 +01:00
Anatol Belski 0140e83048 Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed path separator in the tests
2014-02-21 00:23:36 +01:00
Anatol Belski eca2c0462f Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport 2014-02-20 23:12:57 +01:00
Sara Golemon d301c35540 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add more tests for __debugInfo() and fix leak
2014-02-20 12:10:40 -08:00
Anatol Belski a30ef13ad8 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport 2014-02-20 20:34:12 +01:00
Anatol Belski 7fab1a5790 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libmagic.patch for 5.6+
2014-02-20 19:06:32 +01:00
Anatol Belski 2b767f83dc Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libmagic.patch in 5.4/5
2014-02-20 19:01:45 +01:00
Anatol Belski 34f39f26e1 Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed leak introduced after CVE/upgrade
2014-02-20 18:55:21 +01:00
Bob Weinand 219a37106f Merge branch 'PHP-5.6' 2014-02-20 17:50:14 +01:00
Xinchen Hui 15e9bfa048 Update .gdbinit 2014-02-20 18:30:06 +08:00
Xinchen Hui cc15eb500e Fixed segfault in Zend/tests/008.phpt 2014-02-20 16:21:41 +08:00
Xinchen Hui b917458490 Fixed segfault (Zend/tests/026.phpt now pass) 2014-02-20 15:39:46 +08:00
Xinchen Hui 6557bc48e2 Merge branch 'PHP-5.6' 2014-02-20 11:20:01 +08:00
Anatol Belski ee690ae2a6 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64 2014-02-20 02:12:33 +01:00
Anatol Belski c869a60c91 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-20 02:12:18 +01:00
Anatol Belski 465fe9f0de Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport 2014-02-20 02:09:35 +01:00
Anatol Belski d021f575f6 Merge branch 'PHP-5.6'
* PHP-5.6:
  some missing pieces for __debugInfo
2014-02-20 02:08:07 +01:00
Anatol Belski ef295ab8e8 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
Conflicts:
	NEWS
2014-02-20 00:00:33 +01:00
Dmitry Stogov ff61b46941 Use better data structures (incomplete) 2014-02-19 16:50:09 +04:00
Anatol Belski cd064187da Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
Conflicts:
	ext/fileinfo/libmagic.patch
	ext/fileinfo/libmagic/readcdf.c
	ext/openssl/openssl.c
2014-02-19 12:42:20 +01:00
Dmitry Stogov b3aea904e0 Merge branch 'refactoring2' of github.com:zend-dev/php into refactoring2 2014-02-19 15:34:46 +04:00
Dmitry Stogov a22d27a756 Use better data structures (incomplete) 2014-02-19 15:34:32 +04:00
Xinchen Hui 3e89e92f57 Fixed possible NULL pointer dereference 2014-02-19 19:33:10 +08:00
Xinchen Hui a52659bc25 zend_hash_del didn't check the PACKED flag 2014-02-19 19:27:42 +08:00
Daniel Lowrey af318419ad Merge branch 'PHP-5.6'
* PHP-5.6:
  Add tests for Bug #65538
  Fix Bug #65538 (cafile now supports stream wrappers)
2014-02-19 04:19:30 -07:00
Daniel Lowrey 4c1baa8263 Merge branch 'PHP-5.6'
* PHP-5.6:
  Skip failing tests when EC unavailable (RHEL)
2014-02-19 04:03:16 -07:00
Xinchen Hui 388e60a2d5 Fixed segfault in 017.phpt(a memory leak is reported now) 2014-02-19 19:03:03 +08:00
Xinchen Hui 189a39a187 Fixed segfault 2014-02-19 18:49:00 +08:00
Xinchen Hui a28ce57bc5 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-02-19 18:42:22 +08:00
Xinchen Hui 75f583de91 Fixed memory leak (forgot to release the zval) 2014-02-19 18:41:50 +08:00
Dmitry Stogov 9187abfaef Merge branch 'refactoring2' of github.com:zend-dev/php into refactoring2 2014-02-19 14:36:05 +04:00
Dmitry Stogov 8bae1daa0c Use better data structures (incomplete) 2014-02-19 14:35:28 +04:00
Xinchen Hui 757facf6c1 Fixed segfault in BEGIN/END SILENT 2014-02-19 18:34:27 +08:00
Anatol Belski 97c8a4da98 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
2014-02-19 11:29:15 +01:00
Anatol Belski 46cdc50e61 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libmagic.patch
2014-02-19 11:20:53 +01:00
Anatol Belski 5f526e4907 Merge branch 'PHP-5.6'
* PHP-5.6:
  remove PHP_API_VERSION < 20100412 check
2014-02-19 11:02:19 +01:00
Xinchen Hui c1c4d26817 Use better data structures (incomplete) 2014-02-19 17:58:39 +08:00
Anatol Belski f4d61099fb Merge branch 'PHP-5.6'
* PHP-5.6:
  expose correct libmagic version
2014-02-19 10:49:15 +01:00
Anatol Belski 61677fa12d Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed tests in ext/fileinfo
2014-02-19 10:05:01 +01:00
Anatol Belski 9a250f6dc6 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated to libmagic-5.17
2014-02-19 10:03:19 +01:00
Dmitry Stogov 9067dbcd0d Use better data structures (incomplete) 2014-02-19 12:03:01 +04:00
Xinchen Hui 6a3a33405b Use zend_string avoid mem wasting 2014-02-19 12:13:43 +08:00
Dmitry Stogov 557994d50d Use better data structures (incomplete) 2014-02-19 01:12:05 +04:00
Dmitry Stogov 110e01a21e Fixed object destruction 2014-02-18 22:35:54 +04:00
Anatol Belski 3580f401ca Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libmagic.patch
2014-02-18 19:09:20 +01:00
Stanislav Malyshev 87cb5858e7 Merge branch 'PHP-5.6'
* PHP-5.6:
  update news with CVE
  5.5.11-dev next
  5.5.11 next for NEWS
2014-02-18 08:49:15 -08:00
Dmitry Stogov bb58ea348c Use better data structures (incomplete) 2014-02-18 18:10:54 +04:00
Dmitry Stogov 9e6c0c6a89 Use better data structures (incomplete) 2014-02-18 17:31:27 +04:00
Dmitry Stogov 246d50fd95 Fixed memory leak 2014-02-18 17:11:57 +04:00
Remi Collet e32b54578a Merge branch 'PHP-5.6'
* PHP-5.6:
  Set fileinfo version to 1.0.5 (as in php 5.4, no diff)
  NEWS
  NEWS
  Fixed Bug #66731 file: infinite recursion
2014-02-18 13:58:48 +01:00
Dmitry Stogov 7428cac6e8 Use better data structures (incomplete) 2014-02-18 16:44:01 +04:00
Dmitry Stogov 9ddf3c5780 Merge branch 'refactoring2' of github.com:zend-dev/php into refactoring2 2014-02-18 16:28:26 +04:00
Dmitry Stogov 5de7115679 Use better data structures (incomplete; able to run bench.php) 2014-02-18 16:27:38 +04:00
Anatol Belski a3dd7ab593 Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64 2014-02-18 10:56:30 +01:00
Xinchen Hui 43b03c74b3 Refacting smart_str 2014-02-18 17:42:46 +08:00
Dmitry Stogov 1c4f3d39a8 Use better data structures (incomplete) 2014-02-18 11:44:58 +04:00
Stanislav Malyshev 8862a4d98d Merge branch 'PHP-5.6'
* PHP-5.6:
  5.4.27 now
  update NEWS
2014-02-17 21:22:56 -08:00
Sara Golemon 837af67271 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add __debugInfo() magic method
2014-02-17 19:37:55 -08:00
Daniel Lowrey 491d492ada Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed broken build when EC unavailable
2014-02-17 19:39:43 -05:00
Dmitry Stogov a0fe8e5a91 Use better data structures (incomplete) 2014-02-18 01:41:23 +04:00
Dmitry Stogov 4d6ff31cb3 emalloced interned strings have to be deallocated before memory manager shutdown 2014-02-17 22:30:35 +04:00
Dmitry Stogov fc5e9bee29 It should be fixed later in some better way (added ??? marks) 2014-02-17 22:17:16 +04:00
Andrey Hristov f3e59b838e Merge branch 'PHP-5.6' 2014-02-17 19:04:14 +02:00
Andrey Hristov f83e88e3ea Merge branch 'PHP-5.6' 2014-02-17 18:37:59 +02:00
Xinchen Hui e7d173fc82 Fixed Memory leak 2014-02-17 23:01:25 +08:00
Xinchen Hui 6d77ca06b9 Fixed Segfault 2014-02-17 22:47:52 +08:00
Dmitry Stogov 2b9b9afa7a Use better data structures (incomplete) 2014-02-17 17:59:18 +04:00
Anatol Belski cbaea7d214 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/json/php_json.h
	ext/pgsql/pgsql.c
	ext/pgsql/php_pgsql.h
2014-02-17 12:27:33 +01:00
Anatol Belski 4dd4f728ce Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
Conflicts:
	ext/json/php_json.h
2014-02-17 12:17:04 +01:00
Julien Pauli 90325ba7ef Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated NEWS for #65753
  Export JsonSerializable Interface (bug #65753)
2014-02-17 11:16:48 +01:00
Julien Pauli 1ba76df8d0 Export JsonSerializable Interface (bug #65753) 2014-02-17 10:39:39 +01:00
Anatol Belski 3d1d48a85f Merge branch 'PHP-5.6'
* PHP-5.6:
  simplify the metadata part
2014-02-17 10:21:59 +01:00
Anatol Belski 463b450595 after merge fix 2014-02-17 09:21:27 +01:00
Anatol Belski f6c611fd84 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
Conflicts:
	ext/pgsql/pgsql.c
	ext/pgsql/php_pgsql.h
2014-02-17 09:16:13 +01:00
Dmitry Stogov 5066169070 Merge branch 'refactoring2' of github.com:zend-dev/php into refactoring2 2014-02-17 11:50:44 +04:00
Dmitry Stogov 0e425121b3 Use better data structures (incomplete) 2014-02-17 11:50:32 +04:00
Xinchen Hui 50927142f3 Use better data structures (incomplete) 2014-02-17 15:41:02 +08:00
Xinchen Hui 028bdea3db Use better data structures (incomplete) 2014-02-17 15:17:53 +08:00
Scott MacVicar 24092b7196 Merge branch 'PHP-5.6'
* PHP-5.6:
  imagettftext() uses the last charactermap it found and not the one you want
  [libxml] Unit test for libxml_disable_entity_loader()
  Add pgsql related change information to NEWS and UPGRADING
2014-02-16 22:51:20 -08:00
Xinchen Hui ab2a73a662 Use better data structures (incomplete) 2014-02-17 11:05:48 +08:00
Yasuo Ohgaki d06551b957 Merge branch 'PHP-5.6'
* PHP-5.6:
  Imprement FR #25854	Return value for pg_insert should be resource instead of bool
2014-02-17 06:38:36 +09:00
Yasuo Ohgaki 540a28b4ec Merge branch 'PHP-5.6'
* PHP-5.6:
  Implement FR #41146 - Add "description" with exteneded flag pg_meta_data(). pg_meta_data(resource $conn, string $table [, bool extended]) It also made pg_meta_data() return "is enum" always.
2014-02-17 06:35:15 +09:00
Yasuo Ohgaki 862e4bdf52 Implement FR #41146 - Add "description" with exteneded flag pg_meta_data().
pg_meta_data(resource $conn, string $table [, bool extended])
It also made pg_meta_data() return "is enum" always.
2014-02-17 06:23:52 +09:00
Anatol Belski 558795d02b fix always_populate_raw_data config 2014-02-16 19:29:07 +01:00
Anatol Belski d69911515a Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport 2014-02-16 17:17:19 +01:00
Anatol Belski 107df3d32b Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-16 17:16:55 +01:00
Anatol Belski a2928ea32c Merge branch 'PHP-5.6'
* PHP-5.6:
  updated pgsql/config.w32
2014-02-16 17:15:40 +01: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
Anatol Belski 01cf1aabe2 remove cast 2014-02-16 15:08:12 +01:00
Anatol Belski 88ba1e9eb5 remove some obsolete casts 2014-02-16 15:07:32 +01:00
Anatol Belski d8c35fd578 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/pgsql/pgsql.c
	ext/pgsql/tests/config.inc
2014-02-16 15:06:44 +01:00
Anatol Belski c801f53102 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
Conflicts:
	ext/pgsql/pgsql.c
	ext/pgsql/tests/config.inc
2014-02-16 14:50:47 +01:00
Yasuo Ohgaki 24a2c76f86 Merge branch 'PHP-5.6'
* PHP-5.6:
  Travis has old PostgreSQL server. Avoid test error.
2014-02-16 18:09:23 +09:00
Yasuo Ohgaki eed796f175 Merge branch 'PHP-5.6'
* PHP-5.6:
  It seems travis needs ending >?
2014-02-16 16:41:24 +09:00
Yasuo Ohgaki 390b5200c6 Merge branch 'PHP-5.6'
* PHP-5.6:
  EXPERIMENTAL flags for pg_select/pg_insert/pg_update/pg_delete are removed.
2014-02-16 14:13:17 +09:00
Yasuo Ohgaki 44cb669ca7 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Remove XFAIL from a test
  Declare a number of functions as variadic.
2014-02-16 10:52:54 +09:00
Yasuo Ohgaki bf18d4c16e Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed possbile injections against pg_insert()/pg_delete()/pg_update()/pg_select()
2014-02-16 10:47:58 +09:00
Anatol Belski 5847fc8b20 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/pgsql/pgsql.c
2014-02-16 01:12:00 +01:00
Anatol Belski 729079fc66 Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
Conflicts:
	ext/mysqli/mysqli_api.c
	ext/pgsql/pgsql.c
2014-02-16 01:06:20 +01:00
Nikita Popov 1aa6f95651 Merge branch 'PHP-5.6' 2014-02-16 00:08:17 +01:00
Yasuo Ohgaki e5b2e4c4d3 Merge branch 'PHP-5.6'
* PHP-5.6:
  Refactor build_tablename()
2014-02-16 07:52:12 +09:00
Anatol Belski fdc8dbe9d9 remaining backports for ext/* 2014-02-15 23:48:05 +01:00
Anatol Belski c9e2bfc424 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqli/mysqli_api.c
	ext/pgsql/pgsql.c
2014-02-15 23:12:40 +01:00
Yasuo Ohgaki d10e83cf89 Merge branch 'PHP-5.6'
* PHP-5.6:
  Revise encoding blacklist
2014-02-16 06:25:27 +09:00
Anatol Belski 98f03086bb further ext backports 2014-02-15 21:48:15 +01:00
Anatol Belski f2f78bc053 fix wrong backport 2014-02-15 21:41:28 +01:00
Anatol Belski a005010ef6 backported remaining part in main/streams 2014-02-15 21:01:06 +01:00
Anatol Belski 4fc459e424 backported ticks function signature 2014-02-15 20:51:14 +01:00
Anatol Belski 23679f5a01 backport ext/spl 2014-02-15 20:38:36 +01:00
Anatol Belski beb11f69f3 backported sapi/cli 2014-02-15 20:25:37 +01:00
Anatol Belski 1648d83e6d backport ext/date 2014-02-15 20:25:16 +01:00
Anatol Belski f6b64e93dd backported ext/standard 2014-02-15 20:16:05 +01:00
Johannes Schlüter bc4e9d36a6 Merge branch 'PHP-5.6' 2014-02-15 20:06:15 +01:00
Xinchen Hui 34aefa5604 Use better data structures (incomplete) 2014-02-15 23:21:09 +08:00
Anatol Belski b64462fd71 remove comment 2014-02-15 15:19:49 +01:00
Anatol Belski abca09bf6b remove test files 2014-02-15 14:43:53 +01:00
Anatol Belski 533dab176c simple overwrites 2014-02-15 14:41:52 +01:00
Anatol Belski f90db6feda fix sprintf declaration for broken sprintf 2014-02-15 14:40:11 +01:00
Anatol Belski 9a7f242f86 backported main/ 2014-02-15 14:33:11 +01:00
Felipe Pena 70317ca754 Merge branch 'PHP-5.6'
* PHP-5.6:
  - Fix ZTS build when HAVE_PQESCAPELITERAL is not set
  Update NEWS
  Update NEWS
2014-02-15 11:05:39 -02:00
Anatol Belski 2fd7f7c825 backported Zend 2014-02-15 14:04:53 +01:00
Yasuo Ohgaki c1211e84fc Merge branch 'PHP-5.6' 2014-02-15 18:30:50 +09:00
Daniel Lowrey 1b4af87af4 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix for bug66501 - "key type not supported in this PHP build"
2014-02-14 18:24:04 -07:00
Anatol Belski f2e817ea64 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-15 01:32:33 +01:00
Daniel Lowrey 89292d95ad Add missing TSRMLS_CC 2014-02-14 17:27:29 -07:00
Daniel Lowrey 8562b8c163 Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug #47030 (separate host and peer verification)
2014-02-14 15:40:36 -07:00
Daniel Lowrey a5551b73db Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix test broken if openssl is compiled without sslv2
2014-02-14 13:39:53 -07:00
Daniel Lowrey d47f2116a0 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix segfault accessing context when no context assigned

Conflicts:
	ext/openssl/xp_ssl.c
2014-02-14 10:53:47 -07:00
Daniel Lowrey 4921c1f0ce Fix segfault accessing context when no context assigned
Conflicts:
	ext/openssl/xp_ssl.c
2014-02-14 10:33:43 -07:00
Daniel Lowrey 059c0a9eb9 Merge branch 'master' of git://git.php.net/php-src
* 'master' of git://git.php.net/php-src: (33 commits)
  a few typofixes
  a few typofixes
  a few typofixes
  Update NEWS and UPGRADING
  move the peer verification NEWS entry to the alpha2 block, as it was pushed after alpha1
  mention ldap_modify_batch()
  Implement RFC https://wiki.php.net/rfc/default_encoding
  update the alpha2 release date
  Fixed ZTS and added fix to NEWS.
  Implemented feature #45528: Allow the DateTimeZone constructor to accept timezones per offset too.
  Rename timelib_get_zone to timelib_parse_zone and export.
  Replace old SVN references to Git
  fix regex to detect valgrind version New PCRE version got stricter
  fix regex to detect valgrind version New PCRE version got stricter
  Fixed memory leak in pow operator
  5.5.9 now released
  Added information in NEWS and UPGRADING
  add T_POW (**) operator
  add NEWS block for 5.6.0alpha3
  updated libs_version.txt
  ...
2014-02-14 10:27:11 -07:00
Lior Kaplan 464b1bc4fb Merge branch 'PHP-5.6' 2014-02-14 17:19:33 +02:00
Xinchen Hui 6cb316cf5d Use better data structures (incomplete) 2014-02-14 23:11:40 +08:00
Dmitry Stogov 17bf59f895 Use better data structures (incomplete) 2014-02-14 17:48:45 +04:00
Dmitry Stogov e85790a4d4 Use better data structures (incomplete) 2014-02-14 15:11:21 +04:00
Dmitry Stogov 686a078258 Use better data structures (incomplete) 2014-02-14 14:55:48 +04:00
Dmitry Stogov a52817eb02 Use better data structures (incomplete) 2014-02-14 14:11:52 +04:00
Dmitry Stogov c56a2344d0 Merge branch 'refactoring2' of github.com:zend-dev/php into refactoring2 2014-02-14 13:40:23 +04:00
Dmitry Stogov 398256e5fe Use better data structures (incomplete) 2014-02-14 13:40:11 +04:00
Xinchen Hui 068ec75f8b Use better data structures (incomplete) 2014-02-14 17:05:04 +08:00
Dmitry Stogov 40e053e7f3 Use better data structures (incomplete) 2014-02-13 17:54:23 +04:00
Anatol Belski b923de2a8f Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/standard/html.c
2014-02-13 09:22:58 +01:00
Yasuo Ohgaki 9a5cb51ebc Merge branch 'PHP-5.6'
* PHP-5.6:
  Implement RFC https://wiki.php.net/rfc/default_encoding
2014-02-13 11:56:54 +09:00
Anatol Belski 8cda1af604 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/oci8/oci8.c
2014-02-12 22:30:20 +01:00
Dmitry Stogov 6306918ed2 Use better data structures (incomplete) 2014-02-12 23:54:04 +04:00
Dmitry Stogov 7a9348f45d Reverted zval_clear() and zval_release() back to zval_ptr_dtor() 2014-02-12 22:51:19 +04:00
Xinchen Hui d3954f16d3 Use better data structures (incomplete) -- stash for today work 2014-02-12 22:15:08 +08:00
Dmitry Stogov be82a07776 Use better data structures (incomplete) 2014-02-12 18:08:11 +04:00
Dmitry Stogov 4e66abad54 Use better data structures (incomplete) - refactored return_value handling 2014-02-12 14:29:51 +04:00
Dmitry Stogov e2ea9a7319 Use better data structures (incomplete) 2014-02-12 11:42:27 +04:00
Ferenc Kovacs c9e9151bb3 Merge branch 'PHP-5.6'
* PHP-5.6:
  update the alpha2 release date
  Make html_table_gen consistent with html_table.h
2014-02-12 06:40:43 +01:00
Xinchen Hui 0c0efba45f Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-02-11 19:33:48 +08:00
Xinchen Hui 3f4c877bf7 Use better data structures (incomplete) 2014-02-11 19:33:18 +08:00
Derick Rethans c4e6c12b71 Merge branch 'PHP-5.6' 2014-02-11 11:31:13 +00:00
Dmitry Stogov 2161103fc3 Use better data structures (incomplete) 2014-02-10 17:49:21 +04:00
Anatol Belski d7a5bd11e5 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/date/php_date.c
2014-02-10 12:52:57 +01:00
Dmitry Stogov 00244baba8 Use better data structures (incomplete) 2014-02-10 12:18:01 +04:00
Dmitry Stogov f4cfaf36e2 Use better data structures (incomplete) 2014-02-10 10:04:30 +04:00
Derick Rethans a30ebbdb18 Merge branch 'PHP-5.6' 2014-02-09 15:57:54 -05:00
Anatol Belski e7719f949a fix printf fmt for zend_uint_t 2014-02-09 06:37:08 -08:00
Anatol Belski d55c85d795 fix return of hash num elements 2014-02-09 14:29:10 +01:00
Anatol Belski 33b5108a2b Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-09 11:01:26 +01:00
Anatol Belski d5c924750b replace *_STRTOL with STRTOI, etc. 2014-02-09 10:55:52 +01:00
Anatol Belski 110c17f8b8 fix size types 2014-02-08 20:05:49 +01:00
Anatol Belski 9d972d3956 fix implicit type conversion 2014-02-08 20:05:16 +01:00
Anatol Belski 3ea59f0d51 fix size types in zend_ts_hash.* 2014-02-08 20:04:31 +01:00
Nuno Lopes 7b7d2952a6 fix regex to detect valgrind version
New PCRE version got stricter
2014-02-08 07:07:15 -05:00
Anatol Belski da452e33e7 fix some implicit 32 vs 64 bit type conversions 2014-02-07 00:14:01 +01:00
Anatol Belski 06eff86e4d it's actually correct to always use size_t for zend_size_t, even on 32 bit 2014-02-07 00:13:11 +01:00
Anatol Belski 44772c2cb5 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	Zend/zend_operators.c
2014-02-06 23:17:09 +01:00
Bob Weinand 237c1bf7b5 Merge branch 'PHP-5.6' 2014-02-06 21:32:11 +01:00
Anatol Belski eeea68592f after merge fix 2014-02-06 20:20:39 +01:00
Anatol Belski 7e8616620d Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Added information in NEWS and UPGRADING
  add T_POW (**) operator
  add NEWS block for 5.6.0alpha3
  updated libs_version.txt
  updated libs_version.txt
  update libs_version.txt

Conflicts:
	Zend/zend_ini_scanner.c
	ext/standard/math.c
2014-02-06 20:20:12 +01:00
Bob Weinand 44dcdd146d Merge branch 'PHP-5.6' 2014-02-06 14:48:56 +01:00
Anatol Belski 205543143f Merge branch 'PHP-5.6'
* PHP-5.6:
  updated libs_version.txt
  updated libs_version.txt
  update libs_version.txt
2014-02-06 09:18:22 +01:00
Anatol Belski a72d90cb6d Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-05 20:17:11 +01:00
Anatol Belski 190c7772c1 Merge branch 'PHP-5.6'
* PHP-5.6:
  more tests for ICU >= 52.1 compat
  fix tests for ICU >= 52.1
2014-02-05 20:14:19 +01:00
Anatol Belski bf0d383aba fix tests for ICU >= 52.1 2014-02-05 19:25:33 +01:00
Hannes Magnusson 7d62a321c7 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix year
2014-02-05 10:18:10 -08:00
Anatol Belski b35c788a62 Merge branch 'PHP-5.6'
* PHP-5.6:
  adapt test to curl 7.35.0 upgrade
2014-02-05 15:17:48 +01:00
Anatol Belski ff390d788f Merge branch 'PHP-5.6'
* PHP-5.6:
  move the NEWS entry into the right section
2014-02-05 10:52:17 +01:00
Anatol Belski c907406c79 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-05 07:35:14 +01:00
Daniel Lowrey 6c1cdd0814 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed SNI failure from missing Z_STRVAL_PP
2014-02-04 19:13:50 -07:00
Anatol Belski 971a4a52e3 fix flag signness 2014-02-04 18:52:45 +01:00
Anatol Belski 1f8153a533 fix the comment text 2014-02-04 18:09:22 +01:00
Anatol Belski be7934b91b Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-04 11:15:54 +01:00
Anatol Belski 60846fab58 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  updated NEWS
2014-02-04 10:39:46 +01:00
Anatol Belski f27eaa1578 Merge branch 'PHP-5.6'
* PHP-5.6:
  pcre tests go with 8.34 upgrade
2014-02-04 10:35:19 +01:00
Anatol Belski 2e8e2db82a Merge branch 'PHP-5.6'
* PHP-5.6:
  pcre upgraded to 8.34
2014-02-04 10:32:09 +01:00
Anatol Belski ac42ddf586 let thread id be 64 bit on win64 2014-02-03 18:44:46 +01:00
Anatol Belski ba32bba8c2 fix some specs for line num 2014-02-03 18:14:31 +01:00
Anatol Belski c98fcaafe7 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-03 17:21:30 +01:00
Anatol Belski 798e2e75b5 more cleanups to num args types 2014-02-03 17:03:53 +01:00
Anatol Belski c5668d1fae more cleanup for num args 2014-02-03 15:59:35 +01:00
Anatol Belski 6fb3434592 fix type for op num 2014-02-03 15:03:59 +01:00
Anatol Belski 7af9b01e26 fixed length property types in zend_property_info 2014-02-03 14:23:24 +01:00
Anatol Belski 8903518423 fixed types for num_args at various places 2014-02-03 14:17:15 +01:00
Ferenc Kovacs 0e764dc657 Merge branch 'PHP-5.6' 2014-02-03 04:21:27 +01:00
Anatol Belski 472579280f after merge fix, some datatypes 2014-02-02 20:33:24 +01:00
Anatol Belski 7061c35725 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-02 18:46:15 +01:00
krakjoe 6597d86389 Merge branch 'PHP-5.6'
* PHP-5.6:
  windows
2014-02-02 15:14:53 +00:00
krakjoe eacab735e0 Merge branch 'PHP-5.6'
* PHP-5.6:
  clean symbols
2014-02-02 15:10:28 +00:00
krakjoe 8aaec7d1c3 Merge branch 'PHP-5.6'
* PHP-5.6:
  another patch from upstream
2014-02-02 14:59:30 +00:00
krakjoe 202dcc0f6a Merge branch 'PHP-5.6'
* PHP-5.6:
  woops
2014-02-02 14:50:43 +00:00
krakjoe ee42849f8f Merge branch 'PHP-5.6'
* PHP-5.6:
  better use of tmpnam/mkstemp
2014-02-02 14:42:54 +00:00
krakjoe 37f4f132fc Merge branch 'PHP-5.6'
* PHP-5.6:
  update version
2014-02-02 14:05:03 +00:00
krakjoe 4c6816ddf2 Merge branch 'PHP-5.6'
* PHP-5.6:
  remove use of zend directly, avoid leaks/bugs in modules etc
2014-02-02 13:51:05 +00:00
krakjoe dc02b5a1fd Merge branch 'master' of https://git.php.net/repository/php-src 2014-02-02 13:50:54 +00:00
Anatol Belski 15896155c4 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-02-01 20:37:43 +01:00
Daniel Lowrey f08e8772a7 Merge branch 'PHP-5.6'
* PHP-5.6:
  Remove #if PHP_VERSION_ID version checks

Conflicts:
	ext/openssl/xp_ssl.c
2014-02-01 08:25:01 -07:00
Daniel Lowrey 0893a13e32 Remove #if PHP_VERSION_ID version checks 2014-02-01 08:13:53 -07:00
Daniel Lowrey f197dafd1c Merge branch 'PHP-5.6'
* PHP-5.6:
  Use master-agnostic zend_is_true checks

Conflicts:
	ext/openssl/xp_ssl.c
2014-01-31 14:22:35 -07:00
Christopher Jones f65cdd0a46 Fix expectation that zval size was 4 bytes
Various range checks added
2014-01-30 17:45:15 -08:00
Anatol Belski 39c41e6c1d cleanup with --reverse 2014-01-30 17:21:14 -08:00
Anatol Belski 247d7d7b14 add --zpp-vars to script usage out 2014-01-30 21:53:45 +01:00
Anatol Belski d82da76d19 document more on --zpp-vars 2014-01-30 21:50:46 +01:00
Anatol Belski e56176479c added replace.php --zpp-vars
Simple cases on datatype replacements can be handled now
2014-01-30 21:40:43 +01:00
Anatol Belski 31ca11d1b6 more feasible solution for zpp specs using compat.h 2014-01-30 18:26:21 +01:00
Sara Golemon 7f42e62d22 Merge branch 'PHP-5.6'
* PHP-5.6:
  Make html_table_gen consistent with html_table.h
2014-01-30 02:06:30 -08:00
Christopher Jones 66500333cf Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix merge
2014-02-10 17:04:55 -08:00
Christopher Jones 71a82be899 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add Oracle PL/SQL BOOLEAN type support to oci_bind_by_name()
2014-02-10 15:01:37 -08:00
Sara Golemon 45e2a557f1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Make html_table_gen consistent with html_table.h
2014-01-30 02:05:49 -08:00
Anatol Belski d329b89a55 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-30 10:49:14 +01:00
Anatol Belski 5ed1bdf9a5 fix ZTS build 2014-01-30 10:47:58 +01:00
Anatol Belski 2adf9e6235 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-30 10:03:40 +01:00
Anatol Belski ae850328a1 mention important compiler warnings, state the changed APIs more precisely 2014-01-30 09:32:24 +01:00
Stanislav Malyshev 11e47b1cdc Merge branch 'PHP-5.6'
* PHP-5.6:
  tests still failing, so xfail for now until fixed
  tests still failing, so xfail for now until fixed
  tests still failing, so xfail for now until fixed
2014-01-29 23:48:44 -08:00
Stanislav Malyshev d76a6a3e4d tests still failing, so xfail for now until fixed 2014-01-29 23:48:44 -08:00
Yasuo Ohgaki 210b444e1d Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug data->fd not set to -1 for open_basedir failure.
2014-01-30 14:17:11 +09:00
Daniel Lowrey ba8cdc855d Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed build breakage from b4b4d9697f
2014-01-29 17:59:46 -07:00
Anatol Belski 0c14569584 after merge fix 2014-01-29 23:21:15 +01:00
Anatol Belski 27868a0966 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-29 22:57:53 +01:00
Anatol Belski c91ad8233b fix merge error after b4b4d9697f 2014-01-29 22:50:56 +01:00
Anatol Belski 485e999d9c Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqli/php_mysqli_structs.h
2014-01-29 22:08:50 +01:00
Andrey Hristov 79e0c273b8 Merge branch 'master' of git.php.net:php-src
Conflicts:
	ext/openssl/xp_ssl.c
2014-01-29 15:33:52 +02:00
Andrey Hristov 1c7f54d4f7 Merge branch 'PHP-5.6'
Conflicts:
	NEWS
	ext/openssl/xp_ssl.c
2014-01-29 15:32:02 +02:00
Remi Collet cbb1097770 Merge branch 'PHP-5.6'
* PHP-5.6:
  zip extension version 1.12.4
2014-01-29 14:01:03 +01:00
Anatol Belski 7554d07945 separated zpp and macro replacement 2014-01-29 13:39:02 +01:00
Anatol Belski 9fedc08613 more doc on replace.php 2014-01-29 13:10:57 +01:00
Anatol Belski e2bdd42758 fixed reverse mode for --zpp 2014-01-29 12:52:38 +01:00
Anatol Belski b281016972 some datatype fixes 2014-01-29 12:40:32 +01:00
Anatol Belski e2cab1d888 fixed --zpp and added --zpp-compat 2014-01-29 12:39:19 +01:00
Anatol Belski 236e3188db Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	main/php_ini.c
2014-01-29 10:45:52 +01:00
Remi Collet 83c302840e Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed Request #66574 Allow multiple paths in php_ini_scanned_path
2014-01-29 09:57:22 +01:00
Yasuo Ohgaki 3828b5d83d Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed zend.multibyte tests partially
2014-01-29 15:56:13 +09:00
Anatol Belski 8da5217cd5 Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Update NEWS/UPGRADING
  Verify peers by default in client socket operations
  add text for the new constants
  add new consts
  Fixed arginfo of PDO::__construct() to match the docs and zend_parse_parameters definition.
  fix *.dsp files related to bug #50333
2014-01-29 00:36:37 +01:00
Anatol Belski 68969026fc reveal implemented replace.php options 2014-01-29 00:35:40 +01:00
Anatol Belski 4347713fd2 more precise info on printf formats and fix some wording 2014-01-29 00:16:47 +01:00
Anatol Belski febe423643 added info about new datatypes in zval 2014-01-28 23:55:39 +01:00
Daniel Lowrey 6edc84fcdf Merge branch 'PHP-5.6'
* PHP-5.6:
  Update NEWS/UPGRADING
  Verify peers by default in client socket operations

Conflicts:
	ext/openssl/xp_ssl.c
2014-01-28 10:36:28 -07:00
Daniel Lowrey 4bc8f94b58 Merge branch 'master' of https://github.com/php/php-src
* 'master' of https://github.com/php/php-src:
  add text for the new constants
  add new consts
2014-01-28 09:53:17 -07:00
Andrey Hristov fb5c7cda5d Merge branch 'master' of git.php.net:php-src 2014-01-28 15:58:08 +02:00
Andrey Hristov 3834771b2e Merge branch 'PHP-5.6'
Conflicts:
	NEWS
	UPGRADING
2014-01-28 15:57:48 +02:00
Andrey Hristov d9078c7c8d Merge branch 'PHP-5.6' 2014-01-28 15:47:50 +02:00
Anatol Belski 90bce9f1e8 word on bit shifting 2014-01-28 14:17:36 +01:00
Bob Weinand 4b8c098f02 Merge branch 'PHP-5.6' 2014-01-28 13:35:13 +01:00
Anatol Belski b1396cc7a5 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix *.dsp files related to bug #50333
2014-01-28 13:10:01 +01:00
Anatol Belski 82857031f0 fix datatype 2014-01-28 12:00:33 +01:00
Freek 54a6c1de7d Fix #66562: Consistency bug where curl_multi_getcontent behaves different from curl_exec
curl_exec returns an empty string when data is received from a domain that returns zero content. curl_multi_getcontent
returned null. Now it returns an empty string fixing the incosistency
2014-01-28 11:47:14 +01:00
Anatol Belski b972c10f3c Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-28 07:58:50 +01:00
Daniel Lowrey aafce7353e Merge branch '5.6'
* 5.6:
  Update NEWS/UPGRADING
  Prevent invalid SAN peer verification on null byte prefix attack
2014-01-27 15:00:04 -07:00
Yasuo Ohgaki 9f3a98b124 Merge branch 'PHP-5.6'
* PHP-5.6:
  Remove obsolete description
2014-01-27 18:58:06 +09:00
Stanislav Malyshev 473cd4d6a9 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix English and improve by Stas. Thanks :)
  Update source docs
  Revert "Update source docs"
  Update source docs
2014-01-26 17:21:33 -08:00
Stanislav Malyshev 586f379b88 Merge branch 'PHP-5.6'
* PHP-5.6:
  drop precision since trigonometric functions are non-portable
  XFAIL multibyte tests until they are fixed (bug 66582)
2014-01-26 15:51:46 -08:00
Stanislav Malyshev 909ef53e9d Merge branch 'PHP-5.6'
* PHP-5.6:
  drop precision since trigonometric functions are non-portable
2014-01-26 15:16:08 -08:00
Stanislav Malyshev 4e89151159 Merge branch 'PHP-5.6'
* PHP-5.6:
  XFAIL multibyte tests until they are fixed (bug 66582)
2014-01-26 15:12:40 -08:00
Stanislav Malyshev ceca4d2490 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test
2014-01-26 14:31:43 -08:00
Stanislav Malyshev a0445644e0 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test
2014-01-26 14:26:26 -08:00
Stanislav Malyshev 8e08f6c28d Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test - new flag ZEND_ACC_HAS_TYPE_HINTS
2014-01-26 12:17:32 -08:00
Stanislav Malyshev c4259f90b1 fix test - new flag ZEND_ACC_HAS_TYPE_HINTS 2014-01-26 12:17:29 -08:00
Anatol Belski d7c02a47fd extended replace.php with --reverse and --zpp 2014-01-26 18:21:05 +01:00
Derick Rethans 6dd41435a3 Merge branch 'PHP-5.6' 2014-01-26 14:02:55 +01:00
Anatol Belski 350d9db222 after merge fixes to ext/ldap 2014-01-26 13:42:06 +01:00
Anatol Belski 4d7f63385b Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-26 12:29:45 +01:00
Stanislav Malyshev c2a93ba3af Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test bug62479.phpt
2014-01-25 23:27:48 -08:00
Stanislav Malyshev 1eee68d3f4 Merge branch 'PHP-5.6'
* PHP-5.6:
  Implement ldap_modify_batch.
2014-01-25 22:05:18 -08:00
Anatol Belski 2726001dd0 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-25 22:24:37 +01:00
Derick Rethans 0f62b94971 Merge branch 'PHP-5.6' 2014-01-25 16:16:42 +01:00
Anatol Belski 3b61e3ec1e Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqlnd/mysqlnd_ps_codec.c
2014-01-24 22:15:16 +01:00
Ferenc Kovacs a791671f40 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix the primary qa email address and update the list of available people being able to add moderators to our lists
  Revert "Fix #62479: Some chars not parsed in passwords"
  Fix #62479: Some chars not parsed in passwords
2014-01-24 16:13:10 +01:00
Andrey Hristov 3aa6f8bfdd Merge branch 'PHP-5.6' 2014-01-24 12:31:33 +02:00
Andrey Hristov dc6b14149d Merge branch 'PHP-5.6'
Conflicts:
	ext/mysqlnd/mysqlnd_ps_codec.c
2014-01-24 12:15:03 +02:00
Anatol Belski 727fac6290 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqlnd/mysqlnd_ps_codec.c
2014-01-24 04:20:21 +01:00
Anatol Belski 9debf41bfd some extension to the porting doc 2014-01-24 04:15:50 +01:00
Xinchen Hui 874a0bb7eb Merge branch 'PHP-5.6' 2014-01-24 10:52:22 +08:00
Will Fitch 28e0a2129b Merge branch 'PHP-5.6'
* PHP-5.6:
  Update gitignore and Makefile for additional entries
2014-01-23 21:36:54 -05:00
Christopher Jones daa34699af Add #defines for compatibility with PHP releases prior to the core PHP
type changes.
2014-01-23 11:13:32 -08:00
Andrey Hristov 7072db5a6b FIx failing tests because of operator precedence 2014-01-23 18:20:13 +02:00
Anatol Belski 4be5d97f3d fixed merge error in ext/oci8 2014-01-23 01:10:13 +01:00
Anatol Belski c0e5d95ca6 added convert_to_int_ex 2014-01-23 01:07:44 +01:00
Christopher Jones ab5405e800 Fixes to ext/oci8 2014-01-23 00:25:55 +01:00
Anatol Belski 2741cf56a4 missed header 2014-01-22 15:16:35 -08:00
Anatol Belski aa6f6ca864 fixed ZEND_INT_FMT 2014-01-22 15:11:39 -08:00
Anatol Belski 2bdb887975 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-22 23:47:05 +01:00
Anatol Belski 4904be6d94 Merge branch 'PHP-5.6'
* PHP-5.6:
  refixed that test for 5.5+
  5.5.10 next
2014-01-22 23:31:09 +01:00
Anatol Belski d21056176a missing piece of code from the mainstream 2014-01-22 22:19:02 +01:00
Anatol Belski 806e540a4f Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-22 15:43:09 +01:00
Anatol Belski 03dfe0d5e0 Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed test
2014-01-22 15:41:45 +01:00
Anatol Belski 529060dbc9 after merge fix ext\session 2014-01-22 14:55:25 +01:00
Anatol Belski 374a796daa renamed the compat macros 2014-01-22 14:51:47 +01:00
Anatol Belski dcdf236467 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix zts
2014-01-22 12:05:27 +01:00
Anatol Belski bb45daeb75 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-22 11:56:50 +01:00
Anatol Belski 74fff1512a Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed missing usleep() prototype in pgsql
2014-01-22 11:54:16 +01:00
Yasuo Ohgaki 36a7f48e84 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed previous commit may delete unwanted cookies. Sync tests from upper branches.
  Re-fixed bug #66469
2014-01-22 19:23:52 +09:00
Anatol Belski ff42d2a644 after merge fix and more revamp on ext\session 2014-01-22 09:54:04 +01:00
Anatol Belski 8a43325b38 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-22 09:29:30 +01:00
Yasuo Ohgaki 9cefeea860 Merge branch 'PHP-5.6'
* PHP-5.6:
  Re-fixed bug #66469
2014-01-22 13:49:13 +09:00
Stanislav Malyshev d5f79e40e5 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix CVE ref for bug #66060
  fix CVE ref for bug #66060
  fix buglet in makedist
  5.4.26 next
  fix news
2014-01-21 13:29:13 -08:00
Anatol Belski a40c20f764 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqlnd/mysqlnd_result.c
2014-01-21 17:17:27 +01:00
Anatol Belski 4b7148711b Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed post deactivate signature in ext\libxml
2014-01-21 17:15:12 +01:00
Johannes Schlüter 676864684b Merge branch 'PHP-5.6' 2014-01-21 16:40:13 +01:00
David Soria Parra 807d937e91 Merge branch 'PHP-5.6'
* PHP-5.6:
  Change automaticaly to automatically
2014-01-21 16:20:14 +01:00
Ferenc Kovacs 2bf13b2042 Merge branch 'PHP-5.6' 2014-01-21 11:21:28 +01:00
Ferenc Kovacs 15acd4ee50 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix these tests so they properly clean up after themselves.
2014-01-21 02:29:11 +01:00
Anatol Belski 5b83f7252a Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-20 17:39:53 +01:00
Anatol Belski 9673f66da6 range checks for ext\bz2 2014-01-20 17:24:09 +01:00
Remi Collet a3541301eb Merge branch 'PHP-5.6'
* PHP-5.6:
  Skip those test which fails on ARM architecture
  dos2unix
2014-01-20 14:44:43 +01:00
Xinchen Hui aaad97675a Merge branch 'PHP-5.6' 2014-01-20 21:25:42 +08:00
Anatol Belski 89a9acea1f Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed glob compilation with vc12
2014-01-20 10:13:22 +01:00
Anatol Belski d501707248 Merge branch 'PHP-5.6'
* PHP-5.6:
  support for Visual C+ 2013
2014-01-20 10:05:37 +01:00
Remi Collet 5b5b9b9239 Merge branch 'PHP-5.6'
* PHP-5.6:
  Skip readline tests which fail with libedit Add specific libedit test (output slightly differs)
2014-01-20 09:39:39 +01:00
Remi Collet 3b82a477b0 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed Bug #66412 readline_clear_history() with libedit causes segfault after #65714
2014-01-20 08:41:04 +01:00
Yasuo Ohgaki fd45f1eb78 Merge branch 'PHP-5.6'
* PHP-5.6:
  Enable zend.multibyte tests. Tipcal configuration works, but most tests fail.
2014-01-19 13:33:27 +09:00
Anatol Belski e3cfbef33f Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/pdo_pgsql/pgsql_driver.c
2014-01-19 02:17:07 +01:00
Anatol Belski d788a85736 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix C89 compat
2014-01-19 02:05:38 +01:00
Will Fitch 9eb4bc2f84 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix #62479: Some chars not parsed in passwords
2014-01-18 19:49:06 -05:00
Anatol Belski bc7dc1913c Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-19 01:35:02 +01:00
Will Fitch 4e5195f82c Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #66509: copy() arginfo incorrect since 5.4
2014-01-18 11:57:34 -05:00
Nikita Popov 89eab884d9 Merge branch 'PHP-5.6' 2014-01-18 14:44:57 +01:00
Johannes Schlüter 84efb8fc71 Merge branch 'PHP-5.6' 2014-01-18 13:53:15 +01:00
Anatol Belski f5d48e8524 partial revamp ext/intl 2014-01-17 23:52:19 +01:00
Adam Harvey 86096a99ec Merge branch 'PHP-5.6' 2014-01-17 20:29:31 +08:00
Michael Wallner f1fc5a5bf5 Merge branch 'PHP-5.6'
* PHP-5.6:
  Clarify always_populate_raw_post_data situation in 5.6
2014-01-17 12:19:17 +01:00
Anatol Belski ee039d5a1a Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-17 11:12:14 +01:00
Anatol Belski deb56c010e Merge branch 'PHP-5.6' 2014-01-17 11:08:21 +01:00
Antony Dovgal cfce5a4d02 Merge branch 'master' of https://git.php.net/repository/php-src
* 'master' of https://git.php.net/repository/php-src:
  forked the test for bug #66481
2014-01-17 12:22:34 +04:00
Antony Dovgal a053e69991 fix indentation 2014-01-17 12:22:07 +04:00
Anatol Belski feb4eb850d Merge branch 'PHP-5.6'
* PHP-5.6:
  forked the test for bug #66481
2014-01-17 03:32:26 +01:00
Antony Dovgal 998f506b6d Merge branch 'fpm-apparmor-fixed' of https://github.com/notti/php-src
* 'fpm-apparmor-fixed' of https://github.com/notti/php-src:
  Add some basic and apparmor tests to fpm
  Add --force-stderr to fpm
  Add apparmor change hat functionality to fpm
2014-01-16 17:36:03 +04:00
Anatol Belski 24850c5662 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-16 10:16:04 +01:00
Xinchen Hui 7691926bbe Merge branch 'PHP-5.6' 2014-01-16 14:42:14 +08:00
Anatol Belski 49c20cdfcb Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-16 07:32:33 +01:00
Yasuo Ohgaki 7b5b2b4efa Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug #66481 Segfaults on session_name()
2014-01-16 11:35:57 +09:00
Dmitry Stogov 511a375e60 Merge branch 'PHP-5.6'
* PHP-5.6:
  Log information about cached scripts and keys
2014-01-15 12:15:41 +04:00
Anatol Belski 208e580ebc Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/pgsql/pgsql.c
2014-01-15 08:29:12 +01:00
Dmitry Stogov 61028ad45e Merge branch 'PHP-5.6'
* PHP-5.6:
  We don't know PHP_5_6_X_API_NO yet
2014-01-15 11:11:01 +04:00
Yasuo Ohgaki e4f1eee6c3 Merge branch 'PHP-5.6'
* PHP-5.6:
  Added pg_lo_truncate() and 64bit large object support from PostgreSQL 9.3 and up
2014-01-15 14:39:56 +09:00
Yasuo Ohgaki a92c5b14cf Merge branch 'PHP-5.6'
* PHP-5.6:
  Always initialize pg_version() result array elements to prevent failed test with older postgresql servers. Add missing client_encoding element.
2014-01-15 14:28:08 +09:00
Yasuo Ohgaki ee4e5ce2cf Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed pg_version() crash with older postgresql
2014-01-15 13:32:43 +09:00
Yasuo Ohgaki 42c134df4b Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed session module is sending multiple set-cookie headers when session.use_strict_mode=1
2014-01-15 11:07:51 +09:00
Anatol Belski 3213959080 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-14 17:23:59 +01:00
Xinchen Hui aca07343ce Merge branch 'PHP-5.6' 2014-01-14 22:34:53 +08:00
Anatol Belski 4f71b9022d fix printf spec 2014-01-14 05:59:40 -08:00
Anatol Belski d384422f27 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqlnd/mysqlnd_ps_codec.c
2014-01-14 09:51:34 +01:00
Anatol Belski 25e57e702b fix uninitialized value 2014-01-14 09:47:27 +01:00
Anatol Belski 0c04890354 more fixes after merge 2014-01-14 09:45:46 +01:00
Anatol Belski 5866c701a2 after merge fix 2014-01-14 09:15:55 +01:00
Anatol Belski 28c917923d Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqlnd/mysqlnd_ps_codec.c
2014-01-14 09:10:38 +01:00
Anatol Belski 614a69fe1d Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2014-01-14 08:59:36 +01:00
Yasuo Ohgaki 681e1a5ce0 Merge branch 'PHP-5.6'
* PHP-5.6:
  Made pg_version() return full connection info.
2014-01-14 10:16:43 +09:00
Paul Tarjan d599d36d49 Dont ignore errors from FT_Get_Glyph 2014-01-13 16:30:48 -08:00
Andrey Hristov bbc37e78e8 Merge branch 'master' of git.php.net:php-src 2014-01-14 01:32:36 +02:00
Andrey Hristov 73008bb5ce More refactoring of the big function generating execute requests 2014-01-14 01:31:16 +02:00
Anatol Belski aeec64b7f4 fixed a typo 2014-01-13 23:12:58 +01:00
Anatol Belski f92f7f05e9 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-13 22:08:35 +01:00
Dmitry Stogov 5980e987d2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed ZTS build
2014-01-13 23:11:36 +04:00
Anatol Belski 7010a933d1 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-13 18:58:45 +01:00
Anatol Belski 25dfcf4fdd small corrections 2014-01-13 18:56:43 +01:00
Anatol Belski de137e5a8d Merge branch 'PHP-5.6'
* PHP-5.6:
  forked test for win32
2014-01-13 17:13:11 +01:00
Dmitry Stogov 127eb33b84 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66461 (PHP crashes if opcache.interned_strings_buffer=0)
2014-01-13 18:07:26 +04:00
Anatol Belski 972a6bd0f7 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/opcache/Optimizer/pass1_5.c
2014-01-13 14:29:14 +01:00
Anatol Belski e15f7decd1 further porting notes 2014-01-13 14:23:39 +01:00
Dmitry Stogov e141592da6 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66440 (Optimisation of conditional JMPs based on pre-evaluate constant function calls)
2014-01-13 16:16:57 +04:00
Dmitry Stogov f5182741a6 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  move common code into a function
2014-01-13 15:36:37 +04:00
Dmitry Stogov 3458dac342 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66471 (Keep backward compatibility)
2014-01-13 15:36:06 +04:00
Anatol Belski 21643019c0 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/mysqlnd/mysqlnd_ps_codec.c
2014-01-13 12:29:30 +01:00
Anatol Belski bd5a5e7f7a added ptrdiff_t notes and some other porting doc improvements 2014-01-13 12:22:01 +01:00
Anatol Belski 85ff0a75e3 ws and some note corrections 2014-01-13 12:04:25 +01:00
Anatol Belski e5613c17fc more on porting 2014-01-13 11:55:53 +01:00
Andrey Hristov cf9966671c Merge branch 'master' of git.php.net:php-src 2014-01-13 12:40:59 +02:00
Andrey Hristov 01d5e28057 move common code into a function 2014-01-13 12:40:39 +02:00
Anatol Belski 7957d672bc Merge remote-tracking branch 'origin/master' into str_size_and_int64
* origin/master:
  Fixed bug #66474 (Optimizer bug in constant string to boolean conversion)
2014-01-13 10:45:19 +01:00
Anatol Belski f7e5a97076 further writing on PECL_PORTING 2014-01-13 10:44:36 +01:00
Dmitry Stogov aab2e8eb7e Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66474 (Optimizer bug in constant string to boolean conversion)
2014-01-13 12:08:23 +04:00
Anatol Belski 4560d412bb reworked compat.h 2014-01-13 04:08:46 +01:00
Anatol Belski 2487493f83 added compat.h 2014-01-12 15:48:47 +01:00
Anatol Belski 3957288cf7 rrenamed the readme file 2014-01-12 14:02:18 +01:00
Anatol Belski b1ea854100 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-12 12:03:53 +01:00
Anatol Belski fba53c888b started the porting docs/tools 2014-01-12 12:00:12 +01:00
Bob Weinand a86e869ee8 Merge branch 'PHP-5.6' 2014-01-12 02:00:37 +01:00
Anatol Belski fd09f3f059 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	Zend/zend_language_parser.y
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2014-01-11 16:30:35 +01:00
Nikita Popov 4facc35413 Merge branch 'PHP-5.6' 2014-01-11 12:54:08 +01:00
Anatol Belski 5122ece265 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-11 00:25:13 +01:00
Johannes Schlüter 82dfe1acc8 Merge branch 'PHP-5.6' 2014-01-10 16:04:29 +01:00
Anatol Belski 5fefc0ce47 reverted erroneous patch in array_sum() 2014-01-10 14:56:03 +01:00
Anatol Belski aaccf60fea Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-09 16:30:25 +01:00
Anatol Belski 9aaea81cfe Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed EOL in the test
2014-01-09 15:29:16 +01:00
Anatol Belski 3572a0482d Merge branch 'PHP-5.6'
* PHP-5.6:
  added testcase from bug #65371
2014-01-09 15:25:18 +01:00
Dmitry Stogov 83b00bbd08 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed ADD_INTERNED_STRING() logic to support strings that are already interned. (Terry)
2014-01-09 13:50:12 +04:00
Anatol Belski 6951bea25e revamped ext/shmop 2014-01-09 09:51:21 +01:00
Anatol Belski 9dd5099566 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-09 08:26:42 +01:00
Anatol Belski 2a468115e3 revamp mysqlnd, mysqli, mysql and pdo_mysql 2014-01-09 04:18:37 +01:00
Anatol Belski 8edaa10eab fixed the 'p' modifier when %p is used 2014-01-09 04:17:38 +01:00
Gernot Vormayr e9883779a0 Add some basic and apparmor tests to fpm 2014-01-07 00:21:24 +01:00
Gernot Vormayr 32d9409a24 Add --force-stderr to fpm 2014-01-07 00:19:01 +01:00
Scott MacVicar 6fe34014f0 Merge branch 'PHP-5.6'
* PHP-5.6:
  [libxml] Unit test for libxml_disable_entity_loader()
2014-01-06 17:06:33 +00:00
Scott MacVicar 28beaaad9c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  [libxml] Unit test for libxml_disable_entity_loader()
2014-01-06 17:05:34 +00:00
Scott MacVicar 42f084c692 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  [libxml] Unit test for libxml_disable_entity_loader()
2014-01-06 17:05:16 +00:00
Scott MacVicar 24cc7c0be2 [libxml] Unit test for libxml_disable_entity_loader()
Summary:
Test to make sure libxml_disable_entity_loader() is behaving.
2014-01-06 17:04:54 +00:00
Anatol Belski 47df90a765 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2014-01-05 23:06:08 +01:00
Anatol Belski e797e058c5 Merge branch 'PHP-5.6'
* PHP-5.6:
  one more extension for the basename test
2014-01-05 19:22:11 +01:00
Anatol Belski ac875f8f7e Merge branch 'PHP-5.6'
* PHP-5.6:
  improved the fix for bug #66395
  Fixed bug #66009 Failed compilation of PHP extension with C++ std library using VS 2012
  updated NEWS
  Fixed bug #66009 Failed compilation of PHP extension with C++ std library using VS 2012
2014-01-05 19:13:40 +01:00
Anatol Belski 4ff4837966 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	Zend/zend.c
	Zend/zend_ini_scanner.c
2014-01-04 02:17:11 +01:00
Anatol Belski 19aafe43b2 Fixed bug #66009 Failed compilation of PHP extension with C++ std library using VS 2012
Visual Studio 2012 includes sanity checks for C++11 features, see
http://msdn.microsoft.com/en-us/library/vstudio/bb531344(v=vs.110).aspx
To fix the 'inline' keyword redefinition for C++ in debug mode, the
new macros ZEND_WIN32_KEEP_INLINE is introduced, ZEND_WIN32_FORCE_INLINE is
automatically appended in release mode.
2014-01-04 01:41:49 +01:00
Nikita Popov 250ee4c17a Merge branch 'PHP-5.6' 2014-01-04 01:30:44 +01:00
Anatol Belski 6e7d24dd14 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
2014-01-03 22:45:09 +01:00
Anatol Belski b502c0a3dc Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66395 basename function doesn't remove drive letter
2014-01-03 22:39:17 +01:00
Xinchen Hui b209c27302 Merge branch 'PHP-5.6' 2014-01-03 11:37:32 +08:00
Xinchen Hui af6c11c5f0 Bump year 2014-01-03 11:11:57 +08:00
Xinchen Hui 0f53e37494 Merge branch 'PHP-5.6' 2014-01-03 11:09:07 +08:00
Derick Rethans c9f909cd42 Merge branch 'PHP-5.6' 2014-01-02 12:52:26 +00:00
Derick Rethans 63d390cdf9 Merge branch 'PHP-5.6' 2014-01-02 12:47:52 +00:00
Anatol Belski 826064410c Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/gmp/gmp.c
2014-01-02 09:55:25 +01:00
krakjoe 9e4ab7c53f Merge branch 'PHP-5.6'
* PHP-5.6:
  fix #66375 bad logic in sapi header callback routine
2014-01-01 13:01:41 +00:00
Felipe Pena 57a6209051 Merge branch 'PHP-5.6'
* PHP-5.6:
  - Fixed bug #66381 (__ss_family was changed on AIX 5.3)
2014-01-01 09:57:03 -02:00
Nikita Popov 73db3cda8b Merge branch 'PHP-5.6' 2013-12-30 14:41:45 +01:00
Michael Wallner 79d1c70e99 This should be an empty merge.
Merge branch 'PHP-5.6'

* PHP-5.6:
  update php.ini-*
  Add E_DEPRECATED when populating $HTTP_RAW_POST_DATA
  add 'never'
  fix type
  fix type; add tests for -1
  s/BOOLEAN/ENTRY/
  re-introduce always_populate_raw_post_data
2013-12-30 14:32:25 +01:00
Nikita Popov 056f3441fd Merge branch 'PHP-5.6' 2013-12-30 13:59:55 +01:00
Anatol Belski 9ac081f295 after merge fixes to ext/zip 2013-12-30 10:48:14 +01:00
Anatol Belski 4e9b54757a fixes after merge and some opcache revamp 2013-12-30 10:42:05 +01:00
Anatol Belski d40315a09d Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-30 10:12:32 +01:00
Anatol Belski bcfee0ada4 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/opcache/Optimizer/zend_optimizer.c
	ext/opcache/Optimizer/zend_optimizer_internal.h
	ext/zip/php_zip.c
2013-12-30 10:07:08 +01:00
Remi Collet a3c7971f94 Merge branch 'PHP-5.6'
* PHP-5.6:
  missing file from libzip 0.11.2
2013-12-30 10:00:19 +01:00
Remi Collet 7844fb292c Merge branch 'PHP-5.6'
* PHP-5.6:
  fix compat for PHP ABI changes
2013-12-30 08:47:23 +01:00
Remi Collet 717dcdaa67 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
2013-12-30 07:45:17 +01:00
Remi Collet 764190c1d6 Merge branch 'PHP-5.6'
* PHP-5.6:
  Sync with pecl/zip 1.12.4dev
2013-12-30 07:38:45 +01:00
Xinchen Hui 6b34343479 Merge branch 'PHP-5.6' 2013-12-30 11:07:42 +08:00
Xinchen Hui 8b72df0608 Merge branch 'PHP-5.6' 2013-12-30 10:58:56 +08:00
Xinchen Hui 408ae9a452 Merge branch 'PHP-5.6' 2013-12-30 10:52:21 +08:00
Anatol Belski b923ee32c9 added ZEND_ABS and revamped some related stuff 2013-12-29 16:39:15 +01:00
Anatol Belski 1085d21693 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-28 17:30:23 +01:00
Remi Collet bd3e5aab1d Merge branch 'PHP-5.6'
* PHP-5.6:
  minor fix on previous
2013-12-28 14:29:38 +01:00
Remi Collet 8785e22bca Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop())
2013-12-28 14:26:24 +01:00
Anatol Belski 4aca887f8b other place with 64 bit << and hash size 2013-12-28 13:58:22 +01:00
Anatol Belski 10cd3f86b7 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-28 02:36:45 +01:00
Anatol Belski b8b4591265 fix bit shift 64 vs 32 bit vars 2013-12-28 00:38:49 +01:00
Anatol Belski e2df932ef0 revamp the hash api once more 2013-12-27 23:28:22 +01:00
krakjoe 50f09d8256 Merge branch 'PHP-5.6'
* PHP-5.6:
  update version output
2013-12-27 18:04:06 +00:00
Anatol Belski 173bd989cd fix macros conflicts when included intsafe.h 2013-12-27 17:32:46 +01:00
Anatol Belski d0ab1e4ea4 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/gd/gd.c
2013-12-27 17:01:29 +01:00
Xinchen Hui fb4678f1ac Merge branch 'PHP-5.6' 2013-12-27 20:46:08 +08:00
Xinchen Hui c0476ff44b Merge branch 'PHP-5.6' 2013-12-27 14:11:41 +08:00
Xinchen Hui 1a4863d560 Merge branch 'PHP-5.6' 2013-12-27 14:07:15 +08:00
Anatol Belski 8d0b174eea removed accidentially merged in files 2013-12-26 13:33:38 +01:00
Anatol Belski 3e65d7dad0 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	Zend/zend_compile.c
2013-12-26 13:06:49 +01:00
Dmitry Stogov 65fd18fd88 Merge branch 'PHP-5.6'
* PHP-5.6:
  Improved empty string handling. Now ZE uses an interned string instead of allocation new empty string each time. (Some extensions might need to be fixed using str_efree() instead of efree() to support interned strings).

Conflicts:
	NEWS
	Zend/zend_extensions.h
	Zend/zend_modules.h
2013-12-26 14:51:05 +04:00
Xinchen Hui d6713f3989 Fixed warning "No new line at end of file" 2013-12-26 17:45:37 +08:00
Dmitry Stogov ef56cfb991 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed ZEND_MM_MEM_TYPE=mmap_zero
2013-12-26 11:53:03 +04:00
Anatol Belski a5720b4493 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-25 23:45:53 +01:00
Anatol Belski c676f5b36d Merge branch 'PHP-5.6'
* PHP-5.6:
  fix c89 compat
2013-12-25 23:44:24 +01:00
Anatol Belski 734c28d242 Merge branch 'PHP-5.6'
* PHP-5.6:
  brought the ext/sybase_ct/config.w32 up to date
2013-12-25 23:31:17 +01:00
Anatol Belski d031758b49 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-25 22:40:03 +01:00
Anatol Belski 1dc85bfa6c revamp ext/sybase_ct 2013-12-25 22:33:11 +01:00
Xinchen Hui bd0a8f31a4 Merge branch 'master' of git.php.net:php-src 2013-12-25 15:36:45 +08:00
Xinchen Hui 03e36cd5b8 Merge branch 'PHP-5.6' 2013-12-25 15:35:02 +08:00
Stanislav Malyshev b3c43a1aec Merge branch 'PHP-5.6'
* PHP-5.6:
  5.4.25 next
2013-12-24 22:23:55 -08:00
Anatol Belski 79eb697f48 Merge branch 'master' into str_size_and_int64 2013-12-24 22:04:07 +01:00
Anatol Belski 0493099786 next wave on fixes for ext/phpdbg 2013-12-24 21:59:44 +01:00
Anatol Belski 3af0ee0ea3 Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed incompatible pointer in phpdbg on win64
2013-12-24 21:09:45 +01:00
Bob Weinand c02acf3c29 Merge branch 'PHP-5.6' 2013-12-24 13:20:12 +01:00
Anatol Belski 5ae8f624a1 basic fixes to sapi/phpdbg 2013-12-24 02:44:53 -08:00
Anatol Belski 713b69adf8 added credits note 2013-12-24 02:44:53 -08:00
Anatol Belski 87f348a1e7 basic fixes to sapi/fpm 2013-12-24 02:44:53 -08:00
Anatol Belski 4267b15630 Z_STRLEN vs Z_STRSIZE 2013-12-24 02:44:53 -08:00
Joe Watkins 5aba79affa update credits 2013-12-24 02:44:53 -08:00
Bob Weinand 62f0ffb34e Added breaking upon fatal-ish error 2013-12-24 02:44:53 -08:00
Stanislav Malyshev 4363b38657 fix NEWS file for master 2013-12-24 02:44:53 -08:00
Bob Weinand 09e6ef3986 Fixed credits in phpdbg.* files 2013-12-24 02:44:52 -08:00
Joe Watkins ca8ff0725b update credits 2013-12-24 09:04:32 +00:00
Joe Watkins e07dfa96b3 Merge branch 'master' of https://git.php.net/repository/php-src
* 'master' of https://git.php.net/repository/php-src:
  Fixed credits in phpdbg.* files
  Added breaking upon fatal-ish error
  fix NEWS file for master
  credits file for phpdbg
  Fixed credits in phpdbg.* files
  reformat
  credits file
2013-12-24 09:03:55 +00:00
Bob Weinand ad358593a8 Merge branch 'PHP-5.6' 2013-12-24 00:37:20 +01:00
Stanislav Malyshev 6daa84f199 fix NEWS file for master 2013-12-23 15:25:38 -08:00
Anatol Belski 2f77629f72 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-23 23:41:29 +01:00
Anatol Belski e540839c8b Merge branch 'master' into str_size_and_int64
Conflicts:
	Zend/zend_vm_execute.h
	ext/opcache/Optimizer/pass1_5.c
	ext/opcache/ZendAccelerator.h
2013-12-23 23:39:42 +01:00
Joe Watkins 056f6fd895 Merge branch 'PHP-5.6'
* PHP-5.6:
  credits file for phpdbg
2013-12-23 22:37:36 +00:00
Anatol Belski 63ea29a206 fixed tests using 'expected to be long' vs 'expected to be integer' 2013-12-23 14:28:02 -08:00
Anatol Belski a06a89dba6 removed the all style function arg formats 'l', 's', 'p' 2013-12-23 14:24:34 -08:00
Stanislav Malyshev 392f6830a1 Merge branch 'PHP-5.6'
* PHP-5.6:
  restore NEWS to the state of 6c5e93fe17
2013-12-23 14:10:44 -08:00
Anatol Belski 389b4d411e fix typo after merge 2013-12-23 20:31:40 +01:00
Dmitry Stogov 276b9767e4 Fixed bug #66338 (Optimization binding of class constants is not safely opcacheable) 2013-12-23 20:30:30 +01:00
Dmitry Stogov c699696c43 Fixed bug #66334 (Memory Leak in new pass1_5.c optimizations). (Terry) 2013-12-23 20:30:27 +01:00
krakjoe 8d64f0ee71 missing, apparently 2013-12-23 20:25:58 +01:00
Dmitry Stogov 67eccf8617 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66338 (Optimization binding of class constants is not safely opcacheable)
2013-12-23 16:54:54 +04:00
Dmitry Stogov bd88bed670 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  removed outdated IsDebuggerPresent declaration
2013-12-23 16:05:38 +04:00
Dmitry Stogov 209ec406ca Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66334 (Memory Leak in new pass1_5.c optimizations). (Terry)
2013-12-23 16:05:18 +04:00
Anatol Belski ea7a70708f removed outdated IsDebuggerPresent declaration
This piece of code seems to retain compatibility with some windows
versions before 2000. Today it's not relevant anymore and only
produces a warning C4273 because of the conflicting prototype. In
VC9 the declaration is present in winbase.h:4142, but available
is it already in winxp. Here's the doc link
http://msdn.microsoft.com/en-us/library/windows/desktop/ms680345(v=vs.85).aspx
2013-12-23 12:34:30 +01:00
Dmitry Stogov 1c462a4e4d Added suggestion about opcache.revalidate_freq setting in development environment 2013-12-23 12:34:27 +01:00
Dmitry Stogov 9c5a902106 Fixed Issue #140: "opcache.enable_file_override" doesn't respect "opcache.revalidate_freq" 2013-12-23 12:34:26 +01:00
Sara Golemon 78f2ded86a Bump ZEND_MODULE_API_NO due to the TSRMLS change to zend_is_true() 2013-12-23 12:30:16 +01:00
krakjoe a2e77fb258 opcodes 2013-12-23 12:29:01 +01:00
krakjoe 07e97f919d missing, apparently 2013-12-23 12:28:59 +01:00
krakjoe f9affb5ae9 stop warnings from unused opcode map 2013-12-23 12:24:11 +01:00
Felipe Pena aaca4ede15 - Fixed bug #66311 (Stack smashing protection kills PDO/ODBC queries) patch by: michael at orlitzky dot com 2013-12-23 12:17:15 +01:00
Anatol Belski f4a96983e1 Merge branch 'PHP-5.6'
* PHP-5.6:
  removed outdated IsDebuggerPresent declaration
2013-12-23 12:01:26 +01:00
Dmitry Stogov 62fa84a031 Merge branch 'PHP-5.6'
* PHP-5.6:
  Added suggestion about opcache.revalidate_freq setting in development environment
2013-12-23 13:11:22 +04:00
Dmitry Stogov 5bc9e006e8 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed Issue #140: "opcache.enable_file_override" doesn't respect "opcache.revalidate_freq"
  fix news
  opcodes
  opcodes

Conflicts:
	NEWS
2013-12-23 12:52:27 +04:00
Sara Golemon 6a2a2b52f9 Bump ZEND_MODULE_API_NO due to the TSRMLS change to zend_is_true() 2013-12-22 14:10:59 -08:00
krakjoe befdd1770a fix news 2013-12-22 14:34:29 +00:00
krakjoe 523a6b50ae fix news file 2013-12-22 13:27:38 +00:00
krakjoe 8ce521a6a7 missing, apparently 2013-12-22 13:19:35 +00:00
krakjoe 621862a192 Merge branch 'PHP-5.6'
* PHP-5.6:
  stop warnings from unused opcode map
  - BFN

Conflicts:
	NEWS
	Zend/zend_vm_opcodes.h
2013-12-22 13:15:40 +00:00
Felipe Pena e700cbff22 Merge branch 'PHP-5.6'
* PHP-5.6:
  - Fixed bug #66311 (Stack smashing protection kills PDO/ODBC queries) patch by: michael at orlitzky dot com
2013-12-22 09:43:29 -02:00
Anatol Belski 85251eccaf Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-22 11:57:14 +01:00
Anatol Belski e11fbd979f next wave of revamp in Zend 2013-12-22 11:54:30 +01:00
Bob Weinand 2bf271bbb0 Merge branch 'PHP-5.6' 2013-12-22 01:08:47 +01:00
Bob Weinand 5b1f6caaf0 Merge branch 'PHP-5.6' 2013-12-22 00:57:31 +01:00
Anatol Belski 94fcc9e8c7 Merge branch 'master' into str_size_and_int64 2013-12-21 21:49:03 +01:00
Bob Weinand 0cc89be244 Merge branch 'PHP-5.6' 2013-12-21 21:33:15 +01:00
Anatol Belski b77d6bb2b4 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-21 20:46:42 +01:00
Bob Weinand e2b75e5bb7 Merge branch 'PHP-5.6' 2013-12-21 19:32:41 +01:00
Christopher Jones 1b1b706818 Merge branch 'PHP-5.6'
* PHP-5.6:
  Align 'configure --help' columns
  Added NEWS and UPGRADING info for phpdbg
2013-12-20 10:05:52 -08:00
Anatol Belski 3f2f1b2661 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-20 14:47:15 +01:00
Bob Weinand 3926362d30 Merge branch 'master' of https://git.php.net/push/php-src 2013-12-20 14:36:28 +01:00
Bob Weinand f500be8838 Merge branch 'PHP-5.6' 2013-12-20 14:35:40 +01:00
Anatol Belski b0a551ee14 final remove of the temporary int64/strlen configure options 2013-12-20 09:06:31 +01:00
Anatol Belski f2fc935502 next wave on semantical replacements long vs. int 2013-12-19 23:32:58 -08:00
Anatol Belski 98e273bb03 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	ext/zip/php_zip.c
2013-12-19 22:18:18 +01:00
Boris Lytochkin ba51a375ae Merge branch '5.6'
* 5.6:
  Fixed SNMP_ERR_TOOBIG handling for bulk walk operations. (Boris Lytochkin)
2013-12-20 00:47:26 +04:00
Derick Rethans db025b3789 Merge branch 'PHP-5.6' 2013-12-19 19:01:08 +00:00
Derick Rethans e1a5edaac2 Merge branch 'PHP-5.5' 2013-12-19 18:58:48 +00:00
Anatol Belski 88456894b9 Merge branch 'str_size_and_int64' of https://git.php.net/push/php-src into str_size_and_int64 2013-12-19 08:44:56 -08:00
Anatol Belski 6125278290 more semantical replacements LONG vs. INT 2013-12-19 08:40:41 -08:00
Anatol Belski 6b8a78eb5f added comment 2013-12-19 14:28:00 +01:00
Anatol Belski f58d0b35ed massive update semantical LONG vs INT replacements 2013-12-19 05:07:37 -08:00
Remi Collet e75b967610 Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  save a few memory
  Fixed Bug #66321 (ZipArchive::open() ze_obj->filename_len not real)
2013-12-19 10:56:25 +01:00
Michael Wallner 551569262b Merge branch 'PHP-5.6'
* PHP-5.6:
  Update NEWS handling section of README.GIT-RULES
2013-12-19 10:10:09 +01:00
krakjoe ce4ba54583 test commit 2013-12-19 10:08:51 +01:00
Anatol Belski 5d263adf4c fixed duplicated include 2013-12-19 08:48:27 +01:00
Anatol Belski a16217d4a4 added file header 2013-12-19 08:43:11 +01:00
Anatol Belski a981798d8e add missing header 2013-12-18 15:31:06 -08:00
Anatol Belski cfb76d53f7 correct fix for ext/opcache regarding zend_size_t replacements 2013-12-18 15:29:04 -08:00
Anatol Belski e9224fc81b reverted the previous wrong patch 2013-12-18 15:28:23 -08:00
Anatol Belski 5f3e76dfe5 fixes ext/opcache after too much replacement 2013-12-18 15:21:34 -08:00
Anatol Belski ba5a1995bb Merge branch 'str_size_and_int64' of https://git.php.net/push/php-src into str_size_and_int64 2013-12-18 15:08:07 -08:00
Anatol Belski af362b20c6 zend_size_t for *.cpp files as well 2013-12-18 15:07:30 -08:00
Anatol Belski f62aa10f3e Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-12-19 00:03:49 +01:00
Anatol Belski 942f91ff0f fix zend_size_t type def 2013-12-19 00:03:12 +01:00
Anatol Belski 8709cc6d60 size_t part for *.l files 2013-12-18 14:56:40 -08:00
Anatol Belski 0b8f946ea5 size_t part for *.y files 2013-12-18 14:53:48 -08:00
Anatol Belski d5daea505f size_t part for win32/ 2013-12-18 14:50:32 -08:00
Anatol Belski b1abe4ca21 mass replacement for zend_size_t/php_size_t 2013-12-18 14:46:44 -08:00
Anatol Belski 6d938321ff prepare for zend_size_t 2013-12-18 14:22:47 -08:00
Anatol Belski df7db6519c Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-18 17:07:00 +01:00
Bob Weinand b11b3d201f Fixed ZTS build. Needed to bump API version number. 2013-12-18 16:44:20 +01:00
Dmitry Stogov 26096aa73f Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed reavlidate_path=1 behavior to avoid caching of symlinks values.
2013-12-18 19:22:05 +04:00
Anatol Belski 74aea4e471 fix after merge 2013-12-18 15:18:02 +01:00
Anatol Belski 8432557dcd Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	Zend/zend.c
	Zend/zend.h
	Zend/zend_execute.h
	Zend/zend_vm_execute.h
	main/SAPI.h
2013-12-18 15:07:42 +01:00
Felipe Pena a8a36b7d52 - Fixed build 2013-12-18 08:28:44 -02:00
Anatol Belski fcb28ea97f automated platform dependent zend_int_t declarations 2013-12-18 10:52:14 +01:00
Kalle Sommer Nielsen aed4b086ac Eliminate the TSRMLS_FETCH() calls in the ticks functions and hook 2013-12-18 09:32:26 +01:00
Kalle Sommer Nielsen c83598119b Kill a TSRMLS_FETCH() in php_stream_context_set() by passing TSRMLS_CC to it
# For mysqlnd: Relevant PHP_API_VERSION are put in place for cross version compatibility
2013-12-18 09:19:24 +01:00
Kalle Sommer Nielsen d02340bb39 Kill a TSRMLS_FETCH() call in sapi/caudium 2013-12-18 09:11:15 +01:00
Kalle Sommer Nielsen f883d3cc7a We might as well re-use the TSRMLS parameters here as they are available in PHP_FUNCTION anyway to save a TSRMLS_FETCH() call 2013-12-18 09:10:45 +01:00
Kalle Sommer Nielsen ed5a8d510f Pass the TSRMLS parameters to the sapi flush hook, this shaves off a few TSRMLS_FETCH() calls in our various SAPIs 2013-12-18 09:06:39 +01:00
Kalle Sommer Nielsen f70f89c1b1 Kill another TSRMLS_FECH() in sapi/roxen 2013-12-18 09:05:01 +01:00
Kalle Sommer Nielsen 520d969fea Fix these SAPI hooks so that the TSRMLS parameters are correctly passed as required by the sapi struct
# Not sure if this builds either
2013-12-18 09:01:44 +01:00
Kalle Sommer Nielsen 432e91f112 Bump year
# Wonder if this is even working anymore
2013-12-18 08:55:19 +01:00
Kalle Sommer Nielsen e6b471933c Kill yet another TSRMLS_FETCH() inside the CLI HTTP server 2013-12-18 08:17:49 +01:00
Kalle Sommer Nielsen bd58146ad6 Kill another TSRMLS_FETCH() in the zend extension loading code 2013-12-18 07:59:47 +01:00
Kalle Sommer Nielsen 2eb9bd316d Merge branch 'master' of https://git.php.net/push/php-src 2013-12-18 07:27:14 +01: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
Anatol Belski 9576330979 updated libmagic.patch 2013-12-17 13:30:17 -08:00
Anatol Belski 4cdcbeec76 basic fixes to ext/interbase 2013-12-17 11:17:12 +01:00
Anatol Belski 8aa7f84dd2 basic fixes to ext/sybase_ct 2013-12-17 10:58:13 +01:00
Anatol Belski 83edc59d13 fix datatype to hold read bytes 2013-12-17 10:20:34 +01:00
Anatol Belski dc45cfe401 fix function signature 2013-12-17 10:17:14 +01:00
Anatol Belski b90cc170b6 revamp ext/pdo_firebird 2013-12-17 10:14:55 +01:00
Anatol Belski 1337ba8a62 fixed conflicting function signatures in ext/com_dotnet 2013-12-17 10:06:11 +01:00
Anatol Belski 170c4d1fe6 Z_STRLEN vs Z_STRSIZE 2013-12-17 09:26:07 +01:00
Anatol Belski 167fdaa0e7 regenerated zend_vm_execute.h after merge 2013-12-17 09:05:29 +01:00
Anatol Belski 3e90132341 Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	Zend/zend_compile.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/opcache/Optimizer/pass1_5.c
	ext/pdo_odbc/odbc_stmt.c
2013-12-17 09:01:11 +01:00
Anatol Belski c0f1e6946d Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed possibly uninitialized value usage
2013-12-17 08:45:49 +01:00
Xinchen Hui 72389dd53f Merge branch 'PHP-5.6' 2013-12-17 15:37:26 +08:00
Xinchen Hui a9c503bc27 Merge branch 'PHP-5.6' 2013-12-17 15:10:56 +08:00
Xinchen Hui ac719610f4 Merge branch 'PHP-5.6' 2013-12-17 15:06:36 +08:00
Stanislav Malyshev 5613d70ee8 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #65873 - Integer overflow in exif_read_data()
2013-12-16 11:38:00 -08:00
David Soria Parra d7d0ceb90d Merge branch 'PHP-5.6' 2013-12-16 10:28:11 -08:00
Anatol Belski a56274b3f1 Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-12-16 17:31:13 +01:00
Anatol Belski 68d3353e5c basic fixes to ext/mssql 2013-12-16 17:26:32 +01:00
Anatol Belski 409498f03c fixed conflicting types in func definition 2013-12-16 08:13:35 -08:00
Anatol Belski d51ff1322d revamp ext/opcache 2013-12-16 12:56:32 +01:00
Dmitry Stogov 82d67af60d Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fix tests expecting specific resource IDs
  fixed parameter order for zend_throw_exception_ex call
  Fix doc (svn -> git)
  Fix tests expecting specific resource IDs
  Test pushing
  Updated release process
2013-12-16 13:12:55 +04:00
Anatol Belski ca25f3d829 revamp ext/phar 2013-12-15 13:58:39 +01:00
Anatol Belski 34848ccae7 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-15 12:08:39 +01:00
Xinchen Hui 48dcc43488 Merge branch 'PHP-5.6' 2013-12-15 16:51:43 +08:00
Xinchen Hui 304d97933f Merge branch 'issue-phpt-resourceid-wincache' of https://github.com/EricSten/php-src 2013-12-15 16:26:11 +08:00
Anatol Belski 897d11658a fixed parameter order for zend_throw_exception_ex call 2013-12-14 20:55:32 +01:00
DQNEO 964141f781 Fix doc (svn -> git) 2013-12-14 20:55:31 +01:00
Anatol Belski fc4761a07c Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed parameter order for zend_throw_exception_ex call
  Fix doc (svn -> git)
  Test pushing
2013-12-14 20:48:44 +01:00
Anatol Belski 2cfb1c5bb9 basic fixes to ext/pdo_oci 2013-12-14 11:49:42 +01:00
Anatol Belski e0c5db0970 basic fixes to ext/oci8 2013-12-14 11:39:47 +01:00
Anatol Belski 4c68e81018 fixed sapi/embed 2013-12-14 00:26:56 +01:00
Anatol Belski 009528ba43 revamp sapi/cgi 2013-12-13 22:24:23 +01:00
Anatol Belski 7266938012 use php_socket_t where possible in ext/cli 2013-12-13 22:16:12 +01:00
Eric Stenson 50377b5bf2 Fix tests expecting specific resource IDs
When Wincache or APC are installed, the resource IDs are not the same.
This is because Wincache takes a few resource objects for itself.  As a
result, these tests become false positives.

On Windows boxes, the microtime precision is not granular enough
to reliably register a difference if two calls to uniqid() are made
concurrently.  This is a fix to the uniqid() test to avoid the false
positive when run on Windows machines.  Also, added a test to exercise
the 'more_entropy' variant of uniqid().
2013-12-13 10:42:32 -08:00
Anatol Belski 389188df7f Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-13 17:54:17 +01:00
Anatol Belski 3c494e25e3 Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-12-13 17:49:16 +01:00
Anatol Belski f4d27d83ac basic fixes to ext/imap 2013-12-13 17:47:23 +01:00
Anatol Belski bb5f5e1671 fix function signature 2013-12-13 07:19:16 -08:00
Anatol Belski 4973f3a312 fixed ext/pdo_dblib 2013-12-13 07:19:16 -08:00
Anatol Belski 37594963b3 Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-12-13 15:36:36 +01:00
Anatol Belski 4651c74405 fixed ext/skeleton 2013-12-13 15:35:37 +01:00
Anatol Belski d2ed9b3d30 fixed ext/sysvsem and ext/sysvshm 2013-12-13 06:32:08 -08:00
Anatol Belski 79c06bb896 fixed ext/sysvmsg 2013-12-13 06:15:47 -08:00
Anatol Belski e64e7e6ffc fixed ext/recode 2013-12-13 06:02:59 -08:00
Anatol Belski 872734be58 fix datatype 2013-12-13 05:58:12 -08:00
Anatol Belski 1040cdf8fc fixed ext/readline 2013-12-13 05:51:49 -08:00
Julien Pauli 735f930bac Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated release process
2013-12-13 13:30:30 +01:00
Anatol Belski 985d8f0436 Merge branch 'str_size_and_int64' of https://git.php.net/push/php-src into str_size_and_int64 2013-12-13 04:10:45 -08:00
Anatol Belski 512cbad00c basic fixes to ext/pspell 2013-12-13 04:10:17 -08:00
Anatol Belski 316fd8aab6 Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-12-13 12:28:18 +01:00
Anatol Belski 931071aa97 fixed function signature 2013-12-13 12:27:58 +01:00
Anatol Belski d87dc25b71 fixed ext/pcntl 2013-12-13 03:26:29 -08:00
Anatol Belski 3a8ee7800c fixed ext/posix 2013-12-13 03:26:04 -08:00
Anatol Belski 73a7351a2c fixed ext/dba 2013-12-13 02:55:38 -08:00
Anatol Belski 936124742b fixed function signature 2013-12-13 11:09:30 +01:00
Anatol Belski 1007374254 Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-12-13 11:03:14 +01:00
Anatol Belski f806f4d060 Merge branch 'master' into str_size_and_int64 2013-12-13 10:45:27 +01:00
Dmitry Stogov 9b829c92b5 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Use zend_error_noreturn here
  OCI8 build change: Fix source variable definition for C89 compatibility
  Kill another TSRMLS_FETCH() in zend_indent()
  Eliminate another straight forward TSRMLS_FETCH() in zend_startup_module()
  Fix build
  Add Tests for #65784 in 5.5
  Disallowed JMP into a finally block.
  Update NEWS for 5.5.7 release
  Fixed bug #65784 (Segfault with finally).
2013-12-13 11:15:38 +04:00
Xinchen Hui 914de05bf5 Merge branch 'PHP-5.6' 2013-12-13 11:37:53 +08:00
Christopher Jones e92ea13bff Merge branch 'PHP-5.6'
* PHP-5.6:
  OCI8 build change: Fix source variable definition for C89 compatibility
2013-12-12 15:23:23 -08:00
Kalle Sommer Nielsen 1433dec2d0 Kill another TSRMLS_FETCH() in zend_indent() 2013-12-12 22:09:38 +01:00
Kalle Sommer Nielsen 0fc8e6af0a Eliminate another straight forward TSRMLS_FETCH() in zend_startup_module()
# For THTTPD:
# The code that uses a call to this function is for older versions of PHP anyway so its not covered

# For Zend OpCache:
# Added a new define for 5.6 and wrapped the code around that so its still compatible with older version
2013-12-12 20:30:45 +01:00
Kalle Sommer Nielsen 4411641b1e Fix build 2013-12-12 20:25:10 +01:00
Xinchen Hui 8708b13d62 Merge remote-tracking branch 'origin/PHP-5.6' 2013-12-13 01:50:22 +08:00
Xinchen Hui 6a299514f8 Merge branch 'PHP-5.6'
Conflicts:
	NEWS
2013-12-13 00:54:36 +08:00
Xinchen Hui 0fbb421ec1 Merge branch 'PHP-5.6' 2013-12-13 00:15:11 +08:00
Dmitry Stogov fd4a7388d7 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  fix test
2013-12-12 16:46:15 +04:00
Michael Wallner c0e87e9bb1 Merge branch 'PHP-5.5'
* PHP-5.5:
  fix test
2013-12-12 12:10:08 +01:00
Anatol Belski bdc565e67a revamp ext/dom 2013-12-12 11:50:45 +01:00
Dmitry Stogov 9d08f09e06 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  remove always_populate_raw_post_data INI entries from master, UPGRADING.INTERNALS coming shortly
2013-12-12 14:42:19 +04:00
Michael Wallner bc1c2b3b31 remove always_populate_raw_post_data INI entries from master, UPGRADING.INTERNALS coming shortly 2013-12-12 11:33:06 +01:00
Dmitry Stogov a23bcba875 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fixed bug #65486 mysqli_poll() is broken on Win x64
2013-12-12 13:59:37 +04:00
Dmitry Stogov 8738e6d86f Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed tests
  Fixed ext/soap/tests/bugs/bug54911.phpt
2013-12-12 13:55:42 +04:00
Anatol Belski e0c7899ddd Merge branch 'master' into str_size_and_int64 2013-12-12 10:52:52 +01:00
Anatol Belski 58b754ca4a Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #65486 mysqli_poll() is broken on Win x64
2013-12-12 10:46:36 +01:00
Anatol Belski fa2a2c88fd revamp ext/pdo_mysql 2013-12-11 23:39:43 +01:00
Anatol Belski 6d5c56367d revamp ext/pdo 2013-12-11 23:39:18 +01:00
Anatol Belski a1803faea2 revamp ext/pgsql 2013-12-11 20:04:04 +01:00
Anatol Belski adb70b9923 Merge branch 'master' into str_size_and_int64 2013-12-11 19:29:21 +01:00
Anatol Belski 05fe153f49 revamp ext/soap 2013-12-11 19:23:17 +01:00
Bob Weinand 98d929290c Merge branch 'PHP-5.6'
* PHP-5.6:
  Added one more test for constant scalar expressions
2013-12-11 19:20:10 +01:00
Anatol Belski fa1802381f Merge branch 'PHP-5.6'
* PHP-5.6:
  added missing prototype
2013-12-11 14:16:22 +01:00
Anatol Belski 2301e190e7 Merge branch 'master' into str_size_and_int64 2013-12-11 13:48:38 +01:00
Anatol Belski 2f707bf246 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix dir separator in cve-2013-6420 test
2013-12-11 13:33:59 +01:00
Anatol Belski d3f9debcae Merge branch 'master' into str_size_and_int64 2013-12-11 12:44:05 +01:00
Anatol Belski 4670d46a42 additional range checks for ext/sockets 2013-12-11 12:41:12 +01:00
Ard Biesheuvel 9a5944d960 Merge branch 'PHP-5.6' 2013-12-11 08:51:27 +01:00
Stanislav Malyshev 35b8f57906 Merge branch 'PHP-5.6'
* PHP-5.6:
  5.3.29-dev
  Fix CVE-2013-6420 - memory corruption in openssl_x509_parse
2013-12-10 11:36:33 -08:00
Anatol Belski 19161b8d4e fix function params 2013-12-10 20:00:59 +01:00
Anatol Belski 27990438f1 Merge branch 'master' into str_size_and_int64
Conflicts:
	Zend/zend_builtin_functions.c
	ext/opcache/Optimizer/pass1_5.c
	ext/reflection/php_reflection.c
	ext/soap/soap.c
2013-12-10 19:46:40 +01:00
Remi Collet 8e29235b6c Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  Fixed Bug #66218 zend_register_functions breaks reflection
2013-12-10 16:10:48 +01:00
Anatol Belski 34e5236836 more range checks for ext/sqlite3 2013-12-10 15:40:19 +01:00
Dmitry Stogov ad4f0c7812 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66112 (Use after free condition in SOAP extension). (martin dot koegler at brz dot gv dot at)
2013-12-10 17:59:20 +04:00
Anatol Belski 77d4db3957 fixed return 2013-12-10 14:15:29 +01:00
Dmitry Stogov d439b3970a Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66251 (Constants get statically bound at compile time when Optimized)
2013-12-10 17:05:23 +04:00
Anatol Belski a697297f5f more range checks for ext/tidy 2013-12-10 13:41:49 +01:00
Dmitry Stogov 90c5689b59 Merge branch 'PHP-5.6'
* PHP-5.6:
  Revered func_get_args() changes, because they were not completly transparent and broke some tricky PHP code that worked because of luck before php-5.5.6 (see Bug #66107). The changes are going to be kept in PHP-5.6.
2013-12-10 16:08:56 +04:00
Dmitry Stogov 6eaf57eb3c Merge branch 'PHP-5.6'
* PHP-5.6:
2013-12-10 16:07:53 +04:00
Dmitry Stogov 1dafdaa31b Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Zend: fix overflow handling bug in non-x86 fast_add_function()
2013-12-10 15:15:46 +04:00
Dmitry Stogov 78265a44c5 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed memory leaks introdused by: 	commit 611da37617 	Author: Igor Wiedler <igor@wiedler.ch> 	Date:   Sat Nov 9 13:48:23 2013 -0500
2013-12-10 15:15:11 +04:00
Ard Biesheuvel c786c30108 Merge branch 'PHP-5.6' 2013-12-10 12:12:44 +01:00
Anatol Belski 5acc0c0c5b revamp ext/xmlreader 2013-12-10 11:42:56 +01:00
Dmitry Stogov b260cb92e4 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66252 (Problems in AST evaluation invalidating valid parent:: reference. Constant expessions have to be evaluated in context of defining class).
2013-12-10 14:21:38 +04:00
Anatol Belski da62a38244 revamp ext/xsl 2013-12-10 10:15:47 +01:00
Dmitry Stogov 6b6a4e466a Merge branch 'PHP-5.6'
* PHP-5.6:
  Arguments passed to user function have to be properly allocated on heap
2013-12-10 13:03:24 +04:00
Anatol Belski f195339006 revamp range checks in ext/xml 2013-12-10 09:34:45 +01:00
Ard Biesheuvel 21fd125343 Merge branch 'PHP-5.6' 2013-12-09 17:04:05 +01:00
Anatol Belski f7f8c590a5 Merge remote-tracking branch 'bukka/str_size_and_int64_openssl' into str_size_and_int64 2013-12-09 11:30:07 +01:00
Anatol Belski 757c93dd85 Z_STRLEN vs Z_STRSIZE after automerge 2013-12-09 11:18:40 +01:00
Anatol Belski 325224832b Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
	Zend/zend_compile.c
	Zend/zend_compile.h
2013-12-09 10:20:04 +01:00
Stanislav Malyshev 912be12432 Merge branch 'PHP-5.6'
* PHP-5.6:
  Replace invalid code with a proper #error
2013-12-08 16:26:34 -08:00
Jakub Zelenka d3acd878d0 Merge branch 'str_size_and_int64' into str_size_and_int64_openssl 2013-12-08 16:21:40 +00:00
Jakub Zelenka f9816d6729 Remove explicit casts to and from 64bit types 2013-12-08 16:17:55 +00:00
Adam Harvey b97156113e Merge branch 'PHP-5.6'
* PHP-5.6:
  Switch to using freetype-config for freetype detection.
2013-12-07 19:42:00 -08:00
Anatol Belski 31a4d08d37 fix repeated compiler warnings 2013-12-07 08:57:02 +01:00
Anatol Belski 20217b04b4 added macros for integer constants to append appropriate suffix 2013-12-07 08:55:31 +01:00
Anatol Belski 3982b3eccf recap fixes for ext/standard 2013-12-07 00:53:14 +01:00
Anatol Belski 0494cf46cf fixes to rand 2013-12-06 22:12:28 +01:00
Anatol Belski 8b7a8aff13 Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-12-06 11:43:45 +01:00
Anatol Belski 9510451fb1 remaining fixes to ext/zlib
datatypes for globals
%pd format
2013-12-06 11:42:30 +01:00
Ferenc Kovacs e3ebe995c9 Merge branch 'PHP-5.6' 2013-12-06 11:07:36 +01:00
Michael Wallner d81d61fcc4 Merge branch 'PHP-5.6'
* PHP-5.6:
  BFN
2013-12-06 10:39:18 +01:00
Michael Wallner 01a13bb8c1 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #61645 (fopen and O_NONBLOCK)
  fix possibly uninitialized value
  Use 'user@example.com' rather than 'user@company.com' in tests
2013-12-06 10:34:11 +01:00
Anatol Belski 7fdf6b51d2 Merge branch 'master' into str_size_and_int64 2013-12-06 09:55:50 +01:00
Anatol Belski c253fbda9a fix conflicting types 2013-12-05 16:13:30 -08:00
Anatol Belski adb1e38468 integrated %pd into more ported extensions 2013-12-05 14:35:06 +01:00
Anatol Belski e881537089 integrated %pd into ext/spl 2013-12-05 13:28:22 +01:00
Anatol Belski 122805100a removed warnings in newly implemented pcre range cehcks 2013-12-05 12:38:11 +01:00
Anatol Belski 4d703a4225 added range check for pcre ini entries 2013-12-05 12:08:19 +01:00
Anatol Belski a0622d7c68 implemented %pd format for snprintf and spprintf
php_int_t var = 42;
php_printf("%pd", var);
2013-12-05 12:05:46 +01:00
Anatol Belski 42b1222754 Merge branch 'master' into str_size_and_int64 2013-12-05 08:37:37 +01:00
Adam Harvey de3b9bc77c Renumber the comments in php_request_shutdown() to be in order.
What, me OCD?
2013-12-04 14:29:45 -08:00
Jakub Zelenka fbfae33e39 Add missing overflow checks 2013-12-04 19:01:39 +00:00
Andrey Hristov 0cb38a3d26 Merge branch 'master' of git.php.net:php-src
Conflicts:
	NEWS
2013-12-04 18:32:32 +02:00
Sara Golemon 9adfcea241 Use 'user@example.com' rather than 'user@company.com' in tests
Using some arbitrary 3rd party's domain name is clowny,
even if it never tries to send.
2013-12-04 07:51:43 -08:00
Michael Wallner ecf95a4cc5 BFN 2013-12-05 11:30:52 +01:00
Michael Wallner 44ff944b37 Merge branch 'dba'
* dba:
  fix bug #62490
  more test fixes
  fix test
  fix php_stream_copy_to_stream_ex usage
  add missing clean section
  remove test for already removed feature
2013-12-05 11:27:26 +01:00
Michael Wallner 5a420c8680 fix bug #62490
inifiles delete handler did not return false if the key was not found
2013-12-05 11:04:25 +01:00
Andrey Hristov 406d5a5ecc Merge branch 'PHP-5.6'
Conflicts:
	NEWS
	UPGRADING
2013-12-04 16:20:03 +02:00
Anatol Belski 7228ac190a fixed ext/bcmath 2013-12-04 15:06:32 +01:00
Anatol Belski 3142989a14 finer fixes for ext/opcache 2013-12-04 14:07:27 +01:00
Anatol Belski 3930766e79 basic fixes to ext/opcache 2013-12-04 12:04:07 +01:00
Anatol Belski 55023a87b0 Merge branch 'master' into str_size_and_int64 2013-12-04 09:10:43 +01:00
Sara Golemon e51ddf9dc8 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix php_module_startup() when loading more than one additional module
2013-12-03 18:21:40 -08:00
Adam Harvey 8f11f7f179 Merge branch 'PHP-5.6'
* PHP-5.6:
  Remove 128.0.0.0/16 and 191.255.0.0/16 from the reserved list.
2013-12-03 14:54:24 -08:00
Anatol Belski 72e7a63485 basic fixes for ext/ldap 2013-12-03 22:43:37 +01:00
Anatol Belski c14d14e0d6 fix uninitialized variable 2013-12-03 22:03:11 +01:00
Anatol Belski fbb87ace85 basic fixes to ext/snmp 2013-12-03 21:31:55 +01:00
Anatol Belski fd6e5766ce basic fixes for ext/pdo_pgsql 2013-12-03 18:21:06 +01:00
Michael Wallner f0c85fab45 more test fixes 2013-12-03 18:18:40 +01:00
Michael Wallner b0415856fd fix test 2013-12-03 17:55:26 +01:00
Michael Wallner 9e309a2d10 fix php_stream_copy_to_stream_ex usage 2013-12-03 17:55:18 +01:00
Michael Wallner a7f0465c0b add missing clean section 2013-12-03 17:07:40 +01:00
Michael Wallner f4912e3a96 remove test for already removed feature 2013-12-03 16:57:35 +01:00
Anatol Belski 8e11fa2251 basic fixes to ext/odbc 2013-12-03 16:54:15 +01:00
Anatol Belski 727d14b8dd basic fixes to ext/ftp 2013-12-03 12:09:12 +01:00
Anatol Belski b13e715581 basic fixes to ext/pdo_mysql 2013-12-03 11:44:18 +01:00
Anatol Belski 0ee45382cd basic fixes to ext/pdo_firebird 2013-12-03 11:18:12 +01:00
Anatol Belski 71be6bc5ec more fixes to ext/pdo and ext/pdo_pgsql 2013-12-03 10:52:55 +01:00
Sebastian Bergmann d1baf6c9d7 Leftover: Bump version to 5.7.0 2013-12-03 10:19:11 +01:00
Nikita Popov b3265e2108 Support gmp_remroot() on GMP 4.1 2013-12-03 10:19:10 +01:00
Anatol Belski e23b051be0 basic fixes to ext/pdo_pgsql 2013-12-03 09:53:22 +01:00
Anatol Belski 7193efebed basic fixes to ext/pdo_sqlite 2013-12-03 09:51:01 +01:00
Anatol Belski da7d62ea8a basic fixes for ext/pdo 2013-12-03 09:24:45 +01:00
Sebastian Bergmann 48cc47d55a Leftover: Bump version to 5.7.0 2013-12-03 07:42:37 +01:00
Anatol Belski 2fc14d515e some more fixes to ext/pgsql 2013-12-03 01:33:43 +01:00
Anatol Belski f7df15ea53 basic fixes for ext/pgsql 2013-12-02 21:10:33 +01:00
Jakub Zelenka 8710929b78 Fix typo 2013-12-02 19:54:25 +00:00
Jakub Zelenka 1488acb304 Add digest data_len overflow checks and few other fixes 2013-12-02 19:50:23 +00:00
Nikita Popov a87233f98a Merge branch 'PHP-5.6' 2013-12-02 20:11:34 +01:00
Anatol Belski ce6945eb55 basic fixes to ext/shmop 2013-12-02 18:18:24 +01:00
Anatol Belski a68477f758 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-12-02 17:48:31 +01:00
Michael Wallner c23a1f78b4 Merge branch 'PHP-5.6'
* PHP-5.6:
  BFN
  Fix bug #65196
2013-12-02 17:03:30 +01:00
Michael Wallner 7cd702640d Fix Bug #64776 The XSLT extension is not thread safe. 2013-12-02 15:01:24 +01:00
Michael Wallner df484b0008 Merge branch 'PHP-5.6'
* PHP-5.6:
  BFN
  fix bug #49634x
2013-12-02 12:19:03 +01:00
Dmitry Stogov f8148a3905 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed tests
2013-12-02 12:05:49 +04:00
Dmitry Stogov 86c806a36e Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed ability to build non-specialized GOTO VM
2013-12-02 11:03:57 +04:00
Anatol Belski d7827068e8 fix the length var datatype 2013-12-01 23:17:47 +01:00
Anatol Belski 8f91e77245 Merge branch 'master' into str_size_and_int64 2013-12-01 23:10:01 +01:00
Jakub Zelenka 7e85b12b53 Merge branch 'str_size_and_int64' into str_size_and_int64_openssl
Conflicts:
	ext/openssl/openssl.c
2013-12-01 20:04:58 +00:00
Jakub Zelenka b34ce97417 add some overflow checks and use correct msg formatting in openssl 2013-12-01 19:53:45 +00:00
Nikita Popov 1acee05579 Merge branch 'PHP-5.6' 2013-12-01 13:48:09 +01:00
Anatol Belski 6b9396bd8e Merge branch 'master' into str_size_and_int64
Conflicts:
	ext/date/php_date.c
2013-12-01 12:31:48 +01:00
Anatol Belski 66a42402d9 more fixes for ext/mysql 2013-12-01 12:22:52 +01:00
Anatol Belski ae2103ba40 basic fixes for ext/mysql 2013-12-01 09:45:26 +01:00
Anatol Belski eb922c6c9c more fixes for ext/mysqli 2013-11-30 21:51:21 +01:00
Anatol Belski d76d415f55 fix mysqlnd for bigint 2013-11-30 21:49:41 +01:00
Anatol Belski f3703d86f7 started to fix ext/mysqli 2013-11-30 15:58:57 +01:00
Anatol Belski ef216c21fd started to fix ext/mysqlnd 2013-11-30 14:59:18 +01:00
Felipe Pena cb9000f15e Merge branch 'master' of git.php.net:/php-src 2013-11-30 11:41:23 -02:00
Felipe Pena 52611a2c7e Merge branch 'PHP-5.6'
* PHP-5.6:
  - Fixed bug #65923 (ext/socket assumes AI_V4MAPPED is defined)
2013-11-30 11:41:01 -02:00
Nikita Popov 508738251f Merge branch 'PHP-5.6' 2013-11-30 13:41:22 +01:00
Anatol Belski 004d4630b4 basic fixes to ext/sqlite3 2013-11-30 12:39:09 +01:00
Nikita Popov 2e0a960e97 Merge branch 'PHP-5.6' 2013-11-29 23:59:21 +01:00
Nikita Popov 065c8e77e2 Merge branch 'PHP-5.6' 2013-11-29 23:32:14 +01:00
Anatol Belski 628135641d basic fixes ext/xmlrpc 2013-11-29 23:06:40 +01:00
Anatol Belski 22779fa66b fixed ext/tokenizer 2013-11-29 22:54:58 +01:00
Anatol Belski 9c16a4b96d fixed ext/tidy 2013-11-29 22:48:55 +01:00
Anatol Belski f119cd8f2d basic fixes to ext/sockets 2013-11-29 21:02:36 +01:00
Anatol Belski e094c64b67 finer fixes to ext/soap 2013-11-29 20:26:07 +01:00
Anatol Belski 9a834807bc fixed compilation after merging master 2013-11-29 17:12:35 +01:00
Anatol Belski d8fa7f4990 Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-11-29 17:00:24 +01:00
Anatol Belski 40f9958c08 Merge branch 'master' into str_size_and_int64
Conflicts:
	Zend/zend_hash.c
	ext/gmp/gmp.c
	ext/pcre/php_pcre.c
2013-11-29 17:00:11 +01:00
Anatol Belski 132bd2130d basic fix for ext/soap 2013-11-29 16:55:00 +01:00
Anatol Belski eabdd0e4a5 fixed ext/mcrypt 2013-11-29 16:12:36 +01:00
Anatol Belski 23019318b1 finer fixes for ext/json 2013-11-29 13:00:29 +01:00
Anatol Belski 3ffecac916 basic fixes for ext/json 2013-11-29 11:47:48 +01:00
Anatol Belski e6bf5ffeba fixed ext/gmp 2013-11-29 10:19:40 +01:00
Dmitry Stogov f65e652f9f Merge branch 'PHP-5.6'
* PHP-5.6:
  Added validation of class names in the autoload process
2013-11-29 12:55:38 +04:00
Anatol Belski 9f9e691c28 fixed ext/gettext 2013-11-29 09:47:00 +01:00
Anatol Belski 3659dcd98c further fixes for ext/gd 2013-11-29 09:18:13 +01:00
Anatol Belski 51d78c2533 basic fixes for ext/gd 2013-11-29 08:53:32 +01:00
Nikita Popov 0eb519de66 Merge branch 'PHP-5.6' 2013-11-29 00:10:13 +01:00
Anatol Belski 57db68e03d fixed ext/fileinfo
XXX update libmagic.patch
2013-11-28 23:44:24 +01:00
Dmitry Stogov f92eba241e Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fixed bug #65199 (Wrong Day of Week) and fixed bug #63391 (Incorrect/inconsistent day of week prior to the year 1600)
  Marking those two as XFAIL for now.
  Fixed a few DST changeover issues.
  Move add/sub to timelib.
  Fix backwards transition diffs.
  Split up tests into their different categories.
  Group those tests a bit better, as some of the bd ones wanted a "ST" feature that doesn't exist yet.
  Fixed forward transitions in diffs.
  Always reset those parameters.
  Fixed "Forward Transition" construction of DateTime objects.
2013-11-29 00:59:47 +04:00
Dmitry Stogov 77cdda452d Merge branch 'PHP-5.6'
* PHP-5.6:
  Avoid interned hash key duplication and hash key length recaclulation
2013-11-29 00:59:26 +04:00
Anatol Belski ef54a95b71 fixed ext/wddx 2013-11-28 20:00:27 +01:00
Anatol Belski 262fca3a39 fixed ext/xml 2013-11-28 19:46:08 +01:00
Anatol Belski d9a036cc30 fixed ext/xsl 2013-11-28 19:18:38 +01:00
Anatol Belski 9e5c10e487 fixed ext/zip 2013-11-28 19:02:34 +01:00
Anatol Belski d8fbc23002 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-11-28 17:44:47 +01:00
Anatol Belski 91e6fb75d5 fix after automerge 2013-11-28 17:44:05 +01:00
Derick Rethans 38574614c5 Merge branch 'PHP-5.6' 2013-11-28 16:33:23 +00:00
Anatol Belski 5ced3db971 Merge branch 'master' into str_size_and_int64
Conflicts:
	Zend/zend.h
	Zend/zend_hash.c
	Zend/zend_hash.h
	Zend/zend_language_parser.y
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-11-28 17:27:59 +01:00
Anatol Belski a7862de2db fixed ext/filter 2013-11-28 17:16:25 +01:00
Derick Rethans 0d65cd50dd Merge branch 'master' of git.php.net:php-src 2013-11-28 14:45:56 +00:00
Derick Rethans b6ef87f803 Merge branch 'PHP-5.6' 2013-11-28 14:45:38 +00:00
Dmitry Stogov a1193b23b6 Merge branch 'PHP-5.6'
* PHP-5.6:
  Removed unused "pHashFunction" argument in _zend_hash_init() and family (must be 99% source compatible)
2013-11-28 18:42:57 +04:00
Anatol Belski fd7d31973a basic fixes for ext/exif 2013-11-28 14:36:20 +01:00
Dmitry Stogov 609efa2623 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Updated NEWS for Constant Scalar Exprs RFC
  Moved arrays again to "static_scalar:" & little cleanup
  Renaming
  Constant expressions refactoring
  Removed operations on constant arrays. They make no sense as constants are not allowed to be arrays. And as just properties are allowed to; no problem, we still don't need operations on any constant array.
  Added a few more operators
  Whitespace fix
  converted several switches to ifs and made more opcache friendly
  Fatal error about self referencing constants fixed
  Fixed mem leaks, added tests and ternary operator
  Working commit for constant scalar expressions (with constants). Tests will follow.
2013-11-28 17:03:59 +04:00
Dmitry Stogov 7fa9032d0b Merge branch 'PHP-5.6'
* PHP-5.6:
  Some rare deprecated cases replaced by ZEND_ASSERT() (some extensions might need to be fixed)
  Removed duplicated hash function implementation (100% source compatible)
2013-11-28 17:03:28 +04:00
Anatol Belski 4e2ddbc397 fixed ext/enchant 2013-11-28 13:59:55 +01:00
Bob Weinand be5b98ef0d Merge branch 'PHP-5.6' 2013-11-28 13:53:00 +01:00
Anatol Belski 1e2cc15845 fixed ext/curl 2013-11-28 13:45:09 +01:00
Anatol Belski 46448539b0 fixed ext/ctype 2013-11-28 09:53:00 +01:00
Anatol Belski 3f7522a652 Merge branch 'master' into str_size_and_int64 2013-11-28 09:29:12 +01:00
Anatol Belski de453dbef6 reverted a couple of things in ext/phar for now, but all tests pass now 2013-11-28 09:23:02 +01:00
Dmitry Stogov 98f3c410d9 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fixed bug #53879 (DateTime::createFromFormat() fails to parse cookie expiration date)
2013-11-28 11:46:11 +04:00
Dmitry Stogov fe451e9a72 Merge branch 'PHP-5.6'
* PHP-5.6:
  Don't check argument types for internal functions without type hinting
2013-11-28 11:45:47 +04:00
Anatol Belski d135198559 next portion of fixes for ext/phar 2013-11-27 23:35:42 +01:00
Anatol Belski 2c3cc2e107 fixed the rdev stat array member again for streams 2013-11-27 23:34:27 +01:00
Derick Rethans e7a6d0b163 Merge branch 'PHP-5.6' 2013-11-27 22:01:16 +00:00
Anatol Belski ef52220617 basic fixes for ext/phar 2013-11-27 20:08:34 +01:00
Dmitry Stogov 45d399b96e Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed tests
2013-11-27 21:04:23 +04:00
Dmitry Stogov fca64efd62 Merge branch 'PHP-5.6'
* PHP-5.6:
  Removed deprecated AI_SET_PTR()s
2013-11-27 20:32:21 +04:00
Anatol Belski 0fd48b2f48 final ext/session fixes 2013-11-27 15:33:40 +01:00
Anatol Belski bec270ffc8 fix function definition 2013-11-27 04:58:57 -08:00
Anatol Belski b9c19f5d74 first shot for ext/calendar
At the first glance the extension could be fixed for bigger timestamps,
but that's not the goal right now. One test fail yet on win 64
2013-11-27 13:35:26 +01:00
Dmitry Stogov bc68ab8b57 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  NEWS
  Fixed bug #66060 (Heap buffer over-read in DateInterval)
2013-11-27 14:58:08 +04:00
Dmitry Stogov a3cb536d24 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #65969 (Chain assignment with T_LIST failure)
2013-11-27 14:56:48 +04:00
Remi Collet 42a35c9b8b Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  Fixed bug #66060 (Heap buffer over-read in DateInterval)
2013-11-27 11:16:18 +01:00
Anatol Belski 8115844674 basic fixes to ext/hash 2013-11-27 10:33:08 +01:00
Julien Pauli e9f2de918d Merge branch 'PHP-5.6'
* PHP-5.6:
  5.5.8-dev now
2013-11-27 10:33:05 +01:00
Stanislav Malyshev 3baad45b21 Merge branch 'PHP-5.6'
* PHP-5.6:
2013-11-27 00:19:30 -08:00
Stanislav Malyshev b64ac1faa3 Merge branch 'PHP-5.5'
* PHP-5.5:
  5.4.24-dev now
2013-11-27 00:15:03 -08:00
George Wang 9960ecc5cd update to LSAPI 6.6 2013-11-26 18:53:35 -05:00
Anatol Belski 0336763311 fixed ext/xmlwriter 2013-11-26 22:47:36 +01:00
Anatol Belski def8981190 fixed ext/xmlwriter 2013-11-26 22:36:35 +01:00
Anatol Belski 74f9e6309c fixed ext/dom for int64 branch 2013-11-26 22:25:22 +01:00
Anatol Belski 1d2150ca4f fixed some warning in ext/openssl 2013-11-26 21:36:41 +01:00
Anatol Belski 358fae9347 more param parsing fixes, overseen stuff 2013-11-26 21:13:14 +01:00
Anatol Belski 54797a9b15 fixed intl calendar param parsing 2013-11-26 21:13:13 +01:00
Andrey Hristov dd7c33d0c9 Merge branch 'master' of git.php.net:php-src 2013-11-26 20:10:17 +02:00
Anatol Belski 4c96b94873 Merge branch 'master' into str_size_and_int64 2013-11-26 19:09:31 +01:00
Anatol Belski 943ba2bf07 first x64 fixes for ext/openssl 2013-11-26 19:05:35 +01:00
Dmitry Stogov 0d61202427 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed opcahce_reset() crash when opcache.protect_memory is set
2013-11-26 21:59:19 +04:00
Dmitry Stogov ccd1babbfc Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fixed a wrong test
2013-11-26 21:43:51 +04:00
Dmitry Stogov bbdcbbdba5 Merge branch 'PHP-5.6'
* PHP-5.6:
  Added an optimization of class constants and constant calls to some internal functions
  Added an optimization of class constants and constant calls to some internal functions

Conflicts:
	NEWS
2013-11-26 21:43:19 +04:00
Andrey Hristov 9c036b13f9 Merge branch 'PHP-5.5' 2013-11-26 19:37:43 +02:00
Dmitry Stogov 1d65e8f135 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #66176 (Invalid constant substitution)
  Fixed bug #66176 (Invalid constant substitution)
2013-11-26 21:03:34 +04:00
Julien Pauli 8b83b48e98 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed a wrong test
2013-11-26 17:44:52 +01:00
Anatol Belski e5998bbda2 correct error datatype 2013-11-26 17:36:34 +01:00
Anatol Belski d508a094ae fixed 32 bit unsigned to int64 casts 2013-11-26 17:35:25 +01:00
Dmitry Stogov 34a55790f2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Revert NEWS
  Fixed bug #66176 (Invalid constant substitution)
2013-11-26 17:49:38 +04:00
Anatol Belski f88a3e7fb9 first shot fixing ext/com_dotnet 2013-11-26 12:43:58 +01:00
Anatol Belski e2f2a3fcb5 Merge branch 'master' into str_size_and_int64 2013-11-26 10:59:55 +01:00
Anatol Belski 7e856fb09b fixed ext/bz2 2013-11-26 10:54:36 +01:00
Dmitry Stogov 854c9abcd4 Merge branch 'PHP-5.6'
* PHP-5.6:
  Added test
2013-11-26 12:14:22 +04:00
Dmitry Stogov b3ce714cbf Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #65559 (Opcache: cache not cleared if changes occur while running)
2013-11-26 11:37:05 +04:00
Anatol Belski a45082e78d fixed ext/intl 2013-11-25 21:59:09 +01:00
Andrey Hristov 36a3011613 Merge branch 'PHP-5.5' 2013-11-25 21:33:14 +02:00
Anatol Belski 8e50280163 updated datatypes in apache handler globals 2013-11-25 18:06:09 +01:00
Anatol Belski 0938a6266a fixes so file_get_contents() works again, and some more 2013-11-25 16:21:14 +01:00
Dmitry Stogov 704b24d048 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed compatibility with old PHP versions
  Fixed bug #65915 (Inconsistent results with require return value)
2013-11-25 14:12:11 +04:00
Anatol Belski 923518fab8 fix erroneous paste in 2013-11-25 07:39:37 +01:00
Anatol Belski 5300caade1 Merge remote-tracking branch 'origin/master' into str_size_and_int64 2013-11-25 00:46:03 +01:00
Anatol Belski c6adc039a1 more datatype fixes 2013-11-25 00:44:33 +01:00
Anatol Belski a218f8f3a4 ZEND_INT_FMT and some more for ext/standard 2013-11-25 00:43:05 +01:00
Anatol Belski 3198533e92 ZEND_INT_FMT again 2013-11-24 22:28:58 +01:00
Anatol Belski d8c7d69543 printf int format fixes 2013-11-24 22:10:57 +01:00
Jakub Zelenka 215811e3fd fix openssl (testing required) 2013-11-24 21:03:55 +00:00
Anatol Belski 08bbd2b510 fixed ini and functions in assert.c 2013-11-24 19:56:32 +01:00
Anatol Belski 9cc9a10efd one more walk through in Zend, fixed (or broken) things being overseen 2013-11-24 18:55:26 +01:00
Anatol Belski cbf40edf06 fixed range check 2013-11-24 18:47:03 +01:00
Anatol Belski a73c8812a1 one more walk through in Zend, fixed things being overseen 2013-11-24 16:06:47 +01:00
Anatol Belski 9238345922 started to fix ext/session 2013-11-23 10:06:42 +01:00
Anatol Belski 4a6981433d fixed ini_set for integers 2013-11-23 09:52:33 +01:00
Ingo Walz 880ecd603c Fixed bug 64604 2013-11-23 02:31:23 +01:00
Anatol Belski 639924fa2c first shot to fix session 2013-11-22 15:55:21 +01:00
Anatol Belski db40b1c037 fix return datatype 2013-11-22 12:26:39 +01:00
Anatol Belski 52afd818eb fixed apache2 handler 2013-11-22 11:39:33 +01:00
Anatol Belski 28cb72f480 made zend list to use 64 bit indexes 2013-11-22 08:51:13 +01:00
Anatol Belski 7f0d637de4 Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed test
  export more Zend API
2013-11-21 21:29:51 +01:00
Andrey Hristov e09e45eb86 Merge branch 'PHP-5.5' 2013-11-21 21:30:36 +02:00
Anatol Belski f88c30507c fixed param parsing in mbstring 2013-11-21 18:33:16 +01:00
Anatol Belski 015d179e49 converted simplexml ext 2013-11-21 16:17:10 +01:00
Anatol Belski 607f97cefa fixed libxml 2013-11-21 15:08:39 +01:00
Anatol Belski 51003463ef first shot for php-cgi for size_t and php_int_t 2013-11-21 13:26:56 +01:00
Anatol Belski fb27e16f01 fixed the skipif part 2013-11-21 11:54:35 +01:00
Anatol Belski c63f8bdfba now, as it works correct, fix the test 2013-11-20 17:49:40 +01:00
Anatol Belski 5e3d047a07 removed debugbreak 2013-11-20 17:15:01 +01:00
Anatol Belski 7156c5cb39 datatype fixes for iconv 2013-11-20 17:11:10 +01:00
Anatol Belski 6a60a03859 Merge branch 'master' into str_size_and_int64
Conflicts:
	Zend/zend_operators.h
2013-11-20 10:17:19 +01:00
Anatol Belski 6f2d32fd1f Merge branch 'PHP-5.6'
* PHP-5.6:
  permanently deactivate that place, not on runtime only
2013-11-20 10:12:29 +01:00
Yasuo Ohgaki bccead024d Merge branch 'PHP-5.6'
* PHP-5.6:
  added a test to cover distinction between boolean return value of unserialize function and deserializing serialized boolean
2013-11-20 07:25:45 +09:00
Jeff Welch b2ca20312d Fixed tests that fail with non-default serialize_precision configurations.
See:

 * https://bugs.php.net/bug.php?id=64760
 * 4dc4302
2013-11-20 06:17:57 +09:00
Anatol Belski 726d803375 fixed key length datatype 2013-11-19 14:51:20 +01:00
Anatol Belski e7b54a3aa7 fixed datatypes for some basic globals members 2013-11-19 14:13:23 +01:00
Anatol Belski f7bd3db224 Merge branch 'master' into str_size_and_int64 2013-11-19 13:42:51 +01:00
Anatol Belski aee386bb30 fix range check related to #45877 2013-11-19 13:40:43 +01:00
Remi Collet b41a2755c4 Merge branch 'PHP-5.6'
* PHP-5.6:
  avoid doing a stream_select on a closed stream
2013-11-19 12:43:00 +01:00
Anatol Belski d34f4454f0 fixed zlib param parsing 2013-11-19 10:38:54 +01:00
Andrea Faulds e68792dbb2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated NEWS
  Removed UPGRADING note
  Rewrote test using tcp instead of http:// stream
  Implemented FR #65917 (getallheaders() is not supported by the built-in...)
2013-11-18 21:54:00 +00:00
Anatol Belski 0cac40e879 moved the check to the right place and fixed wording 2013-11-18 17:28:48 +01:00
Anatol Belski c398bdd4a3 runtime checks for various lengths in pcre 2013-11-18 14:03:55 +01:00
kovacs.ferenc a833f7d460 Merge branch 'PHP-5.6' 2013-11-18 12:39:40 +01:00
Anatol Belski 365603916e fixed one more stat() occurrence 2013-11-18 09:39:42 +01:00
Anatol Belski 383ddcde2b Merge branch 'master' into str_size_and_int64 2013-11-18 09:10:22 +01:00
Kalle Sommer Nielsen 9e3551ba1f Eliminated the TSRMLS_FETCH() in zend_set_memory_limit() 2013-11-18 01:36:17 +01:00
krakjoe f046189e34 export more Zend API 2013-11-17 22:39:31 +00:00
Xinchen Hui b93f8e6277 Merge branch 'PHP-5.6' 2013-11-17 17:20:27 +08:00
Xinchen Hui 5a282136a3 Merge branch 'PHP-5.5' 2013-11-17 17:11:20 +08:00
Christopher Jones 3e4e173296 Merge branch 'PHP-5.6'
* PHP-5.6:
  Update NEWS
  This is CLI web server change.  Added some common MIME types to the existing lookup list, pending a more thorough lookup solution, if anyone wants to do that.  Ref http://news.php.net/php.internals/69990
2013-11-15 12:38:18 -08:00
Anatol Belski bfa6d8d87d Merge branch 'str_size_and_int64' of git.php.net:php-src into str_size_and_int64 2013-11-15 11:07:58 +01:00
Anatol Belski ae576a4309 fix zend_off_t when int64 is disabled 2013-11-15 01:44:18 -08:00
Anatol Belski 18e4e5b350 Merge branch 'master' into str_size_and_int64 2013-11-15 10:04:53 +01:00
Remi Collet a37ff1fa4b Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  Fix Bug #65714 	PHP cli forces the tty to cooked mode
2013-11-15 09:53:23 +01:00
Adam Harvey 6cf46f49e3 Merge branch 'PHP-5.6' 2013-11-14 10:53:02 -08:00
Anatol Belski a80567a929 fixed undefined behaviour in array_sum
The exact situation is when passing same pointer twice to
fast_add_function(). This prorably has to be fixed in mainstream too.
2013-11-14 14:59:08 +01:00
Anatol Belski e93c9ae26a fixed serialize/unserialize
- almost correct datatype fixes
2013-11-13 18:37:57 +01:00
Anatol Belski 6b229d541a fixed ext/date for php_int_t usage 2013-11-13 15:22:56 +01:00
Remi Collet b6f76adef4 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix failed test with recent glibc
  5.5.7 now
2013-11-13 13:21:28 +01:00
Anatol Belski bd81a99ab3 Merge branch 'master' into str_size_and_int64 2013-11-13 12:44:00 +01:00
Anatol Belski 15bb12b269 fixed "struct stat" usage in main, cli and ext/standard 2013-11-13 12:39:12 +01:00
Nikita Popov b8525baecf Merge branch 'PHP-5.6' 2013-11-12 22:04:45 +01:00
Anatol Belski 468b2923ca fixed stat usage, yet core only
- defined php_stat_t as replacement for struct stat
- on _WIN64 use _fstat64
2013-11-12 21:10:23 +01:00
Anatol Belski e9c7342a80 Merge branch 'master' into str_size_and_int64 2013-11-12 10:57:47 +01:00
Anatol Belski ef1c2ffaf0 more fixes to spl 2013-11-12 10:56:01 +01:00
Anatol Belski ae1fb8dc4b fixes to spl 2013-11-12 10:22:06 +01:00
Anatol Belski 266a428a59 use appropriate seek() and tell() on _WIN64 2013-11-12 00:41:58 +01:00
Anatol Belski f90fe17424 define platform dependent zend_off_t 2013-11-12 00:24:52 +01:00
Anatol Belski 570b1041e9 fixes to pow() 2013-11-11 14:23:58 +01:00
Anatol Belski 2cbd452cfb fixed parse_url() 2013-11-11 12:49:57 +01:00
Anatol Belski ebc2816318 fixed range() 2013-11-11 11:52:44 +01:00
Anatol Belski c23baba693 fixed array_product() 2013-11-11 09:44:24 +01:00
Anatol Belski 7e20b13d86 fixed array_slice() 2013-11-11 09:40:29 +01:00
Adam Harvey 91cb087727 Merge branch 'PHP-5.6'
* PHP-5.6:
  Update NEWS and remove the unnecessary UPGRADING note.
  UPGRADING and NEWS
  Better test: Check combined leading/trailing
  Fixed whitespace part of bug #64874 ("json_decode handles whitespace and case-sensitivity incorrectly")
2013-11-10 16:16:38 -05:00
Anatol Belski 57ce464a1c fixed *scanf() family 2013-11-10 18:59:07 +01:00
Anatol Belski 094c93b6f8 fixed *printf() family 2013-11-10 18:02:25 +01:00
Anatol Belski b7705365a2 fix explode() 2013-11-10 17:09:51 +01:00
Anatol Belski 3069b384e1 Merge branch 'master' into str_size_and_int64 2013-11-10 15:14:03 +01:00
Anatol Belski c0b112c68d one more fix to pack/unpack 2013-11-10 14:40:00 +01:00
Anatol Belski 7cf68266b3 fixed unpack 2013-11-10 14:02:38 +01:00
Anatol Belski 637e9fc5bb fix 64 bit integer values 2013-11-10 13:58:09 +01:00
Remi Collet fac240b5d1 Merge branch 'PHP-5.6'
* PHP-5.6:
  missing 'config.h' in 5dc37b3
2013-11-10 07:10:48 +01:00
Rasmus Lerdorf 7e01935dc2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix broken test

Conflicts:
	NEWS
2013-11-09 09:49:09 -08:00
Adam Harvey 90d4ae4da8 Make all code paths in json_determine_array_type() return constants.
This is a purely cosmetic change, but the current behaviour of returning
PHP_JSON_OUTPUT_ARRAY and 1 looks weird.
2013-11-09 12:15:37 -05:00
Anatol Belski 36cbe38201 reverted compare funcs and return values, should be int anyway 2013-11-09 13:16:15 +01:00
Anatol Belski ad675f6ac2 Merge branch 'master' into str_size_and_int64
Conflicts:
	main/php_version.h
2013-11-09 11:03:04 +01:00
Anatol Belski 7c5af3884a fix index insert 2013-11-09 10:56:51 +01:00
Anatol Belski c58f9eea11 fix array related compare functions 2013-11-09 10:30:55 +01:00
Anatol Belski c2e228b77d too much for a compare func 2013-11-09 09:18:42 +01:00
Anatol Belski 27a86a4402 fixed 64 bit pass by ref 2013-11-09 02:09:14 +01:00
Anatol Belski 5615326e1f fixed fetching $this 2013-11-08 22:36:30 +01:00
Dmitry Stogov 43cb6ba763 Merge branch 'PHP-5.5'
* PHP-5.5:
  Fixed issue #115 (path issue when using phar). Fixed issue #149 (Phar mount points not working with OPcache enabled).

Conflicts:
	NEWS
2013-11-08 16:37:28 +04:00
Dmitry Stogov 8f097fb466 Merge branch 'PHP-5.6'
* PHP-5.6:
  Added tests for PHAR/OPCahce incompatibilities

Conflicts:
	NEWS
2013-11-08 14:16:40 +04:00
Xinchen Hui 6357cdaecf Merge branch 'PHP-5.5' 2013-11-08 15:33:57 +08:00
Xinchen Hui 4c13992f0d Merge branch 'PHP-5.5' 2013-11-08 15:09:08 +08:00
Rasmus Lerdorf 911ba0293a Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #65946 - pdo_sql_parser.c permanently converts values bound to strings
  bump API versions
2013-11-07 18:10:39 -08:00
Anatol Belski 11d4bcd706 remaining replacements ulong vs zend_uint_t 2013-11-07 19:41:57 +01:00
Anatol Belski df312c5ddf fix macros 2013-11-07 18:24:06 +01:00
Anatol Belski de99f93aa5 fix datatype for hash vars 2013-11-07 17:47:48 +01:00
Rasmus Lerdorf 308edceb51 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src: (304 commits)
  OCI8 build change: Fix source variable definition for C89 compatibility
  bump version, empty NEWS, UPGRADING and UPGRADING.INTERNALS
  bump API versions
  configure output alignment
  Add a couple more test cases to parse_url() tests
  fix missing change from 'tcp_socket' to the more common 'server'
  fix many parallel test issues
  Cleanup temp test file
  Revert "Fixed issue #115 (path issue when using phar)."
  Update LiteSpeed SAPI code to V6.4
  Fixed typo in Makefile.frag
  updated NEWS
  Remove outdate codes, make it clearer, although just a bit..
  Update NEWS
  Fixed Bug #66034 (Segmentation Fault when constructor of PDO statement throws an exception)
  NEWS + UPGRADING
  Sync ext/zip with pecl/zip version 1.3.2 - update libzip to version 1.11.1. We don't use any private symbol anymore - new method ZipArchive::setPassword($password) - add --with-libzip option to build with system libzip
  Fixed coredump due to abnormal implemention of phar
  Fix English here
  limit virtual_cwd_activate() duplicated call to ZTS only
  ...
2013-11-07 07:55:44 -08:00
Anatol Belski 98c6e0d535 first shot for 64 bit array indexes, more broken things to fix 2013-11-07 14:03:36 +01:00
Christopher Jones 0d506131af OCI8 build change: Fix source variable definition for C89 compatibility 2013-11-06 10:37:22 -08:00
Ferenc Kovacs d17b684b91 bump version, empty NEWS, UPGRADING and UPGRADING.INTERNALS 2013-11-06 14:03:24 +01:00
Ferenc Kovacs 117955daf6 bump API versions 2013-11-06 14:03:24 +01:00
Remi Collet 1d93f396bb configure output alignment 2013-11-06 13:38:53 +01:00
Anatol Belski dd360d6336 use max int to out the array index 2013-11-04 19:49:41 +01:00
Anatol Belski 446cfd3e1c fix stream_wrapper_register() 2013-11-04 11:12:10 +01:00
Anatol Belski 48e63da659 fixes to array funcs 2013-11-04 10:45:58 +01:00
Anatol Belski 642a8b870a Fixes mem size format for error msg, fixes also Zend\tests\bug55509.phpt 2013-11-04 09:57:29 +01:00
Anatol Belski e243a26b4c Merge branch 'master' into str_size_and_int64
* master: (30 commits)
  Fixed coredump due to abnormal implemention of phar
  Fix English here
  Fix bug #66008
  Removed unnecessary GC checks
  Add crypt() change in UPGRADING
  Fix bug #65997 by switching to Serializable for GMP
  Fix compile warning in GMP
  Fix ZTS build
  updated libs_versions.txt
  Implemented Change crypt() behavior w/o salt RFC
  Update NEWS
  Update NEWS
  Fixed Bug 64760 var_export() does not use full precision for floating-point numbers
  add bundled libzip LICENSE, as required by BSD License terms
  Avoid copy in func_get_arg()
  - Updated to version 2013.8 (2013h)
  Use zval* instead of zval**
  Increased limit for opcache.max_accelerated_files to 1,000,000. (Chris)
  Improved performance of array_merge() by eliminating useless copying
  Improved performance of func_get_args() by eliminating useless copying
  ...

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-11-04 09:19:52 +01:00
Chris Wright 9ad8e89d4f Allow unlimited line length in fpm config files
Fixes bug #65933
2013-10-28 09:35:01 +00:00
Anatol Belski 1ba7ceee17 fixed hex integer interpretation 2013-10-28 10:27:36 +01:00
Anatol Belski 0c21ecf159 force the multiply macros to use zend_int_t 2013-10-28 10:26:39 +01:00
Anatol Belski 3889019638 Merge branch 'master' into str_size_and_int64
* master:
  fix limitation of upload size == (U)INT_MAX in CGI
  Link to more readmes
  test commit
  - test3
  - test commit 2
  - test commit1
2013-10-28 09:10:55 +01:00
Anatol Belski d5e835737c fixed binary int representation 2013-10-27 16:41:38 +01:00
Anatol Belski 20ff7a2d68 some strtol replacements 2013-10-27 11:05:40 +01:00
Anatol Belski 23390de0e7 fix strlen macros 2013-10-26 11:48:19 -07:00
Anatol Belski 4fc7dc6eae Merge branch 'master' into str_size_and_int64
* master: (79 commits)
  ldap_escape() notes
  Increment version number, since this will be 5.5.6.
  Added Zend Debugger to the note about the load order (by trash4you at online dot de)
  Added a LICENSE file to make it easier for PECL binary distributions to conform with the license.
  Fix Coverity issue reporting wrong sizeof()
  Fixed bug #65939 (Space before ";" breaks php.ini parsing). (brainstorm at nopcode dot org)
  exif NEWS
  add tests for bug #62523
  Merged PR #293 (Exif crash on unknown encoding was fixed) By: 	Draal Conflicts: 	configure.in 	main/php_version.h
  fix bug #65936 (dangling context pointer causes crash)
  remove TRAVIS check in test source
  Fixed compilation warning
  Just SKIP that test on travis
  Fixed issue #115 (path issue when using phar).
  fix memory leak on error (from Coverity scan)
  fix argument type & remove warning
  fix const warnings in intl methods
  Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag
  fix possibility of access to *storedType without initialization
  Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag
  ...

Conflicts:
	Zend/zend_compile.c
	ext/intl/collator/collator_create.c
	ext/intl/locale/locale_methods.c
	ext/intl/msgformat/msgformat_format.c
	ext/intl/msgformat/msgformat_parse.c
2013-10-25 04:19:27 -07:00
Anatol Belski f0fdb82f83 bigger memory_limit should work now on 64 bit windows 2013-10-16 10:48:03 -07:00
Anatol Belski 4a5fee1b36 fix broken master merge 2013-10-16 06:10:00 -07:00
Anatol Belski 4b6d784962 Merge branch 'str_size_and_int64' of https://github.com/weltling/php-src into str_size_and_int64
Conflicts:
	NEWS
	UPGRADING
	UPGRADING.INTERNALS
	Zend/zend_API.c
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_constants.h
	Zend/zend_exceptions.c
	Zend/zend_exceptions.h
	Zend/zend_execute.c
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner.l
	Zend/zend_operators.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/date/lib/parse_date.c
	ext/date/php_date.c
	ext/imap/config.m4
	ext/oci8/config.m4
	ext/oci8/oci8.c
	ext/oci8/oci8_dtrace.d
	ext/oci8/oci8_interface.c
	ext/oci8/oci8_lob.c
	ext/oci8/oci8_statement.c
	ext/oci8/package.xml
	ext/oci8/php_oci8.h
	ext/reflection/php_reflection.c
	ext/spl/spl_directory.c
	ext/spl/spl_fixedarray.c
	ext/standard/file.c
	ext/standard/http_fopen_wrapper.c
	ext/standard/info.c
	ext/standard/string.c
	main/php_variables.c
	main/streams/streams.c
2013-10-16 06:02:27 -07:00
Anatol Belski 4e537ca4ca fix broken merge from master 2013-10-16 03:38:14 -07:00
Stanislav Malyshev 941887359b 5.4.21 now 2013-10-16 03:21:55 -07:00
Dmitry Stogov ed36099a0b Fixed bug #65561 (Zend Opcache on Solaris 11 x86 needs ZEND_MM_ALIGNMENT=4). (Terry Ellison) 2013-10-16 03:21:49 -07:00
Anatol Belski 615756c8ab fixed ext/iconv 2013-10-16 03:20:34 -07:00
Joey Smith e6095aa4cb Expose fputcsv's escape_char to userland
Allows users to assert that something other than the backslash
should be considered an escape char; also follows the RFC 4180
recommendation that fields containing a " be enclosed.
2013-10-16 03:18:19 -07:00
Anatol Belski 983db235b0 fixed decrement 2013-10-16 03:14:25 -07:00
Anatol Belski 582f52c173 fixed numeric string comparsion 2013-10-16 03:14:24 -07:00
Anatol Belski c47840d92b some more linux fixes 2013-10-16 03:14:23 -07:00
Anatol Belski 8949c825c7 fixed configure.in 2013-10-16 03:14:22 -07:00
Anatol Belski 68ec5a9b89 ext/intl further fixes 2013-10-16 03:14:22 -07:00
Anatol Belski 866d33e1e9 ext/intl further converting 2013-10-16 03:14:21 -07:00
Anatol Belski 52a74bbdd6 more fixes to ext/intl 2013-10-16 03:14:20 -07:00
Anatol Belski 05593baf9a Z_STRLEN vs Z_STRSIZE in ext/intl 2013-10-16 03:14:20 -07:00
Anatol Belski 457f28c354 adapted args in ext/intl 2013-10-16 03:14:19 -07:00
Anatol Belski 9e4a7835c5 fixed the mb_regex* stuff 2013-10-16 03:14:18 -07:00
Anatol Belski 1f261538e8 fixed sapi filter usage 2013-10-16 03:14:17 -07:00
Anatol Belski 80d8037531 replaced all the arg formats and Z_STRLEN
won't work yet, just initial work to be done
2013-10-16 03:14:17 -07:00
Anatol Belski 659d7ca634 fixed set process_title() 2013-10-16 03:14:16 -07:00
Anatol Belski 84e13901b0 fix pcre usage in spl 2013-10-16 03:14:15 -07:00
Anatol Belski 69ea580aad fixed ext/pcre internal stuff
Now only the flaw is pcrelib itself as it works with int for
string length and offsets. Bigger stuff won't work anyway, but
if there are some issue there are just a few places like pcre_exec()
where we can explicitly cast to int.
2013-10-16 03:14:15 -07:00
Anatol Belski af4924eaea adapted all the function arg formats in ext/zlib 2013-10-16 03:14:13 -07:00
Anatol Belski 1015a29997 some more fixes to zend operators 2013-10-16 03:14:12 -07:00
Anatol Belski 889b8d75fe added ZEND_INT_FMT 2013-10-16 03:14:12 -07:00
Anatol Belski 34818356fc some fixes to constants, var_dump and var_export 2013-10-16 03:14:11 -07:00
Anatol Belski dfec5cf775 first fixes to ext/spl, yet incomplete 2013-10-16 03:12:49 -07:00
Anatol Belski a5cda49fe9 fixes to reflection 2013-10-16 03:10:52 -07:00
Anatol Belski 3b55e60245 fixes to ereg 2013-10-16 03:10:51 -07:00
Anatol Belski 4f6e709a67 more fixes to ext/date 2013-10-16 03:10:50 -07:00
Anatol Belski b24f226e93 replaced arg formats in pcre 2013-10-16 03:10:50 -07:00
Anatol Belski 41e0c7b1f6 fixed sapi.h 2013-10-16 03:10:49 -07:00
Anatol Belski 4ea8803533 replaced all arg formats in ext/standard 2013-10-16 03:10:48 -07:00
Anatol Belski f8923bb076 replaced all the int params in the datetime 2013-10-16 03:09:52 -07:00
Anatol Belski d3f87d0ffc adapted the function args for ereg
And that actually seems to be it, all tests pass so far. So lets
see how it goes in the fture, too easy but seems to be done for now .
2013-10-16 03:09:51 -07:00
Anatol Belski 179d696b35 trivial fix spl_autoload_functions() 2013-10-16 03:09:50 -07:00
Anatol Belski 4be4279c83 final fix for hebrev() 2013-10-16 03:09:50 -07:00
Anatol Belski 832e9653d1 fix build 2013-10-16 03:09:49 -07:00
Anatol Belski 469b9e44fb fixed file_put_contents() 2013-10-16 03:09:48 -07:00
Anatol Belski b7f8723065 fixed fwrite 2013-10-16 03:09:47 -07:00
Anatol Belski a8959d76c8 fixed "s" vs "S" for soundex 2013-10-16 03:09:45 -07:00
Anatol Belski 734f9e58f9 partial fix to hebrev 2013-10-16 03:09:44 -07:00
Anatol Belski 5b6f0092f4 fixed unpack() 2013-10-16 03:09:44 -07:00
Anatol Belski d7d84804e6 fixed str_pad() 2013-10-16 03:09:43 -07:00
Anatol Belski 12951f8bbd lost condition 2013-10-16 03:09:42 -07:00
Anatol Belski 6fc93dfa6c fixed str_split() 2013-10-16 03:09:41 -07:00
Anatol Belski a61c753006 Fixed substr(), but no kidding now.
all the signed/unsigned arithmetic needs clear understanding
2013-10-16 03:09:41 -07:00
Anatol Belski 51ddf600fe small correction to substr 2013-10-16 03:08:26 -07:00
Anatol Belski df0a28baab fixed strstr() 2013-10-16 03:08:26 -07:00
Anatol Belski c9280f1e1c fixed substr() 2013-10-16 03:08:25 -07:00
Anatol Belski f4c91f0aa8 adapted all the zend_parse_parameters() calls 2013-10-16 03:08:24 -07:00
Anatol Belski 5d1c130506 changes to dns.c 2013-10-16 03:08:22 -07:00
Anatol Belski ec49b23a4d fixes for types to ext/standard with types ... some stuff is broken now 2013-10-16 03:08:21 -07:00
Anatol Belski 63cf4c45ca more fixes to string.c 2013-10-16 03:05:14 -07:00
Anatol Belski 010b8114cc more for cli sapi 2013-10-16 03:05:13 -07:00
Anatol Belski dec724e98d fixes to main/ 2013-10-16 03:05:13 -07:00
Anatol Belski 646b5d306c fixes after merging master 2013-10-16 03:02:34 -07:00
Anatol Belski 6a16702e30 Fixes for sizeof int 2013-10-16 02:57:39 -07:00
Anatol Belski f7730bd47e made lang scanner use zend_int.h and regenerated it 2013-10-16 02:57:38 -07:00
Anatol Belski c10c568d0f added zend_int.h to zend*.dsp 2013-10-16 02:37:13 -07:00
Anatol Belski 91058553c8 adjusted zend_types.h 2013-10-16 02:37:13 -07:00
Anatol Belski 631628baad added zend_int.h 2013-10-16 02:37:12 -07:00
Anatol Belski f6cf006496 the very first porting try, many things not worky 2013-10-16 02:37:11 -07:00
Anatol Belski baf3937c37 fixes to zend 2013-10-16 02:35:31 -07:00
Anatol Belski 0e3420bf8f more fixes to streams 2013-10-16 02:34:31 -07:00
Anatol Belski 0020a89c43 fixes to SAPI.c 2013-10-16 02:32:22 -07:00
Anatol Belski 9f294bf282 fixes to plain stream wrapper 2013-10-16 02:32:21 -07:00
Anatol Belski 5748286990 fixes to xp_socket.c 2013-10-16 02:32:20 -07:00
Anatol Belski b610404004 fixes to zend_ini and output 2013-10-16 02:32:19 -07:00
Anatol Belski 74a68df77c fix uuencode 2013-10-16 02:32:18 -07:00
Anatol Belski 42fdfacae6 fix base64 stuff 2013-10-16 02:32:17 -07:00
Anatol Belski 98ec9fdd51 fixes to url processing stuff 2013-10-16 02:32:17 -07:00
Anatol Belski 6221ea90cb huge fix to spl and more 2013-10-16 02:32:16 -07:00
Anatol Belski 86c9a6f901 fix 's' vs 'S' for datetime 2013-10-16 02:31:20 -07:00
Anatol Belski dc43044ffb string sze_t fix for internal strings 2013-10-16 02:31:20 -07:00
Anatol Belski 0d0eec58f1 strig size_t fixes to zend_alloc.* 2013-10-16 02:31:19 -07:00
Anatol Belski a296d61c05 trivial fixes to ext\standard 2013-10-16 02:31:18 -07:00
Anatol Belski 2f39ef6596 trivial fixes to spl 2013-10-16 02:30:28 -07:00
Anatol Belski 4f62adfb2c fix spl_autoload_* 2013-10-16 02:30:27 -07:00
Anatol Belski 43e05efd3b windows fixes 2013-10-16 02:30:27 -07:00
Anthony Ferrara 2cf827b52a Get core test suite to really pass, fully. Woot 2013-10-16 02:30:26 -07:00
Anthony Ferrara 0cd95c1ee0 Get basic language tests to all pass (minus xfails) 2013-10-16 02:30:25 -07:00
Anthony Ferrara 6484eaf77e Better test coverage 2013-10-16 02:26:33 -07:00
Anthony Ferrara e6f90ecc27 It compiles. Sort-of. In a way. Yeah. But nothing works. Sigh 2013-10-16 02:24:40 -07:00
Anthony Ferrara 1d861341a0 More work, get strings working, sort-of... 2013-10-16 01:58:11 -07:00
Anthony Ferrara 10ff0829d4 Refactor file.c to use new string types 2013-10-16 01:56:47 -07:00
Anthony Ferrara c224e239bd Re-do a lot of it using a conditional define, and legacy type information for APIs 2013-10-16 01:55:06 -07:00
Adam Harvey 59ebbf5109 Allow CURLOPT_FOLLOWLOCATION to be used with open_basedir.
Newer versions of libcurl prevent file:// location response headers by default,
which means that the open_basedir check is unnecessary — the fact
CURLOPT_REDIR_PROTOCOLS can't set CURLPROTO_FILE with open_basedir enabled
means that there's no possibility of breaching the open_basedir restriction,
and this allows HTTP redirects to be followed automatically.

Implements FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or
safe_mode).
2013-10-16 01:34:31 -07:00
Adam Harvey 04c823d287 Tinker with the wording of the short_open_tag description.
I'm still not thrilled with this, but it's a bit better and addresses the
issues noted in bug #65644. Plus, it now mentions the decoupling of <?=.
2013-10-16 01:34:30 -07:00
Adam Harvey 5c50e69814 Handle CLI server request headers case insensitively.
Fixes bug #65633 (built-in server treat some http headers as case-sensitive).
2013-10-16 01:29:42 -07:00
unknown f074ad207c ensure that the defined interpolation method is used by the generic scaling functions 2013-10-16 01:29:06 -07:00
Dmitry Stogov 4d86b8b507 Fixed issue #128 (opcache_invalidate segmentation fault) 2013-10-16 01:28:23 -07:00
Christopher Jones 32a8ad32e7 Remove obsolete flag 2013-10-16 01:28:22 -07:00
Christopher Jones 814b1985bc Update DTrace probes 2013-10-16 01:28:22 -07:00
Christopher Jones f453122b73 Add test for oci_set_* error changes 2013-10-16 01:28:21 -07:00
Christopher Jones 66db31f5c6 Make oci_set_*($connection,...) errors retrievable via oci_error($connection).
Improve some error handling to produce error text on some rare edge cases.
Disambiguate the Oracle library function call return status values from ORA error numbers.
Review and unify error data types.
2013-10-16 01:28:20 -07:00
Christopher Jones 388928ee24 Cast time_t since some "dtrace -G" invocations fail on time_t arguments 2013-10-16 01:26:09 -07:00
Stanislav Malyshev 49c9e595f6 5.4.21 now 2013-10-16 01:26:08 -07:00
Gustavo André dos Santos Lopes f1a05e788c Update NEWS/UPGRADING with info about incompat ctx 2013-10-16 01:24:01 -07:00
Xinchen Hui fd91996c55 Typo.... 2013-10-16 01:24:00 -07:00
Xinchen Hui f16cdc0d50 Add a XFAIL test for #64896 2013-10-16 01:24:00 -07:00
Gustavo André dos Santos Lopes 765cdb22cf Implement phase 1 of rfc/incompat_ctx
Just changing the error level of the message from E_STRICT to
E_DEPRECATED. This comes one version later than the timeline
mentioned in the RFC.

Oddly, there were no tests for this ‘feature’. I added a simple
one.
2013-10-16 01:23:59 -07:00
Nikita Popov 7f17c8c11e Make use of direct returns in some places 2013-10-16 01:23:58 -07:00
Nikita Popov cc0e733baa Always pass return_value_ptr to internal functions
Previous some places passed return_value_ptr only if the function
returned by reference. Now return_value_ptr is always set, even
for functions returning by-value.

This allows you to return zvals without copying their contents. For
this purpose two new macros RETVAL_ZVAL_FAST and RETURN_ZVAL_FAST
are added:

    RETVAL_ZVAL_FAST(zv); /* Analog to RETVAL_ZVAL(zv, 1, 0) */
    RETURN_ZVAL_FAST(zv); /* Analog to RETURN_ZVAL(zv, 1, 0) */

These macros behave similarly to the non-FAST versions with
copy=1 and dtor=0, with the difference that the FAST versions
will try return the zval without copying by utilizing return_value_ptr.
2013-10-16 01:23:57 -07:00
Christopher Jones 93b6c4f2bb Allow OCI8 to be DTrace-enabled independently of core PHP's DTrace
status.  The proviso is OCI8 must be built "shared" when DTrace is
enabled.  This implementation (i) works around an incomplete core PHP
solution for extension tracing (ii) avoid any issues with DOF section
location and the complexities of needing to merge all provider .d
files for static builds (iii) allows OCI8 to be DTrace-enabled when
doing PECL installs of OCI8 on PHP versions without core PHP DTrace
support.

This is an initial patch i.e. it will undergo further testing.
2013-10-16 01:23:57 -07:00
Christopher Jones e9782f3a10 OCI8: remove unused ext/oci8/config.m4 macro 2013-10-16 01:23:56 -07:00
Christopher Jones 6bb30e2aec OCI8 whitespace: remove tabs embedded in code 2013-10-16 01:23:55 -07:00
Remi Collet a296e3d032 Fixed bug #65564 stack-buffer-overflow in DateTimeZone stuff caught by AddressSanitizer 2013-10-16 01:23:54 -07:00
Remi Collet 3df4c3eb70 Fixed Bug #65564 stack-buffer-overflow in DateTimeZone stuff caught by AddressSanitizer 2013-10-16 01:22:56 -07:00
Xinchen Hui 2e560a331d Fixed bug #60598 (cli/apache sapi segfault on objects manipulation) 2013-10-16 01:21:34 -07:00
Yasuo Ohgaki 9628ac34a6 Remove ini dependency in test 2013-10-16 01:20:56 -07:00
Dmitry Stogov 7fcd3e2721 Fixed bug #65510 (5.5.2 crashes in _get_zval_ptr_ptr_var) 2013-10-16 01:20:55 -07:00
Dmitry Stogov 58606fc10d Fixed bug #61759 (class_alias() should accept classes with leading backslashes). (Julien) 2013-10-16 01:20:13 -07:00
Dmitry Stogov 08c2e821cc Fixed compatibility with php-5.2 2013-10-16 01:19:17 -07:00
Dmitry Stogov 5352788b44 Fixed bug #65561 (Zend Opcache on Solaris 11 x86 needs ZEND_MM_ALIGNMENT=4). (Terry Ellison) 2013-10-16 01:19:16 -07:00
Xinchen Hui db11ad2e94 Avoid compiler warning 2013-10-16 01:18:36 -07:00
Adam Harvey acbfd16ddf Fix bug #65579 (Using traits with get_class_methods causes segfault).
Specifically, this checks if there are trait aliases defined in the class scope
before attempting to dereference the first trait alias. This handles the case
where a trait alias was used in a child trait but no aliases exist in the
concrete class.
2013-10-16 01:18:36 -07:00
Anatol Belski 132505cd52 removed the /Wp64 switch as we use true 64 bit compiler now 2013-10-16 01:17:54 -07:00
Anatol Belski f350f3c9b8 updated lib versions, the vc11 ones only matter now 2013-10-16 01:17:12 -07:00
Christopher Jones 16ef7e80a8 OCI8 2.0: add oci8-check-connection probe and do some renaming 2013-10-16 01:17:11 -07:00
Anatol Belski cf22d7c06b fixed ext/iconv 2013-10-16 01:17:10 -07:00
Xinchen Hui c4edc6e277 Fixed compiler warnings
warning: 'local_dval' may be used uninitialized in this function
[-Wmaybe-uninitialized]

warning: 'dval2' may be used uninitialized in this function
[-Wmaybe-uninitialized]
2013-10-16 01:17:09 -07:00
Christopher Jones 6a2c44c811 Use "__" consistently in OCI8 DTrace probe definitions. It maps to "-" in the probe name. 2013-10-16 01:16:12 -07:00
Christopher Jones fb03ad89ef Leave it to DTrace FBT to trace underlying library calls 2013-10-16 01:16:11 -07:00
Nikita Popov 66de4151e7 Evaluate ZVAL_ZVAL arguments only once
Also remove some isref/refcount assignments, which are no longer
necessary (as ZVAL_COPY_VALUE is used now).
2013-10-16 01:16:11 -07:00
Dmitry Stogov e8b7f9f011 Fixed compilation warning 2013-10-16 01:16:10 -07:00
gron1987 62b0f1d0fc Fix bug #65554 in DateTime, when use it with D/l in format and textual day have dot at the end 2013-10-16 01:16:09 -07:00
Stanislav Malyshev 66dd725ac7 fix mysql tests & mark nextRowset problematic tests 2013-10-16 01:14:27 -07:00
Joey Smith 7f22f40541 Expose fputcsv's escape_char to userland
Allows users to assert that something other than the backslash
should be considered an escape char; also follows the RFC 4180
recommendation that fields containing a " be enclosed.
2013-10-16 01:14:23 -07:00
Stanislav Malyshev e636bea3f7 fix mysql init 2013-10-16 01:12:01 -07:00
Stanislav Malyshev ef30289ead add openssl 2013-10-16 01:12:00 -07:00
Stanislav Malyshev b0aed8f9d3 add mysql settings 2013-10-16 01:11:59 -07:00
root c74f0c613d Test extension xmlrpc encode type double and string decode type string and int 2013-10-16 01:11:23 -07:00
Ole Markus With 32776ad023 Stricter libc-client symlink check 2013-10-16 01:11:22 -07:00
Michael M Slusarz 674fb57896 Fix #65483: quoted-printable encode stream filter incorrectly encoding spaces 2013-10-16 01:11:21 -07:00
Alexander Moskaliov 39c8f8a205 Remove semicolon 2013-10-16 01:11:21 -07:00
Alexander Moskalev 66174837ef Fix DateInterval->days value
when object was created not from DateTime::diff()
2013-10-16 01:11:20 -07:00
Boro Sitnikovski bce1151df9 Bug 64744
Show the type of the non-object for more descriptive errors
2013-09-20 13:34:12 +02:00
Anatol Belski b8213906ff fixed decrement 2013-08-26 07:31:10 -07:00
Anatol Belski 4b484e0278 fixed numeric string comparsion 2013-08-26 07:06:31 -07:00
Anatol Belski 1b523d9c93 Merge branch 'string_size_refactor_take_2' into str_size_and_int64 2013-08-26 05:44:35 -07:00
Anatol Belski a0dfabed1f some more linux fixes 2013-08-26 05:54:33 -07:00
Anatol Belski 61a1a3e39b fixed configure.in 2013-08-26 05:19:14 -07:00
Anatol Belski 6e4395b586 ext/intl further fixes 2013-08-26 04:33:07 -07:00
Anatol Belski 9c81da4170 ext/intl further converting 2013-08-26 01:52:31 -07:00
Anatol Belski 14f8e16870 more fixes to ext/intl 2013-08-24 07:32:28 -07:00
Anatol Belski 07b87a2a7f Z_STRLEN vs Z_STRSIZE in ext/intl 2013-08-24 07:02:28 -07:00
Anatol Belski 1492bc1d60 adapted args in ext/intl 2013-08-24 05:08:22 -07:00
Anatol Belski 2545fbbdc2 fixed the mb_regex* stuff 2013-08-24 03:24:06 -07:00
Anatol Belski 2bf8f91b87 fixed sapi filter usage 2013-08-24 03:04:35 -07:00
Anatol Belski 9382c75061 replaced all the arg formats and Z_STRLEN
won't work yet, just initial work to be done
2013-08-24 02:54:21 -07:00
Anatol Belski 644278c1a3 Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2 2013-08-23 09:07:58 -07:00
Anatol Belski 3d49768cc2 fixed set process_title() 2013-08-23 07:12:56 -07:00
Anatol Belski 2a28a30c4d fix pcre usage in spl 2013-08-23 06:47:18 -07:00
Anatol Belski f2a4f31bf4 fixed ext/pcre internal stuff
Now only the flaw is pcrelib itself as it works with int for
string length and offsets. Bigger stuff won't work anyway, but
if there are some issue there are just a few places like pcre_exec()
where we can explicitly cast to int.
2013-08-23 06:37:51 -07:00
Anatol Belski 6b474bbcf6 adapted all the function arg formats in ext/zlib 2013-08-23 04:21:02 -07:00
Anatol Belski 03bee19890 some more fixes to zend operators 2013-08-23 04:03:21 -07:00
Anatol Belski ba52352363 added ZEND_INT_FMT 2013-08-23 03:32:35 -07:00
Anatol Belski 3cbf45c510 some fixes to constants, var_dump and var_export 2013-08-23 02:34:14 -07:00
Anatol Belski 262de5d054 first fixes to ext/spl, yet incomplete 2013-08-23 01:56:16 -07:00
Anatol Belski ff233b591c fixes to reflection 2013-08-23 01:26:17 -07:00
Anatol Belski 3aed22ae8e fixes to ereg 2013-08-23 01:14:02 -07:00
Anatol Belski ebd2fc6b3f more fixes to ext/date 2013-08-23 01:08:35 -07:00
Anatol Belski 427cde5da6 replaced arg formats in pcre 2013-08-23 00:56:10 -07:00
Anatol Belski 570adc16e7 fixed sapi.h 2013-08-22 11:02:24 -07:00
Anatol Belski aae79a684d replaced all arg formats in ext/standard 2013-08-22 10:51:29 -07:00
Anatol Belski 0f892ce613 replaced all the int params in the datetime 2013-08-22 09:38:05 -07:00
Anatol Belski 261938b5e0 Merge branch 'string_size_refactor_take_2' into str_size_and_int64
Conflicts:
	ext/standard/string.c
2013-08-22 09:13:46 -07:00
Anatol Belski 5efaa8f7b9 adapted the function args for ereg
And that actually seems to be it, all tests pass so far. So lets
see how it goes in the fture, too easy but seems to be done for now .
2013-08-22 08:45:08 -07:00
Anatol Belski 320e82b603 trivial fix spl_autoload_functions() 2013-08-22 06:48:55 -07:00
Anatol Belski bfb0e87e2b final fix for hebrev() 2013-08-22 06:06:24 -07:00
Anatol Belski 5351aa9ac1 Merge branch 'string_size_refactor_take_2' of https://github.com/weltling/php-src into string_size_refactor_take_2 2013-08-22 03:45:28 -07:00
Anatol Belski 569cbd2081 fix build 2013-08-22 03:59:09 -07:00
Anatol Belski 764054c2eb Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2 2013-08-22 01:40:20 -07:00
Anatol Belski 5c6428b0b9 fixed file_put_contents() 2013-08-22 01:27:08 -07:00
Anatol Belski ea56c2dcfd fixed fwrite 2013-08-22 00:54:45 -07:00
Anatol Belski 09c3b6c1b6 fixed "s" vs "S" for soundex 2013-08-22 00:45:16 -07:00
Anatol Belski bda11c6bd2 partial fix to hebrev 2013-08-21 04:30:54 -07:00
Anatol Belski c8fbe078a1 fixed unpack() 2013-08-21 03:54:13 -07:00
Anatol Belski 2d44a04a83 fixed str_pad() 2013-08-21 01:35:40 -07:00
Anatol Belski d6c59e1d7e lost condition 2013-08-21 00:33:47 -07:00
Anatol Belski e2070d1409 Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2 2013-08-21 00:28:43 -07:00
Anatol Belski d871982507 Merge branch 'string_size_refactor_take_2' of https://github.com/ircmaxell/php-src into string_size_refactor_take_2 2013-08-21 00:28:19 -07:00
Anatol Belski c8acebe674 fixed str_split() 2013-08-21 00:27:07 -07:00
Anthony Ferrara dc29937050 Merge pull request #5 from weltling/string_size_refactor_take_2
String size refactor take 2, partial fixes to ext/standard
2013-08-17 12:42:52 -07:00
Anatol Belski 91ceb295da Fixed substr(), but no kidding now.
all the signed/unsigned arithmetic needs clear understanding
2013-08-17 10:10:15 -07:00
Anatol Belski 99442a301d small correction to substr 2013-08-17 04:22:09 -07:00
Anatol Belski 6b067db5fb fixed strstr() 2013-08-17 03:53:07 -07:00
Anatol Belski 5c754227a7 fixed substr() 2013-08-16 08:10:14 -07:00
Anatol Belski a7a797b455 adapted all the zend_parse_parameters() calls 2013-08-16 02:37:08 -07:00
Anatol Belski 715b040f46 Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2
Conflicts:
	Zend/zend_exceptions.c
	ext/date/php_date.c
	ext/standard/string.c
	ext/standard/url_scanner_ex.c
	ext/standard/url_scanner_ex.re
	main/rfc1867.c
2013-08-16 01:45:50 -07:00
Anatol Belski 1e53ccdf7a fixed merge mistake 2013-08-13 07:59:56 -07:00
Anthony Ferrara 221b9d44a8 Merge pull request #4 from weltling/string_size_refactor_take_2
String size refactor take 2
2013-08-13 07:36:50 -07:00
Anatol Belski 0773ab461e changes to dns.c 2013-08-13 01:26:05 -07:00
Anatol Belski ccf2069c18 Merge branch 'string_size_refactor_take_2' into str_size_and_int64
Conflicts:
	Zend/zend_constants.h
2013-08-13 01:10:09 -07:00
Anatol Belski 6478088a2c Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2
Conflicts:
	Zend/zend_operators.h
	main/SAPI.h
	main/rfc1867.c
	main/streams/php_stream_transport.h
	main/streams/streams.c
	main/streams/transports.c
	main/streams/xp_socket.c
2013-08-13 01:07:12 -07:00
Anatol Belski a95f8dbac2 fixes for types to ext/standard with types ... some stuff is broken now 2013-07-29 09:04:56 -07:00
Anatol Belski 88960bba1e more fixes to string.c 2013-07-29 04:50:47 -07:00
Anatol Belski 62c1f4127b more for cli sapi 2013-07-29 02:39:44 -07:00
Anatol Belski cd955c183b fixes to main/ 2013-07-29 02:16:39 -07:00
Anatol Belski dc0b9d716e Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2
Conflicts:
	Zend/zend_constants.h
	ext/standard/info.c
2013-07-29 01:47:45 -07:00
Anatol Belski 03cae613f0 fixes after merging master 2013-07-18 03:53:51 -07:00
Anatol Belski 9f177207fc Merge branch 'string_size_refactor_take_2' into str_size_and_int64 2013-07-18 03:22:12 -07:00
Anatol Belski 46e07a6fd7 Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2
Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-07-18 03:20:13 -07:00
Anatol Belski 231eaa3919 Fixes for sizeof int 2013-07-18 02:58:55 -07:00
Anatol Belski 13cb1b7e4a made lang scanner use zend_int.h and regenerated it 2013-07-18 02:52:15 -07:00
Anatol Belski 4bcc5a87d7 added zend_int.h to zend*.dsp 2013-07-18 01:09:03 -07:00
Anatol Belski 0605bebdb6 adjusted zend_types.h 2013-07-18 01:05:27 -07:00
Anatol Belski ec0300ec25 added zend_int.h 2013-07-18 01:04:37 -07:00
Anatol Belski 8b8f7d4a5a the very first porting try, many things not worky 2013-07-17 09:48:13 -07:00
Anatol Belski a5302f286e Merge branch 'string_size_refactor_take_2' into str_size_and_int64
* string_size_refactor_take_2:
  fixes to zend
  more fixes to streams
  fixes to SAPI.c
  fixes to plain stream wrapper
  fixes to xp_socket.c
  fixes to zend_ini and output
2013-07-17 09:24:21 -07:00
Anatol Belski d4c546b956 fixes to zend 2013-07-17 09:11:51 -07:00
Anatol Belski 9703f57bd1 more fixes to streams 2013-07-17 06:30:28 -07:00
Anatol Belski cc3ec2936c fixes to SAPI.c 2013-07-17 06:06:35 -07:00
Anatol Belski 06fe769905 fixes to plain stream wrapper 2013-07-17 05:50:33 -07:00
Anatol Belski c292a18514 fixes to xp_socket.c 2013-07-17 04:53:56 -07:00
Anatol Belski eb5ab08267 fixes to zend_ini and output 2013-07-17 03:31:17 -07:00
Anthony Ferrara 6bd00eda6b Merge pull request #2 from weltling/string_size_refactor_take_2
Fixes by the end of the day
2013-07-15 09:36:03 -07:00
Anatol Belski 5ae81ec123 fix uuencode 2013-07-11 08:12:30 -07:00
Anatol Belski 8f7abf4371 fix base64 stuff 2013-07-11 07:02:58 -07:00
Anatol Belski e17ef23c2c fixes to url processing stuff 2013-07-11 06:57:22 -07:00
Anatol Belski a9b623aa0b huge fix to spl and more 2013-07-11 05:37:09 -07:00
Anatol Belski 7331e4c9c8 Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2 2013-07-11 03:00:30 -07:00
Anatol Belski 42c8f29277 fix 's' vs 'S' for datetime 2013-07-11 02:58:53 -07:00
Anatol Belski 59d95c1537 Merge branch 'master' of https://github.com/php/php-src into string_size_refactor_take_2 2013-07-10 01:09:28 -07:00
Anatol Belski 309d3b512e Merge branch 'string_size_refactor_take_2' of https://github.com/ircmaxell/php-src into string_size_refactor_take_2 2013-07-10 01:09:01 -07:00
Anatol Belski 03ed6fc0b1 string sze_t fix for internal strings 2013-07-10 00:43:19 -07:00
Anatol Belski acd85d48f0 strig size_t fixes to zend_alloc.* 2013-07-09 06:13:08 -07:00
Anthony Ferrara 3744ff7c18 Merge pull request #1 from weltling/string_size_refactor_take_2
windows fixes
2013-07-05 05:26:40 -07:00
Anatol Belski 8db3e3738c trivial fixes to ext\standard 2013-07-04 09:35:05 -07:00
Anatol Belski bf18c56fb7 trivial fixes to spl 2013-07-04 08:50:58 -07:00
Anatol Belski 890345eda0 fix spl_autoload_* 2013-07-04 06:41:48 -07:00
Anatol Belski ca0e018c95 windows fixes 2013-07-04 04:27:40 -07:00
Anthony Ferrara f4c4fe417a Get core test suite to really pass, fully. Woot 2013-07-02 11:51:45 -04:00
Anthony Ferrara 3db6b5112f Get basic language tests to all pass (minus xfails) 2013-07-02 11:27:48 -04:00
Anthony Ferrara 91abad1e1b Better test coverage 2013-07-02 10:20:01 -04:00
Anthony Ferrara 6e008d40c2 It compiles. Sort-of. In a way. Yeah. But nothing works. Sigh 2013-07-02 09:46:30 -04:00
Gernot Vormayr a90a93f1a4 Add apparmor change hat functionality to fpm 2013-07-02 13:06:02 +02:00
Anthony Ferrara 66845fb6a5 More work, get strings working, sort-of... 2013-07-01 17:59:11 -04:00
Anthony Ferrara 89aea2f103 Refactor file.c to use new string types 2013-07-01 17:15:25 -04:00
Anthony Ferrara ea58b542d6 Re-do a lot of it using a conditional define, and legacy type information for APIs 2013-07-01 16:53:54 -04:00
Jefersson Nathan 89a657f80a Fixed identation on file 2013-04-23 08:24:15 -03:00
1175 changed files with 135595 additions and 89886 deletions

No files matched your search

+180 -217
View File
@@ -48,110 +48,80 @@ define print_cvs
end
define dump_bt
set $t = $arg0
while $t
printf "[%p] ", $t
set $fst = $t->function_state
if $fst.function->common.function_name
if $fst.arguments
set $count = (int)*($fst.arguments)
if $t->object
if $fst.function.common.scope
printf "%s->", $fst.function.common.scope->name
else
if !$eg
____executor_globals
end
set $known_class = 0
if $eg
set $handle = $t->object.value.obj.handle
set $handlers = $t->object.value.obj.handlers
set $zobj = (zend_object *)$eg.objects_store.object_buckets[$handle].bucket.obj.object
if $handlers->get_class_entry == &zend_std_object_get_class
set $known_class = 1
if $handlers.get_class_name
if $handlers.get_class_name != &zend_std_object_get_class_name
set $known_class = 0
end
end
if $known_class
printf "%s->", $zobj->ce.name
end
end
end
if !$known_class
printf "(Unknown)->"
end
end
set $ex = $arg0->prev_execute_data
while $ex
printf "[%p] ", $ex
set $func = $ex->func
if $func
if $ex->object
if $func->common.scope
printf "%s->", $func->common.scope->name->val
else
if $fst.function.common.scope
printf "%s::", $fst.function.common.scope->name
end
printf "%s->", $ex->object->ce.name->val
end
else
if $func->common.scope
printf "%s::", $func->common.scope->name->val
end
end
printf "%s(", $func->common.function_name->val
set $callFrameSize = (sizeof(zend_execute_data) + sizeof(zval) - 1) / sizeof(zval)
set $count = $ex->num_args
set $arg = 0
while $arg < $count
if $arg > 0
printf ", "
end
printf "%s(", $fst.function->common.function_name
while $count > 0
set $zvalue = *(zval **)($fst.arguments - $count)
set $type = $zvalue->type
if $type == 0
printf "NULL"
end
if $type == 1
printf "%ld", $zvalue->value.lval
end
if $type == 2
printf "%f", $zvalue->value.dval
end
if $type == 3
if $zvalue->value.lval
printf "true"
else
printf "false"
end
end
if $type == 4
printf "array(%d)[%p]", $zvalue->value.ht->nNumOfElements, $zvalue
end
if $type == 5
printf "object[%p]", $zvalue
end
if $type == 6
____print_str $zvalue->value.str.val $zvalue->value.str.len
end
if $type == 7
printf "resource(#%d)", $zvalue->value.lval
end
if $type == 8
printf "constant"
end
if $type == 9
printf "const_array"
end
if $type > 9
printf "unknown type %d", $type
end
set $count = $count -1
if $count > 0
printf ", "
end
set $zvalue = (zval *) $ex + $callFrameSize + $arg
set $type = $zvalue->u1.v.type
if $type == 1
printf "NULL"
end
printf ") "
else
printf "%s() ", $fst.function->common.function_name
if $type == 2
printf "false"
end
if $type == 3
printf "true"
end
if $type == 4
printf "%ld", $zvalue->value.lval
end
if $type == 5
printf "%f", $zvalue->value.dval
end
if $type == 6
____print_str $zvalue->value.str->val $zvalue->value.str->len
end
if $type == 7
printf "array(%d)[%p]", $zvalue->value.arr->ht->nNumOfElements, $zvalue
end
if $type == 8
printf "object[%p]", $zvalue
end
if $type == 9
printf "resource(#%d)", $zvalue->value.lval
end
if $type == 10
printf "reference"
end
if $type > 10
printf "unknown type %d", $type
end
set $arg = $arg + 1
end
printf ") "
else
printf "??? "
end
if $t->op_array != 0
printf "%s:%d ", $t->op_array->filename, $t->opline->lineno
if $func != 0
printf "%s:%d ", $func->op_array.filename->val, $ex->opline->lineno
end
set $t = $t->prev_execute_data
set $ex = $ex->prev_execute_data
printf "\n"
end
end
@@ -171,34 +141,37 @@ end
define ____printzv_contents
set $zvalue = $arg0
set $type = $zvalue->type
set $type = $zvalue->u1.v.type
printf "(refcount=%d", $zvalue->refcount__gc
if $zvalue->is_ref__gc
printf ",is_ref"
# 15 == IS_INDIRECT
if $type >= 5 && $type != 15
printf "(refcount=%d) ", $zvalue->value.counted->refcount
end
printf ") "
if $type == 0
printf "NULL"
printf "UNDEF"
end
if $type == 1
printf "long: %ld", $zvalue->value.lval
printf "NULL"
end
if $type == 2
printf "double: %f", $zvalue->value.dval
printf "bool: false"
end
if $type == 3
printf "bool: "
if $zvalue->value.lval
printf "true"
else
printf "false"
end
printf "bool: true"
end
if $type == 4
printf "array(%d): ", $zvalue->value.ht->nNumOfElements
if $type == 4
printf "long: %ld", $zvalue->value.lval
end
if $type == 5
printf "double: %f", $zvalue->value.dval
end
if $type == 6
printf "string: %s", $zvalue->value.str->val
end
if $type == 7
printf "array: "
if ! $arg1
printf "{\n"
set $ind = $ind + 1
____print_ht $zvalue->value.ht 1
set $ind = $ind - 1
@@ -207,32 +180,21 @@ define ____printzv_contents
printf " "
set $i = $i - 1
end
printf "}"
end
set $type = 0
end
if $type == 5
if $type == 8
printf "object"
____executor_globals
set $handle = $zvalue->value.obj.handle
set $handlers = $zvalue->value.obj.handlers
if basic_functions_module.zts
set $zobj = zend_objects_get_address($zvalue, $tsrm_ls)
else
set $zobj = zend_objects_get_address($zvalue)
end
if $handlers->get_class_entry == &zend_std_object_get_class
set $cname = $zobj->ce.name
else
set $cname = "Unknown"
end
set $zobj = $zvalue->value.obj
set $cname = $zobj->ce->name->val
printf "(%s) #%d", $cname, $handle
if ! $arg1
if $handlers->get_properties == &zend_std_get_properties
set $ht = $zobj->properties
if $ht
printf "(%d): ", $ht->nNumOfElements
printf "{\n"
set $ind = $ind + 1
____print_ht $ht 1
set $ind = $ind - 1
@@ -241,7 +203,6 @@ define ____printzv_contents
printf " "
set $i = $i - 1
end
printf "}"
else
echo "no properties found"
end
@@ -249,20 +210,36 @@ define ____printzv_contents
end
set $type = 0
end
if $type == 6
printf "string(%d): ", $zvalue->value.str.len
____print_str $zvalue->value.str.val $zvalue->value.str.len
end
if $type == 7
printf "resource: #%d", $zvalue->value.lval
end
if $type == 8
printf "constant"
end
if $type == 9
printf "const_array"
printf "resource: #%d", $zvalue->value.res->handle
end
if $type > 9
if $type == 10
printf "reference: "
____printzv &$zvalue->value.ref->val $arg1
end
if $type == 11
printf "const: %s", $zvalue->value.str->val
end
if $type == 12
printf "const_ast"
end
if $type == 13
printf "_IS_BOOL"
end
if $type == 14
printf "IS_CALLABLE"
end
if $type == 15
printf "indirect: "
____printzv $zvalue->value.zv $arg1
end
if $type == 16
printf "string_offset"
end
if $type == 17
printf "pointer: %p", $zvalue->value.ptr
end
if $type > 17
printf "unknown type %d", $type
end
printf "\n"
@@ -274,10 +251,6 @@ define ____printzv
printf "[%p] ", $zvalue
if $zvalue == $eg.uninitialized_zval_ptr
printf "*uninitialized* "
end
set $zcontents = (zval*) $zvalue
if $arg1
____printzv_contents $zcontents $arg1
@@ -320,42 +293,60 @@ end
define ____print_ht
set $ht = (HashTable*)$arg0
set $p = $ht->pListHead
while $p != 0
set $i = $ind
while $i > 0
printf " "
set $i = $i - 1
end
if $p->nKeyLength > 0
____print_str $p->arKey $p->nKeyLength
printf " => "
else
printf "%d => ", $p->h
end
if $arg1 == 0
printf "%p\n", (void*)$p->pData
end
if $arg1 == 1
set $zval = *(zval **)$p->pData
____printzv $zval 1
end
if $arg1 == 2
printf "%s\n", (char*)$p->pData
end
set $p = $p->pListNext
set $n = $ind
while $n > 0
printf " "
set $n = $n - 1
end
if $ht->u.v.flags & 4
printf "Packed"
else
printf "Hash"
end
printf "(%d)[%p]: {\n", $ht->nNumOfElements, $ht
set $num = $ht->nNumUsed
set $i = 0
set $ind = $ind + 1
while $i < $num
set $p = (Bucket*)($ht->arData + $i)
set $n = $ind
if $p->val.u1.v.type > 0
while $n > 0
printf " "
set $n = $n - 1
end
printf "[%d] ", $i
if $p->key
printf "%s => ", $p->key->val
else
printf "%d => ", $p->h
end
if $arg1 == 0
printf "%p\n", (zval *)&$p->val
end
if $arg1 == 1
set $zval = (zval *)&$p->val
____printzv $zval 1
end
if $arg1 == 2
printf "%s\n", (char*)$p->val.value.ptr
end
if $arg1 == 3
set $func = (zend_function*)$p->val.value.ptr
printf "\"%s\"\n", $func->common.function_name->val
end
end
set $i = $i + 1
end
set $ind = $ind - 1
printf "}\n"
end
define print_ht
set $ind = 1
printf "[%p] {\n", $arg0
set $ind = 0
____print_ht $arg0 1
printf "}\n"
end
document print_ht
@@ -363,10 +354,8 @@ document print_ht
end
define print_htptr
set $ind = 1
printf "[%p] {\n", $arg0
set $ind = 0
____print_ht $arg0 0
printf "}\n"
end
document print_htptr
@@ -374,46 +363,17 @@ document print_htptr
end
define print_htstr
set $ind = 1
printf "[%p] {\n", $arg0
set $ind = 0
____print_ht $arg0 2
printf "}\n"
end
document print_htstr
dumps elements of HashTable made of strings
end
define ____print_ft
set $ht = $arg0
set $p = $ht->pListHead
while $p != 0
set $func = (zend_function*)$p->pData
set $i = $ind
while $i > 0
printf " "
set $i = $i - 1
end
if $p->nKeyLength > 0
____print_str $p->arKey $p->nKeyLength
printf " => "
else
printf "%d => ", $p->h
end
printf "\"%s\"\n", $func->common.function_name
set $p = $p->pListNext
end
end
define print_ft
set $ind = 1
printf "[%p] {\n", $arg0
____print_ft $arg0
printf "}\n"
set $ind = 0
____print_ht $arg0 3
end
document print_ft
@@ -429,15 +389,15 @@ define ____print_inh_class
printf "final "
end
end
printf "class %s", $ce->name
printf "class %s", $ce->name->val
if $ce->parent != 0
printf " extends %s", $ce->parent->name
printf " extends %s", $ce->parent->name->val
end
if $ce->num_interfaces != 0
printf " implements"
set $tmp = 0
while $tmp < $ce->num_interfaces
printf " %s", $ce->interfaces[$tmp]->name
printf " %s", $ce->interfaces[$tmp]->name->val
set $tmp = $tmp + 1
if $tmp < $ce->num_interfaces
printf ","
@@ -449,10 +409,10 @@ end
define ____print_inh_iface
set $ce = $arg0
printf "interface %s", $ce->name
printf "interface %s", $ce->name->val
if $ce->num_interfaces != 0
set $ce = $ce->interfaces[0]
printf " extends %s", $ce->name
printf " extends %s", $ce->name->val
else
set $ce = 0
end
@@ -516,7 +476,7 @@ define ____print_str
set $tmp = 0
set $str = $arg0
printf "\""
while $tmp < $arg1
while $tmp < $arg1 && $tmp < 256
if $str[$tmp] > 32 && $str[$tmp] < 127
printf "%c", $str[$tmp]
else
@@ -524,6 +484,9 @@ define ____print_str
end
set $tmp = $tmp + 1
end
if $tmp != $arg1
printf "..."
end
printf "\""
end
@@ -618,9 +581,9 @@ define zmemcheck
if $p->magic == 0xfb8277dc
set $stat = "CACHED"
end
set $filename = strrchr($p->filename, '/')
set $filename = strrchr($p->filename->val, '/')
if !$filename
set $filename = $p->filename
set $filename = $p->filename->val
else
set $filename = $filename + 1
end
+4 -1
View File
@@ -4,6 +4,10 @@ php:
# We only specify one version so we only get one worker
- 5.4
branches:
except:
- phpng
notifications:
email:
on_failure: change
@@ -43,4 +47,3 @@ before_script:
# Run PHPs run-tests.php
script:
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120
- ./sapi/cli/php sapi/phpdbg/tests/run-tests.php -diff2stdout --phpdbg sapi/phpdbg/phpdbg
+25 -767
View File
@@ -1,779 +1,37 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2014, PHP 5.6.0 ???
?? ??? 20??, PHP 7.0.0
- CLI server:
. Refactor MIME type handling to use a hash table instead of linear search.
(Adam)
. Update the MIME type list from the one shipped by Apache HTTPD. (Adam)
- Core:
. Fixed bug #67878 (program_prefix not honoured in man pages). (Remi)
. Added PHP_INT_MIN constant. (Andrea)
- Fileinfo:
. Fixed bug #67716 (Segfault in cdf.c). (CVE-2014-3587) (Remi)
- Reflection
. Fixed inheritance chain of Reflector interface (Tjerk)
- GD
- DBA:
. Fixed bug #62490 (dba_delete returns true on missing item (inifile)). (Mike)
- FPM:
. Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes). (Chris Wright)
- Standard:
. Removed call_user_method() and call_user_method_array() functions. (Kalle)
. Fix user session handlers (See rfc:session.user.return-value). (Sara)
. Added intdiv() function. (Andrea)
. Improved precision of log() function for base 2 and 10. (Marc Bennewitz)
- XSL:
. Fixed bug #64776 (The XSLT extension is not thread safe). (Mike)
- GD:
. Made fontFetch's path parser thread-safe. (Sara)
. Fixed bug #67730 (Null byte injection possible with imagexxx functions).
(CVE-2014-5120) (Ryan Mauger)
- OpenSSL
. Fixed bug #67850 (extension won't build if openssl compiled without SSLv3)
(Daniel Lowrey)
- Zlib:
. Fixed bug #67865 (internal corruption phar error). Mike
- Session:
. Fixed bug #67694 (Regression in session_regenerate_id()). (Tjerk)
14 Aug 2014, PHP 5.6.0 Release Candidate 4
- COM:
. Fixed bug #41577 (DOTNET is successful once per server run)
(Aidas Kasparas)
- Core:
. Fixed bug #67693 (incorrect push to the empty array). (Tjerk)
. Removed inconsistency regarding behaviour of array in constants at
run-time. (Bob)
- Fileinfo:
. Fixed bug #67705 (extensive backtracking in rule regular expression).
(CVE-2014-3538) (Remi)
- FPM:
. Fix bug #67606 (revised fix 67541, broke mod_fastcgi BC). (David Zuelke)
- GD:
. Fixed bug #66901 (php-gd 'c_color' NULL pointer dereference).
(CVE-2014-2497) (Remi)
- Milter:
. Fixed bug #67715 (php-milter does not build and crashes randomly). (Mike)
- Network:
. Fixed bug #67717 (segfault in dns_get_record). (CVE-2014-3597) (Remi)
- OpenSSL:
. Fixed bug #41631 (socket timeouts not honored in blocking SSL reads)
(Daniel Lowrey).
- SPL:
. Revert fix for bug #67064 (BC issues). (Bob)
- Zlib:
. Fixed bug #67724 (chained zlib filters silently fail with large amounts of
data). (Mike)
- Date:
. Fixed bug #66091 (memory leaks in DateTime constructor) (Tjerk).
- MySQLi:
. Fixed bug #67839 (mysqli does not handle 4-byte floats correctly). (Keyur)
31 Jul 2014, PHP 5.6.0 Release Candidate 3
- Core:
. Fixed bug #67497 (eval with parse error causes segmentation fault in
generator). (Nikita)
. Fixed bug #67151 (strtr with empty array crashes). (Nikita)
. Fixed bug #67407 (Windows 8.1/Server 2012 R2 reported as Windows 8/Server
2012). (Christian Wenz)
. Fixed bug #66608 (Incorrect behavior with nested "finally" blocks).
(Laruence, Dmitry)
. Implemented FR #34407 (ucwords and Title Case). (Tjerk)
- COM:
. Fixed missing type checks in com_event_sink (Yussuf Khalil, Stas).
- CLI server:
. Fixed bug #66830 (Empty header causes PHP built-in web server to hang).
(Adam)
. Fixed bug #67594 (Unable to access to apache_request_headers() elements).
(Tjerk)
- FPM:
. Fixed bug #67530 (error_log=syslog ignored). (Remi)
. Fixed bug #67635 (php links to systemd libraries without using pkg-config).
(pacho@gentoo.org, Remi)
- Intl:
. Fixed bug #66921 (Wrong argument type hint for function
intltz_from_date_time_zone). (Stas)
. Fixed bug #67052 (NumberFormatter::parse() resets LC_NUMERIC setting).
(Stas)
- pgsql:
. Fixed bug #67555 (Cannot build against libpq 7.3). (Adam)
- ODBC:
. Fixed bug #60616 (odbc_fetch_into returns junk at end of multi-byte char
fields). (Keyur Govande)
- OpenSSL:
. Fixed missing type checks in OpenSSL options (Yussuf Khalil, Stas).
. Fixed bug #67609 (TLS connections fail behind HTTP proxy). (Daniel Lowrey)
. Fixed broken build against OpenSSL older than 0.9.8 where ECDH unavailable.
(Lior Kaplan)
. Fixed bug #67666 (Subject altNames doesn't support wildcard matching). (Tjerk)
- Phar:
. Fixed bug #67587 (Redirection loop on nginx with FPM). (Christian Weiske)
- readline:
. Fixed bug #55496 (Interactive mode doesn't force a newline before the
prompt). (Bob, Johannes)
. Fixed bug #67496 (Save command history when exiting interactive shell
with control-c). (Dmitry Saprykin, Johannes)
- Reflection:
. Implemented FR #67713 (loosen the restrictions on
ReflectionClass::newInstanceWithoutConstructor()). (Ferenc)
- SPL:
. Fixed bug #67539 (ArrayIterator use-after-free due to object change during
sorting). (CVE-2014-4698) (research at insighti dot org, Laruence)
. Fixed bug #67538 (SPL Iterators use-after-free). (CVE-2014-4670) (Laruence)
- Session:
. Fixed missing type checks in php_session_create_id (Yussuf Khalil, Stas).
. Fixed bug #66827 (Session raises E_NOTICE when session name variable is array).
(Yasuo)
- OPCache:
. Fixed bug #67215 (php-cgi work with opcache, may be segmentation fault
happen) (Dmitry, Laruence)
- phpdbg
. Fixed bug #67575 (Compilation fails for phpdbg when the
build directory != src directory). (Andy Thompson)
03 Jul 2014, PHP 5.6.0 Release Candidate 2
- Core:
. Fixed bug #67091 (make install fails to install libphp5.so on FreeBSD 10.0).
(Ferenc)
. Fixed bug #67368 (Memory leak with immediately dereferenced array in class
constant). (Laruence)
. Fixed bug #67468 (Segfault in highlight_file()/highlight_string()).
(Andreas Ferber)
. Fixed bug #67498 (phpinfo() Type Confusion Information Leak Vulnerability).
(Stefan Esser)
. Fixed bug #67551 (php://input temp file will be located in sys_temp_dir
instead of upload_tmp_dir). (Mike)
- FPM:
. Fix bug #67531 (syslog cannot be set in pool configuration). (Remi)
. Fix bug #67541 (Fix Apache 2.4.10+ SetHandler proxy:fcgi://
incompatibilities). (David Zuelke)
- Intl:
. Fixed bug #67349 (Locale::parseLocale Double Free). (Stas)
. Fixed bug #67397 (Buffer overflow in locale_get_display_name and
uloc_getDisplayName (libicu 4.8.1)). (Stas)
- pgsql:
. Fix bug #67550 (Error in code "form" instead of "from", pgsql.c, line 756),
which affected builds against libpq < 7.3. (Adam)
- phpdbg:
. Fix Bug #67499 (readline feature not enabled when build with libedit). (Remi)
. Fix issue krakjoe/phpdbg#94 (List behavior is inconsistent). (Bob)
. Fix issue krakjoe/phpdbg#97 (The prompt should always ensure it is on a
newline). (Bob)
. Fix issue krakjoe/phpdbg#98 (break if does not seem to work). (Bob)
. Fix issue krakjoe/phpdbg#99 (register function has the same behavior as
run). (Bob)
. Fix issue krakjoe/phpdbg#100 (No way to list the current stack/frames)
(Help entry was missing). (Bob)
- SPL:
. Fixed bug #67492 (unserialize() SPL ArrayObject / SPLObjectStorage Type
Confusion) (CVE-2014-3515). (Stefan Esser)
19 Jun 2014, PHP 5.6.0 Release Candidate 1
- Core:
. Implemented FR #64744 (Differentiate between member function call on a null
and non-null, non-objects). (Boro Sitnikovski)
. Fixed bug #67436 (Autoloader isn't called if two method definitions don't
match). (Bob)
. Fixed bug #66622 (Closures do not correctly capture the late bound class
(static::) in some cases). (Levi Morrison)
. Fixed bug #67390 (insecure temporary file use in the configure script).
(Remi) (CVE-2014-3981)
. Fixed bug #67392 (dtrace breaks argument unpack). (Nikita)
. Fixed bug #67428 (header('Location: foo') will override a 308-399 response
code). (Adam)
. Fixed bug #67433 (SIGSEGV when using count() on an object implementing
Countable). (Matteo)
. Fixed bug #67399 (putenv with empty variable may lead to crash). (Stas)
- CLI server:
. Implemented FR #67429 (CLI server is missing some new HTTP response codes).
(Adam)
. Fixed Bug #67406 (built-in web-server segfaults on startup). (Remi)
- Fileinfo:
. Fixed bug #67410 (fileinfo: mconvert incorrect handling of truncated pascal
string size). (Francisco Alonso, Jan Kaluza, Remi)
. Fixed bug #67411 (fileinfo: cdf_check_stream_offset insufficient boundary
check). (Francisco Alonso, Jan Kaluza, Remi)
. Fixed bug #67412 (fileinfo: cdf_count_chain insufficient boundary check).
(Francisco Alonso, Jan Kaluza, Remi)
. Fixed bug #67413 (fileinfo: cdf_read_property_info insufficient boundary
check). (Francisco Alonso, Jan Kaluza, Remi)
- mysqlnd:
. Added support for gb18030 from MySQL 5.7. (Andrey)
- Network:
. Fixed bug #67432 (Fix potential segfault in dns_get_record()).
(CVE-2014-4049). (Sara)
- OpenSSL:
. Fixed bug #65698 (certificates validity parsing does not work past 2050).
(Paul Oehler)
. Fixed bug #66636 (openssl_x509_parse warning with V_ASN1_GENERALIZEDTIME).
(Paul Oehler)
- phpdbg:
. Fixed bug #67212 (phpdbg uses non-standard TIOCGWINSZ). (Ferenc)
- SOAP:
. Implemented FR #49898 (Add SoapClient::__getCookies()). (Boro Sitnikovski)
- SPL:
. Fixed bug #66127 (Segmentation fault with ArrayObject unset). (Stas)
. Fixed request #67453 (Allow to unserialize empty data). (Remi)
- Streams:
. Fixed bug #67430 (http:// wrapper doesn't follow 308 redirects). (Adam)
- Tokenizer:
. Fixed bug #67395 (token_name() does not return name for T_POW and T_POW_EQUAL
token). (Ferenc)
05 Jun 2014, PHP 5.6.0 Beta 4
- Core:
. Fixed bug #67249 (printf out-of-bounds read). (Stas)
- Date:
. Fixed bug #67308 (Serialize of DateTime truncates fractions of second).
(Adam)
. Fixed regression in fix for bug #67118 (constructor can't be called twice).
(Remi)
- Fileinfo:
. Fixed bug #67327 (fileinfo: CDF infinite loop in nelements DoS).
. Fixed bug #67328 (fileinfo: fileinfo: numerous file_printf calls resulting in
performance degradation).
. Fixed bug #67326 (fileinfo: cdf_read_short_sector insufficient boundary check).
. Fixed bug #67329 (fileinfo: NULL pointer deference flaw by processing certain
CDF files).
- SPL:
. Fixed bug #67359 (Segfault in recursiveDirectoryIterator). (Laruence)
- phpdbg:
. Fixed bug which caused phpdbg to fail immediately on startup in non-debug
builds. (Bob)
15 May 2014, PHP 5.6.0 Beta 3
- Core:
. Fixed bug #67169 (array_splice all elements, then []= gives wrong index).
(Nikita)
. Fixed bug #67198 (php://input regression). (Mike)
. Fixed bug #67247 (spl_fixedarray_resize integer overflow). (Stas)
. Fixed bug #67250 (iptcparse out-of-bounds read). (Stas)
. Fixed bug #67252 (convert_uudecode out-of-bounds read). (Stas)
- Date:
. Fixed bug #67251 (date_parse_from_format out-of-bounds read). (Stas)
. Fixed bug #67253 (timelib_meridian_with_check out-of-bounds read). (Stas)
- GD:
. Fixed bug #67248 (imageaffinematrixget missing check of parameters). (Stas)
- OpenSSL:
. Fixed bug #67224 (Fall back to crypto_type from context if not specified
explicitly in stream_socket_enable_crypto). (Chris Wright)
- PCRE:
. Fixed bug #67238 (Ungreedy and min/max quantifier bug, applied patch
from the upstream). (Anatol)
- mbstring
. Fixed bug #67199 (mb_regex_encoding mismatch). (Yasuo)
01 May 2014, PHP 5.6.0 Beta 2
- CLI server:
. Fixed bug #67079 (Missing MIME types for XML/XSL files). (Anatol)
- COM:
. Fixed bug #66431 (Special Character via COM Interface (CP_UTF8)). (Anatol)
- Core:
. Fixed bug #65701 (copy() doesn't work when destination filename is created
by tempnam()). (Boro Sitnikovski)
. Fixed bug #66015 (Unexpected array indexing in class's static property). (Bob)
. Added (constant) string/array dereferencing to static scalar expressions
to complete the set; now possible thanks to bug #66015 being fixed. (Bob)
. Fixed bug #66568 (Update reflection information for unserialize() function).
(Ferenc)
. Fixed bug #66660 (Composer.phar install/update fails). (Ferenc)
. Fixed bug #67024 (getimagesize should recognize BMP files with negative
height). (Gabor Buella)
. Fixed bug #67064 (Countable interface prevents using 2nd parameter
($mode) of count() function). (Bob)
. Fixed bug #67072 (Echoing unserialized "SplFileObject" crash). (Anatol)
. Fixed bug #67033 (Remove reference to Windows 95). (Anatol)
- cURL:
. Fixed bug #64247 (CURLOPT_INFILE doesn't allow reset). (Mike)
. Fixed bug #66562 (curl_exec returns differently than curl_multi_getcontent).
(Freek Lijten)
- Date:
. Fixed bug #66721 (__wakeup of DateTime segfaults when invalid object data is
supplied). (Boro Sitnikovski)
. Fixed bug #67118 (DateTime constructor crash with invalid data). (Anatol)
- DOM:
. Fixed bug #67081 (DOMDocumentType->internalSubset returns entire DOCTYPE tag,
not only the subset). (Anatol)
- Fileinfo:
. Fixed bug #66907 (Solaris 10 is missing strcasestr and needs substitute).
(Anatol)
. Fixed bug #66307 (Fileinfo crashes with powerpoint files). (Anatol)
- FPM:
. Fixed bug #66482 (unknown entry 'priority' in php-fpm.conf).
. Fixed bug #66908 (php-fpm reload leaks epoll_create() file descriptor).
(Julio Pintos)
. Fixed bug #67060 (sapi/fpm: possible privilege escalation due to insecure
default configuration) (CVE-2014-0185). (Stas)
- GMP:
. Fixed crashes in serialize/unserialize. (Stas)
- JSON:
. Fixed bug #66021 (Blank line inside empty array/object when
JSON_PRETTY_PRINT is set). (Kevin Israel)
- LDAP:
. Fixed issue with null bytes in LDAP bindings. (Matthew Daley)
- litespeed
. Fixed bug #63228 (-Werror=format-security error in lsapi code).
(Elan Ruusamäe, George)
- mysqli:
. Fixed building against an external libmysqlclient. (Adam)
- mysqlnd:
. Added a new fetching mode to mysqlnd. (Andrey)
- OpenSSL:
. Fix bug #66942 (memory leak in openssl_seal()). (Chuan Ma)
. Fix bug #66952 (memory leak in openssl_open()). (Chuan Ma)
. Fix bug #66840 (Fix broken build when extension built separately).
(Daniel Lowrey)
- phpdbg:
. Added watchpoints (watch command). (Bob)
. Renamed some commands (next => continue and how to step). (Joe)
. Fixed issue #85 (https://github.com/krakjoe/phpdbg/issues/85)
(Added stdin/stdout/stderr constants and their php:// wrappers). (Bob)
- PDO:
. Fixed bug #66604 ('pdo/php_pdo_error.h' not copied to the include dir).
(Matteo)
- PDO-ODBC:
. Fixed bug #50444 (PDO-ODBC changes for 64-bit).
- Phar:
. Fix bug #64498 ($phar->buildFromDirectory can't compress file with an accent
in its name). (PR #588)
- SQLite:
. Fixed bug #66967 (Updated bundled libsqlite to 3.8.4.3). (Anatol)
- Apache2 Handler SAPI:
. Fixed Apache log issue caused by APR's lack of support for %zu
(APR issue https://issues.apache.org/bugzilla/show_bug.cgi?id=56120).
(Jeff Trawick)
10 Apr 2014, PHP 5.6.0 Beta 1
- Core:
. Allow zero length comparison in substr_compare() (Tjerk)
. Fixed bug #60602 (proc_open() changes environment array) (Tjerk)
. Fixed bug #61019 (Out of memory on command stream_get_contents). (Mike)
. Fixed bug #64330 (stream_socket_server() creates wrong Abstract Namespace
UNIX sockets). (Mike)
. Fixed bug #66182 (exit in stream filter produces segfault). (Mike)
. Fixed bug #66736 (fpassthru broken). (Mike)
. Fixed bug #66822 (Cannot use T_POW in const expression) (Tjerk)
. Fixed bug #67043 (substr_compare broke by previous change) (Tjerk)
- SPL:
. Added feature #65545 (SplFileObject::fread()) (Tjerk)
. Fixed bug #66834 (empty() does not work on classes that extend ArrayObject) (Tjerk)
. Fixed bug #66702 (RegexIterator::INVERT_MATCH does not invert). (Joshua
Thijssen)
- cURL:
. Fixed bug #66109 (Can't reset CURLOPT_CUSTOMREQUEST to default behaviour)
(Tjerk)
. Fix compilation on libcurl versions between 7.10.5 and 7.12.2, inclusive.
(Adam)
- Date:
. Added DateTimeImmutable::createFromMutable to create a DateTimeImmutable
object from an existing DateTime (mutable) object (Derick)
- Embed:
. Fixed bug #65715 (php5embed.lib isn't provided anymore). (Anatol).
- Fileinfo:
. Fixed bug #66820 (out-of-bounds memory access in fileinfo)
(CVE-2014-2270). (Remi)
. Fixed bug #66946i (fileinfo: extensive backtracking in awk rule regular
expression). (CVE-2013-7345) (Remi)
. Fixed bug #66987 (Memory corruption in fileinfo ext / bigendian).
(Remi)
- GD:
. Fixed bug #66815 (imagecrop(): insufficient fix for NULL defer
CVE-2013-7327). (Tomas Hoger, Remi).
. Fixed #66869 (Invalid 2nd argument crashes imageaffinematrixget) (Pierre)
. Fixed bug #66887 (imagescale - poor quality of scaled image). (Remi)
. Fixed bug #66890 (imagescale segfault). (Remi)
. Fixed bug #66893 (imagescale ignore method argument). (Remi)
- GMP:
. Fixed bug #66872 (invalid argument crashes gmp_testbit) (Pierre)
- Hash:
. Fixed bug #66698 (Missing FNV1a32 and FNV1a64 hash functions).
(Michael M Slusarz).
. Implemented timing attack safe string comparison function
(RFC: https://wiki.php.net/rfc/timing_attack). (Rouven Weßling)
. hash_pbkdf2() now works correctly if the $length argument is not specified.
(Nikita)
- Intl:
. Fixed bug #66873 (A reproductible crash in UConverter when given invalid
encoding) (Stas)
- Mail:
. Fixed bug #66535 (Don't add newline after X-PHP-Originating-Script) (Tjerk)
- Mbstring:
. Upgraded to oniguruma 5.9.5 (Anatol)
- Mcrypt:
. No longer allow invalid key sizes, invalid IV sizes or missing required IV
in mcrypt_encrypt, mcrypt_decrypt and the deprecated mode functions.
(Nikita)
. Use /dev/urandom as the default source for mcrypt_create_iv(). (Nikita)
- MySQLi:
. Fixed bug #66762 (Segfault in mysqli_stmt::bind_result() when link closed)
(Remi)
- OCI8
. Fixed Bug #66875 (Improve performance of multi-row OCI_RETURN_LOB queries)
(Perrier, Chris Jones)
- OpenSSL:
. Fixed memory leak in windows cert verification on verify failure.
(Chris Wright)
. Peer certificate capturing via SSL context options now functions even if
peer verification fails. (Daniel Lowrey)
. Encrypted TLS servers now support the server name indication TLS extension
via the new "SNI_server_certs" SSL context option. (Daniel Lowrey)
. Fixed bug #66833 (Default disgest algo is still MD5, switch to SHA1). (Remi)
- PCRE:
. Added support for (*MARK) backtracking verbs. (Nikita)
- PDO_firebird:
. Fixed Bug #66071 (memory corruption in error handling) (Popa)
- PDO_pgsql:
. Cleaned up code by increasing the requirements to libpq versions providing
PQexecParams, PQprepare, PQescapeStringConn, PQescapeByteaConn. According
to the release notes that means 8.0.8+ or 8.1.4+. (Matteo)
. Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, an
undocument constant effectively equivalent to PDO::ATTR_EMULATE_PREPARES.
(Matteo)
. Added PDO::PGSQL_ATTR_DISABLE_PREPARES constant to execute the queries
without preparing them, while still passing parameters separately from
the command text using PQexecParams. (Matteo)
- Pgsql:
. Read-only access to the socket stream underlying database connections is
exposed via a new pg_socket() function to allow read/write polling when
establishing asynchronous connections and executing queries in non-blocking
applications. (Daniel Lowrey)
. Asynchronous connections are now possible using the PGSQL_CONNECT_ASYNC
flag in conjunction with a new pg_connect_poll() function and connection
polling status constants. (Daniel Lowrey)
. New pg_flush() and pg_consume_input() functions added to manually complete
non-blocking reads/writes to underlying connection sockets. (Daniel Lowrey)
- Session
. Remove session_gc() and session_serializer_name() wich were introduced in the first 5.6.0 alpha.
- SimpleXML:
. Fixed bug #66084 (simplexml_load_string() mangles empty node name)
(Anatol)
- SQLite:
. Updated the bundled libsqlite to the version 3.8.3.1 (Anatol)
- XSL:
. Fixed bug #53965 (<xsl:include> cannot find files with relative paths
when loaded with "file://"). (Anatol)
27 Feb 2014, PHP 5.6.0 Alpha 3
- Core
. Expose get_debug_info class hook as __debugInfo() magic method. (Sara)
. Implemented unified default encoding
(RFC: https://wiki.php.net/rfc/default_encoding). (Yasuo Ohgaki)
- Curl
. Check for openssl.cafile ini directive when loading CA certs. (Daniel Lowrey)
. Remove cURL close policy related constants as these have no effect and are
no longer used in libcurl. (Chris Wright)
- Fileinfo
. Upgraded to libmagic-5.17 (Anatol)
. Fixed bug #66731 (file: infinite recursion). (CVE-2014-1943) (Remi)
- FPM:
. Added clear_env configuration directive to disable clearenv() call.
(Github PR# 598, Paul Annesley)
- GD:
. Fixed imagettftext to load the correct character map rather than the last one.
(Scott)
. Fixed bug #66714 ( imageconvolution breakage). (Brad Daily)
- JSON:
. Fixed bug #65753 (JsonSerializeable couldn't implement on module extension)
(chobieeee@php.net)
- OPCache
. Added function opcache_is_script_cached(). (Danack)
. Added information about interned strings usage. (Terry, Julien, Dmitry)
- OpenSSL
. Fallback to Windows CA cert store for peer verification if no openssl.cafile
ini directive or "cafile" SSL context option specified in Windows.
(Chris Wright)
. The openssl.cafile and openssl.capath ini directives introduced in alpha2
now have PHP_INI_PERDIR accessibility (was PHP_INI_ALL). (Daniel Lowrey)
. New "peer_name" SSL context option replaces "CN_match" (which still works
as before but triggers E_DEPRECATED). (Daniel Lowrey)
. Fixed segfault when accessing non-existent context for client SNI use
(Daniel Lowrey)
. Fixed bug #66501 (Add EC key support to php_openssl_is_private_key).
(Mark Zedwood)
. Fixed Bug #47030 (add new boolean "verify_peer_name" SSL context option
allowing clients to verify cert names separately from the cert itself).
"verify_peer_name" is enabled by default for client streams.
(Daniel Lowrey)
. Fixed Bug #65538 ("cafile" SSL context option now supports stream
wrappers). (Daniel Lowrey)
. New openssl_get_cert_locations() function to aid CA file and peer
verification debugging. (Daniel Lowrey)
. Encrypted stream wrappers now disable TLS compression by default.
(Daniel Lowrey)
. New "capture_session_meta" SSL context option allows encrypted client and
server streams access to negotiated protocol/cipher information.
(Daniel Lowrey)
. New "honor_cipher_order" SSL context option allows servers to prioritize
cipher suites of their choosing when negotiating SSL/TLS handshakes.
(Daniel Lowrey)
. New "single_ecdh_use" and "single_dh_use" SSL context options allow for
improved forward secrecy in encrypted stream servers. (Daniel Lowrey)
. New "dh_param" SSL context option allows stream servers control over
the parameters when negotiating DHE cipher suites. (Daniel Lowrey)
. New "ecdh_curve" SSL context option allowing stream servers to specify
the curve to use when negotiating ephemeral ECDHE ciphers (defaults to
NIST P-256). (Daniel Lowrey)
. New "rsa_key_size" SSL context option gives stream servers control
over the key size (in bits) used for RSA key agreements. (Daniel Lowrey)
. Crypto methods for encrypted client and server streams now use
bitwise flags for fine-grained protocol support. (Daniel Lowrey)
. Added new tlsv1.0 stream wrapper to specify TLSv1 client/server method.
tls wrapper now negotiates TLSv1, TLSv1.1 or TLSv1.2. (Daniel Lowrey)
. Encrypted client streams now enable SNI by default. (Daniel Lowrey)
. Encrypted streams now prioritize ephemeral key agreement and high strength
ciphers by default. (Daniel Lowrey)
. New OPENSSL_DEFAULT_STREAM_CIPHERS constant exposes default cipher
list. (Daniel Lowrey)
. New STREAM_CRYPTO_METHOD_* constants for enhanced control over the crypto
methods negotiated encrypted server/client sessions. (Daniel Lowrey)
. Encrypted stream servers now automatically mitigate potential DoS vector
arising from client-initiated TLS renegotiation. New "reneg_limit",
"reneg_window" and "reneg_limit_callback" SSL context options for custom
renegotiation limiting control. (Daniel Lowrey)
- Pgsql:
. pg_insert()/pg_select()/pg_update()/pg_delete() are no longer EXPERIMENTAL.
(Yasuo)
. Impremented FR #25854 Return value for pg_insert should be resource instead of bool.
(Yasuo)
. Implemented FR #41146 - Add "description" with exteneded flag pg_meta_data().
pg_meta_data(resource $conn, string $table [, bool extended])
It also made pg_meta_data() return "is enum" always.
(Yasuo)
13 Feb 2014, PHP 5.6.0 Alpha 2
- Core:
. Added T_POW (**) operator
(RFC: https://wiki.php.net/rfc/pow-operator). (Tjerk Meesters)
- mysqli
. Added new function mysqli_get_links_stats() as well as new INI variable
mysqli.rollback_on_cached_plink of type bool (Andrey)
- PCRE:
. Upgraded to PCRE 8.34. (Anatol)
- ldap
. Added new function ldap_modify_batch(). (Ondrej Hosek)
- OpenSSL
. Peer certificates now verified by default in client socket operations
(RFC: https://wiki.php.net/rfc/tls-peer-verification). (Daniel Lowrey)
. New openssl.cafile and openssl.capath ini directives. (Daniel Lowrey)
23 Jan 2014, PHP 5.6.0 Alpha 1
- CLI server:
. Added some MIME types to the CLI web server. (Chris Jones)
- Core:
. Improved IS_VAR operands fetching. (Laruence, Dmitry)
. Improved empty string handling. Now ZE uses an interned string instead of
allocation new empty string each time. (Laruence, Dmitry)
. Implemented internal operator overloading
(RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita)
. Made calls from incompatible context issue an E_DEPRECATED warning instead
of E_STRICT (phase 1 of RFC: https://wiki.php.net/rfc/incompat_ctx).
(Gustavo)
. Uploads equal or greater than 2GB in size are now accepted.
(Ralf Lang, Mike)
. Reduced POST data memory usage by 200-300%. Changed INI setting
always_populate_raw_post_data to throw a deprecation warning when enabling
and to accept -1 for never populating the $HTTP_RAW_POST_DATA global
variable, which will be the default in future PHP versions. (Mike)
. Implemented dedicated syntax for variadic functions
(RFC: https://wiki.php.net/rfc/variadics). (Nikita)
. Fixed bug #50333 Improving multi-threaded scalability by using
emalloc/efree/estrdup (Anatol, Dmitry)
. Implemented constant scalar expressions (with support for constants)
(RFC: https://wiki.php.net/rfc/const_scalar_exprs). (Bob)
. Fixed bug #65784 (Segfault with finally). (Laruence, Dmitry)
. Fixed bug #66509 (copy() arginfo has changed starting from 5.4). (willfitch)
- cURL:
. Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir
or safe_mode). (Adam)
- FPM
. Included apparmor support in fpm
(RFC: https://wiki.php.net/rfc/fpm_change_hat). (Gernot Vormayr)
- GMP:
. Moved GMP to use object as the underlying structure and implemented various
improvements based on this.
(RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita)
. Added gmp_root() and gmp_rootrem() functions for calculating nth roots.
(Nikita)
- Hash:
. Added gost-crypto (CryptoPro S-box) GOST hash algo. (Manuel Mausz)
- JSON:
. Fixed case part of bug #64874 ("json_decode handles whitespace and
case-sensitivity incorrectly")
- mysqlnd:
. Disabled flag for SP OUT variables for 5.5+ servers as they are not natively
supported by the overlying APIs. (Andrey)
- OPcache:
. Added an optimization of class constants and constant calls to some
internal functions (Laruence, Dmitry)
. Added an optimization pass to convert FCALL_BY_NAME into DO_FCALL.
(Laruence, Dmitry)
. Added an optimization pass to merged identical constants (and related
cache_slots) in op_array->literals table. (Laruence, Dmitry)
. Added script level constant replacement optimization pass. (Dmitry)
- OpenSSL:
. Added crypto_method option for the ssl stream context. (Martin Jansen)
. Added certificate fingerprint support. (Tjerk Meesters)
. Added explicit TLSv1.1 and TLSv1.2 stream transports. (Daniel Lowrey)
. Fixed bug #65729 (CN_match gives false positive). (Tjerk Meesters)
. Peer name verification matches SAN DNS names for certs using
the Subject Alternative Name x509 extension. (Daniel Lowrey)
. Fixed segfault when built against OpenSSL>=1.0.1 (Daniel Lowrey)
. Added SPKAC support. (Jason Gerfen)
- PDO_pgsql:
. Fixed Bug #42614 (PDO_pgsql: add pg_get_notify support). (Matteo)
. Fixed Bug #63657 (pgsqlCopyFromFile, pgsqlCopyToArray use Postgres < 7.3
syntax). (Matteo)
- phpdbg:
. Included phpdbg sapi (RFC: https://wiki.php.net/rfc/phpdbg).
(Felipe Pena, Joe Watkins and Bob Weinand)
- pgsql:
. pg_version() returns full report which obtained by PQparameterStatus().
(Yasuo)
. Added pg_lo_truncate(). (Yasuo)
. Added 64bit large object support for PostgreSQL 9.3 and later. (Yasuo)
- Session:
. Fixed Bug #65315 (session.hash_function silently fallback to default md5)
(Yasuo)
. Implemented Request #17860 (Session write short circuit). (Yasuo)
. Implemented Request #20421 (session_abort() and session_reset() function).
(Yasuo)
- Standard:
. Implemented FR #65634 (HTTP wrapper is very slow with protocol_version
1.1). (Adam)
. Implemented Change crypt() behavior w/o salt RFC. (Yasuo)
https://wiki.php.net/rfc/crypt_function_salt
. Implemented request #49824 (Change array_fill() to allow creating empty
array). (Nikita)
- XMLReader:
. Fixed bug #55285 (XMLReader::getAttribute/No/Ns methods inconsistency).
(Mike)
- Zip:
. update libzip to version 1.11.2.
PHP don't use any ilibzip private symbol anymore. (Pierre, Remi)
. new method ZipArchive::setPassword($password). (Pierre)
. add --with-libzip option to build with system libzip. (Remi)
. new methods:
ZipArchive::setExternalAttributesName($name, $opsys, $attr [, $flags])
ZipArchive::setExternalAttributesIndex($idx, $opsys, $attr [, $flags])
ZipArchive::getExternalAttributesName($name, &$opsys, &$attr [, $flags])
ZipArchive::getExternalAttributesIndex($idx, &$opsys, &$attr [, $flags])
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
+18 -17
View File
@@ -17,7 +17,7 @@ Online Forums
-------------
There are several IRC channels where PHP developers are often
available to discuss questions. They include #php.pecl and #php.doc
on the EFNet network and #php-dev-win on FreeNode.
on the EFNet network and #winphp-dev on FreeNode.
PHP Patches
@@ -33,16 +33,27 @@ and discuss it on the development mail list internals@lists.php.net.
RFC Wiki accounts can be requested on
http://wiki.php.net/start?do=register. PHP extension maintainers can
be found in the EXTENSIONS file in the PHP source. Mail list
subscription is explained on http://www.php.net/mailing-lists.php.
subscription is explained on http://php.net/mailing-lists.php.
Information on PHP internal C functions is at
http://www.php.net/internals, though this is considered incomplete.
Various external resources can be found on the web. A standard
http://php.net/internals, though this is considered incomplete.
Various external resources can be found on the web. See
https://wiki.php.net/internals for some references. A standard
printed reference is the book "Extending and Embedding PHP" by Sara
Golemon.
Attach the patch to the PHP bug and consider sending a notification
email about the change to internals@lists.php.net. Also CC the
The preferred way to propose PHP patch is sending pull request from
GitHub: https://github.com/php/php-src
Fork the official PHP repository and send a pull request. A
notification will be sent to the pull request mailing list. Sending a
note to PHP Internals list (internals@lists.php.net) may help getting
more feedback and quicker turnaround. You can also add pull requests
to bug reports at http://bugs.php.net/.
If you are not using GitHub, attach your patch to a PHP bug and
consider sending a notification email about the change to
internals@lists.php.net. If the bug is for an extension, also CC the
extension maintainer. Explain what has been changed by your patch.
Test scripts should be included.
@@ -50,16 +61,6 @@ Please make the mail subject prefix "[PATCH]". If attaching a patch,
ensure it has a file extension of ".txt". This is because only MIME
attachments of type 'text/*' are accepted.
The preferred way to propose PHP patch is sending pull request from
github.
https://github.com/php/php-src
Fork the official PHP repository and send a pull request. A
notification will be sent to the pull request mailing list. Sending a
note to PHP Internals list (internals@lists.php.net) may help getting
more feedback and quicker turnaround. You can also add pull requests
to bug reports at http://bugs.php.net/.
PHP Documentation Patches
@@ -71,7 +72,7 @@ the PHP mail archives.
If your change is large, then first discuss it with the mail list
phpdoc@lists.php.net. Subscription is explained on
http://www.php.net/mailing-lists.php.
http://php.net/mailing-lists.php.
Information on contributing to PHP documentation is at
http://php.net/dochowto and http://wiki.php.net/doc/howto
+1 -1
View File
@@ -64,7 +64,7 @@ typedef int ts_rsrc_id;
/* Define THREAD_T and MUTEX_T */
#ifdef TSRM_WIN32
# define THREAD_T DWORD
# define THREAD_T UINT_PTR
# define MUTEX_T CRITICAL_SECTION *
#elif defined(GNUPTH)
# define THREAD_T pth_t
+23 -415
View File
@@ -1,6 +1,6 @@
$Id$
PHP 5.6 UPGRADE NOTES
PHP X.Y UPGRADE NOTES
1. Backward Incompatible Changes
2. New Features
@@ -13,287 +13,49 @@ PHP 5.6 UPGRADE NOTES
9. Other Changes to Extensions
10. New Global Constants
11. Changes to INI File Handling
12. Other Changes
12. Windows Support
13. Other Changes
========================================
1. Backward Incompatible Changes
========================================
- Core:
By fixing bug #66015 it is no longer possible to overwrite keys in static scalar
arrays. Quick example to illustrate:
class Test {
const FIRST = 1;
public $array = array(
self::FIRST => 'first',
'second',
'third'
);
}
Test::$array will have as expected three array keys (1, 2, 3) and no longer
two (0, 1). self::FIRST will no longer overwrite 'third' having key 1 then,
but will mark the beginning of indexing.
- JSON:
json_decode() no longer accepts non-lowercase variants of lone JSON true,
false or null values. For example, True or FALSE will now cause json_decode to
return NULL and set an error value you can fetch with json_last_error().
This affects JSON texts consisting solely of true, false or null. Text
containing non-lowercase values inside JSON arrays or objects has never been
accepted.
- OpenSSL:
To prevent man-in-the-middle attacks against encrypted transfers client
streams now verify peer certificates by default. Previous versions
required users to manually enable peer verification. As a result of this
change, existing code using ssl:// or tls:// stream wrappers (e.g.
file_get_contents(), fsockopen(), stream_socket_client()) may no longer
connect successfully without manually disabling peer verification via the
stream context's "verify_peer" setting. Encrypted transfers delegate to
operating system certificate stores by default if not overridden via the
new openssl.cafile and openssl.cafile ini directives or via call-time SSL
context options, so most users should be unaffected by this transparent
security enhancement. (https://wiki.php.net/rfc/tls-peer-verification)
- Mcrypt:
The mcrypt_encrypt(), mcrypt_decrypt() and mcrypt_{MODE}() functions no
longer accept keys or IVs with incorrect sizes. Furthermore an IV is now
required if the used block cipher mode requires it.
- DBA
. dba_delete() now returns false if the key was not found for the inifile
handler, too.
========================================
2. New Features
========================================
- Added constant scalar expressions syntax.
(https://wiki.php.net/rfc/const_scalar_exprs)
- Core
. Support for strings with length >= 2^31 bytes in 64 bit builds
- Added dedicated syntax for variadic functions.
(https://wiki.php.net/rfc/variadics)
- Added support for argument unpacking to complement the variadic syntax.
(https://wiki.php.net/rfc/argument_unpacking)
- Added an exponentiation operator (**).
(https://wiki.php.net/rfc/pow-operator)
- Added unified default encoding. default_charset=UTF-8 and functions/extensions
use encoding settings honor default_charset.
- The php://input stream is now re-usable and can be used concurrently with
enable_post_data_reading=0.
- Added use function and use const.
(https://wiki.php.net/rfc/use_function)
- Added a function for timing attack safe string comparison
(https://wiki.php.net/rfc/timing_attack)
- Added the __debugInfo() magic method to allow userland classes to implement
the get_debug_info API previously available only to extensions.
(https://wiki.php.net/rfc/debug-info)
- Added gost-crypto (CryptoPro S-box) hash algorithm.
- Stream wrappers verify peer certificates and host names by default in
encrypted client streams.
- Added openssl certificate fingerprint support (inclusive stream context
option).
- Added support for SAN x509 extension matching when verifing host names in
encrypted streams.
- Added a range of new SSL context options for improved encrypted stream
server security (https://wiki.php.net/rfc/improved-tls-defaults):
. "honor_cipher_order" allows servers to prioritize cipher suites of their
choosing when negotiating SSL/TLS handshakes.
. "single_ecdh_use" and "single_dh_use" allow for improved forward
secrecy in encrypted stream servers.
. "dh_param" allows specification of pre-generated key generation
parameters when negotiating ephemeral DHE ciphers in stream servers.
. "ecdh_curve" allows stream servers to specify which curve to use when
negotiating ephemeral ECDHE ciphers (defaults to NIST P-256).
. "rsa_key_size" SSL context option gives stream servers control
over the key size (in bits) used when negotiating RSA ciphers.
. "capture_session_meta" if specified stores an array of data describing
the TLS session's protocol/cipher in the "session_meta" SSL context key.
- Added automatic mitigation against client-initated TLS renegotiation DoS
attacks in encrypted server streams. Renegotiation limiting may be
customized via three new SSL context options:
. "reneg_limit" (number of allowed renegotiations per time window)
. "reneg_window" (renegotiation time window in seconds)
. "reneg_limit_callback" (optional notification callback on limiting)
- Encrypted TLS servers now support the server name indication (SNI) TLS
extension via the new "SNI_server_certs" SSL context option.
- Added "crypto_method" SSL context option for use in encrypted streams.
- Added "peer_name" SSL context option to better reflect peer certificate
name matching using SAN extension (replaces deprecated "CN_match").
- Added stream wrapper support when specifying "cafile" SSL context paths.
- Independent peer cert and peer name validation is now available via a new
boolean "verify_peer_name" SSL context option. This option is enabled by
default in encrypted client streams.
- Added protocol-specific tlsv1.0://, tlsv1.1:// and tlsv1.2:// encryption
stream wrappers. tls:// wrapper now supports TLSv1.1 and TLSv1.2 (previously
only supported TLSv1).
- Stream crypto method specification now accepts flags instead of values
allowing support for multiple discrete protocols in a given stream.
- PostgreSQL database connections may now be established asynchronously using
new constants and polling functions in ext/pgsql.
- Non-blocking read/write query behavior now optionally available in database
operations using the ext/pgsql extension.
- Standard
. intdiv() function for integer division added.
========================================
3. Changes in SAPI modules
========================================
- Added phpdbg SAPI.
(https://wiki.php.net/rfc/phpdbg)
- Support for FPM workers changing the apparmor profile through the pool configuration.
(https://wiki.php.net/rfc/fpm_change_hat)
- Support for several XML MIME types in the built-in CLI server. For static
files with extensions .xml, .xsl, .xsd the Content-Type header
application/xml is now sent automatically.
- FPM
. Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes).
========================================
4. Deprecated Functionality
========================================
- Incompatible context calls:
Instance calls from an incompatible context are now deprecated and issue
E_DEPRECATED instead of E_STRICT. See https://wiki.php.net/rfc/incompat_ctx
- The "CN_match" and "SNI_server_name" SSL context options are deprecated in
favor of the new "peer_name" option. Name verification now checks certificate
SAN names as well as the CN field and the specific name fields are deprecated
to avoid confusion. Their use triggers E_DEPRECATED but continues to work as
before. If specified, the specific values take precedence over the general
"peer_name" value.
- Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, an
undocument constant effectively equivalent to PDO::ATTR_EMULATE_PREPARES.
- Deprecated INIs: Following INIs are deprecated in favour of new
internal_encoding/input_encoding/output_encoding. Refer to "Changes to
encodings in PHP 5.6" in "11. Other Changes" section for more details.
iconv.input_encoding
iconv.output_encoding
iconv.internal_encoding
mbstring.http_input
mbstring.http_output
mbstring.internal_encoding
========================================
5. Changed Functions
========================================
- cURL:
CURLOPT_SAFE_UPLOAD is now turned on by default and uploads with @file
do not work unless it is explicitly set to false.
curl_setopt() now supports the following nullable settings (>= 5.5.11):
. CURLOPT_CUSTOMREQUEST
. CURLOPT_FTPPORT
. CURLOPT_RANGE
. CURLOPT_FTP_ACCOUNT
. CURLOPT_RTSP_SESSION_ID
. CURLOPT_KRBLEVEL
. CURLOPT_KRB4LEVEL
- Strings:
substr_compare() now allows $length to be zero.
- Crypt:
crypt() will now raise an E_NOTICE error if the salt parameter is omitted.
See: https://wiki.php.net/rfc/crypt_function_salt
- Mcrypt:
The $source parameter of mcrypt_create_iv() now defaults to
MCRYPT_DEV_URANDOM instead of MCRYPT_DEV_RANDOM.
- OpenSSL:
The $crypto_type parameter is now optional in stream_socket_enable_crypto()
if the stream's SSL context specifies the new "crypto_type" option. The
crypto method from the context is used as a fallback if no crypto method is
specified at call-time.
- Reflection:
ReflectionClass::newInstanceWithoutConstructor previously didn't allow the
instantiation of any internal class which used custom object storage
(overriding the default create_object handler), this was changed to only
reject the instantiation of such classes if the class is also marked as
final.
- XMLReader:
XMLReader::getAttributeNs and XMLReader::getAttributeNo now return NULL if
the attribute could not be found, just like XMLReader::getAttribute.
- Pgsql:
pg_insert()/pg_select()/pg_update()/pg_delete() are no longer EXPERIMENTAL.
The following functions no longer block until query write completion if the
socket stream underlying a database connection is set to non-blocking mode:
. pg_send_execute()
. pg_send_prepare()
. pg_send_query()
. pg_send_query_params()
- unserialize:
Manipulated serialization strings for objects implementing Serializable by
replacing "C:" with "O:" at the start will now produce an error.
========================================
6. New Functions
========================================
- GMP:
Added gmp_root($a, $nth) and gmp_rootrem($a, $nth) for calculating nth roots.
- Hash
Added hash_equals($known_string, $user_string)
- OpenSSL:
Added string openssl_x509_fingerprint($x509, $type, $binary).
Added string openssl_spki_new($private_key, $challenge, $algorithm)
Added bool openssl_spki_verify($spkac)
Added string openssl_spki_export($spkac)
Added string openssl_spki_export_challenge($spkac)
Added array openssl_get_cert_locations()
- LDAP:
Added ldap_escape($value, $ignore = "", $flags = 0).
Added ldap_modify_batch($link_identifier, $dn, $modifications) described in
https://wiki.php.net/rfc/ldap_modify_batch.
- Pgsql:
Added pg_socket($connection) to allow async connections and non-blocking IO
Added pg_connect_poll($connection) for establishing async connections
Added pg_consume_input($connection) for non-blocking query result consumption
Added pg_flush($connection) for non-blocking query write completion
- PDO_pgsql
Added PDO::pgsqlGetNotify($result_type = PDO::FETCH_USE_DEFAULT, $ms_timeout = 0)
Added PDO::pgsqlGetPid()
- Zip:
Added ZipArchive::setPassword($password)
- SPL
Added SplFileObject::fread($length) to complement fwrite() method (>= 5.5.11)
========================================
7. New Classes and Interfaces
@@ -309,183 +71,29 @@ PHP 5.6 UPGRADE NOTES
9. Other Changes to Extensions
========================================
- cURL:
- The following constants have been removed as they are now marked "obsolete"
in the underlying library and never had any effect to begin with:
. CURLOPT_CLOSEPOLICY
. CURLCLOSEPOLICY_CALLBACK
. CURLCLOSEPOLICY_LEAST_RECENTLY_USED
. CURLCLOSEPOLICY_LEAST_TRAFFIC
. CURLCLOSEPOLICY_OLDEST
. CURLCLOSEPOLICY_SLOWEST
- GMP:
The GMP extension now uses objects as the underlying data structure, rather
than resources. GMP instances now support dumping, serialization, cloning,
casts to primitive types and have overloaded operators.
(RFC: https://wiki.php.net/rfc/operator_overloading_gmp)
- OCI8:
- Added Implicit Result Set support for Oracle Database 12c with a
new oci_get_implicit_resultset() function.
- Using 'oci_execute($s, OCI_NO_AUTO_COMMIT)' for a SELECT no longer
unnecessarily initiates an internal ROLLBACK during connection
close.
- Multi-row OCI_RETURN_LOB queries require fewer "round trips" to the database.
- Added DTrace probes enabled with PHP's generic --enable-dtrace
- The oci_internal_debug() function is now a no-op.
- The phpinfo() output format for OCI8 has changed.
- OpenSSL:
- The "SNI_enabled" SSL stream context option is now set to TRUE by default
if supported by the underlying openssl library.
- PCRE:
- The information collected by the (*MARK) backtracking control verb is now
collected into the "MARK" index of the $matches array for preg_match(),
preg_match_all() and preg_replace_callback().
- Pgsql:
- pg_insert()/pg_select()/pg_update()/pg_delete()/pg_meta_data()/pg_convert()
are no longer EXPERIMENTAL
- Added PGSQL_DML_ESCAPE option for pg_insert()/pg_select()/pg_update()/pg_delete()
that simply escapes all supplied parameters. These functions can be as fast as
native query. Unvalidated data(Unknown data types) is passed as string.
JSON/Array/etc are supported both PGSQL_DML_ESCAPE and pg_convert() as string.
- pg_select() returns PostgreSQL query resource when query is executed.
- Added extended flag parameter for pg_meta_data(). pg_meta_data() always
returns "is enum" attribute.
- The new pg_socket() function returns a socket stream with no behavior other
than to allow IO-readiness polling on a DB connection socket. Calling
stream_set_blocking() on its result enables non-blocking behavior.
- Passing the new PGSQL_CONNECT_ASYNC flag to pg_connect() allows applications
to poll for IO readiness via pg_connect_poll() and establish connections
asynchronously.
- PDO_pgsql:
- Added PDO::PGSQL_ATTR_DISABLE_PREPARES constant to execute the queries
without preparing them, while still passing parameters separately from
the command text using PQexecParams.
- Added LISTEN/NOTIFY support via PDO::pgsqlGetNotify / PDO::pgsqlGetPid()
as described in https://bugs.php.net/bug.php?id=42614.
========================================
10. New Global Constants
========================================
- LDAP:
LDAP_ESCAPE_FILTER int(1)
LDAP_ESCAPE_DN int(2)
- Pgsql:
PGSQL_DML_ESCAPE int(4096)
PGSQL_CONNECT_ASYNC
PGSQL_CONNECTION_STARTED
PGSQL_CONNECTION_MADE
PGSQL_CONNECTION_AWAITING_RESPONSE
PGSQL_CONNECTION_AUTH_OK
PGSQL_CONNECTION_SSL_STARTUP
PGSQL_CONNECTION_SETENV
PGSQL_POLLING_FAILED
PGSQL_POLLING_READING
PGSQL_POLLING_WRITING
PGSQL_POLLING_OK
PGSQL_POLLING_ACTIVE
- OpenSSL:
STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT int(9)
STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT int(17)
STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT int(33)
STREAM_CRYPTO_METHOD_ANY_CLIENT int(63)
STREAM_CRYPTO_METHOD_TLSv1_0_SERVER int(8)
STREAM_CRYPTO_METHOD_TLSv1_1_SERVER int(16)
STREAM_CRYPTO_METHOD_TLSv1_2_SERVER int(32)
STREAM_CRYPTO_METHOD_ANY_SERVER int(62)
OPENSSL_DEFAULT_STREAM_CIPHERS string
- Core
. PHP_INT_MIN added.
========================================
11. Changes to INI File Handling
========================================
- Core:
Changed always_populate_raw_post_data to throw a deprecation warning when
enabled and to recognize the value -1 for never populating the global
$HTTP_RAW_POST_DATA variable, which will be default in future PHP versions.
default_charset is set to UTF-8. It was empty previously. default_charset
is used where it is applicable. Iconv/Mbstring/htmlentities/htmlspecialchars/
html_entity_decode use default_charset as default encoding.
internal_encoding/input_encoding/output_encoding is added for encoding
handling modules. Refer to "Changes to encodings in PHP 5.6" in "11. Other Changes"
section for more details.
- cURL:
If the new openssl.cafile ini directive is specified ext/curl will give the
openssl path precedence over its own curl.cainfo directive.
- OpenSSL:
openssl.cafile and openssl.capath ini directives have been added to allow
global CA default specification as necessary.
========================================
12. Other Changes
12. Windows Support
========================================
- File upload:
Uploads equal or greater than 2GB in size are now accepted.
- Core
. Support for native 64 bit integers in 64 bit builds
. Support for large files in 64 bit builds
- HTTP stream wrapper:
HTTP 1.1 requests now include a Connection: close header unless explicitly
overridden by setting a Connection header via the header context option.
- PDO_pgsql
A libpq version providing PQexecParams, PQprepare, PQescapeStringConn,
PQescapeByteaConn is now required. According to the release notes that means
8.0.8+ or 8.1.4+.
- Zip:
New --with-libzip option allow to use system libzip. Version > 0.11 required,
Version >= 0.11.2 recommended for all features.
- Changes to encodings in PHP 5.6
The default value of default_charset is now UTF-8 when it is not
explicitly set in php.ini
The following php.ini parameters were added:
internal_encoding
input_encoding
output_encoding
The values of the following php.ini parameters have become empty in
PHP 5.6 (previously they were all ISO-8859-1)
iconv.input_encoding
iconv.output_encoding
iconv.internal_encoding
Changes were made to character set handling in:
- the iconv and mbstring extensions,
- and htmlentities(), htmlspecialchars(), html_entity_decode() functions
The precedence for these is now:
default_charset < internal/input/output_encoding < (mbstring.* || iconv.*) < function parameter
For example, the easiest way to use the UTF-8 encoding is to set
default_charset=UTF-8 and leave the following php.ini parameters
empty:
iconv.input_encoding
iconv.output_encoding
iconv.internal_encoding
mbstring.http_input
mbstring.http_output
mbstring.internal_encoding
internal_encoding
input_encoding
output_encoding
The mb_regex_encoding() default setting is changed from EUC-JP to UTF-8.
========================================
13. Other Changes
========================================
- Standard
. call_user_method() and call_user_method_array() no longer exists.
+70 -180
View File
@@ -7,13 +7,12 @@ UPGRADE NOTES - PHP X.Y
b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros
c. POST data handling
d. Arginfo changes
e. tsrm_virtual_cwd.h moved to zend_virtual_cwd.h
f. empty strings are interned
g. Additional str_* APIs
h. Addition of zend_hash_reindex
i. Addition of zend_hash_splice
j. Unserialization of manipulated object strings
k. Removal of IS_CONSTANT_ARRAY and IS_CONSTANT_INDEX hack
e. New data types
f. zend_parse_parameters() specs
g. sprintf() formats
h. HashTable API
i. New portable macros for large file support
j. New portable macros for integers
2. Build system changes
a. Unix build system changes
@@ -24,202 +23,93 @@ UPGRADE NOTES - PHP X.Y
1. Internal API changes
========================
a. Addition of do_operation and compare object handlers
a. zend_set_memory_limit() now takes the TSRMLS_CC macro as its last argument
e. New data types
Two new object handlers have been added:
String
do_operation:
typedef int (*zend_object_do_operation_t)(
zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC
);
Besides the old way of accepting the strings with 's', the new 'S' ZPP spec
was introduced. It expects an argument of the type zend_string *. String lengths
in it do no more depend on the firm 'int' datatype. The replacement
is a platform dependent size_t datatype called php_size_t.
compare:
typedef int (*zend_object_compare_zvals_t)(
zval *result, zval *op1, zval *op2 TSRMLS_DC
);
String length is defined as zend_size_t inside Zend and aliased as php_size_t
anywhere else. The inclusion of php.h is necessary.
The first handler is used to overload arithmetic operations. The first
argument specifies the opcode of the operator, result is the target zval,
op1 the first operand and op2 the second operand. For unary operations
op2 is NULL. If the handler returns FAILURE PHP falls back to the default
behavior for the operation.
Integer types
The second handler is used to perform comparison operations with
non-objects. The value written into result must be an IS_LONG with value
-1 (smaller), 0 (equal) or 1 (greater). The return value is a SUCCESS/FAILURE
return code. The difference between this handler and compare_objects is
that it will be triggered for comparisons with non-objects and objects of
different types. It takes precedence over compare_objects.
Integers do no more depend on the firm 'long' type. Instead a platform
dependent integer type is used. That datatype is defined dynamically to
guarantee the consistent 64 bit support. The zval field representing user
land integer it bound to php_int_t.
Further docs in the RFC: https://wiki.php.net/rfc/operator_overloading_gmp
Signed integer is defined as zend_int_t, unsigned integer as zend_uint_t
inside Zend. Both are aliased as php_int_t and php_uint_t anywhere else,
respectively. The inclusion of php.h is necessary.
b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros
Other datatypes
The return_value_ptr argument to internal functions is now always set.
Previously it was only available for functions returning by-reference.
return_value_ptr can now be used to return zvals without copying them.
For this purpose two new macros are provided:
zend_off_t - portable off_t analogue
zend_stat_t - portable 'struct stat' analogue
RETVAL_ZVAL_FAST(zv); /* analog to RETVAL_ZVAL(zv, 1, 0) */
RETURN_ZVAL_FAST(zv); /* analog to RETURN_ZVAL(zv, 1, 0) */
These datatypes are declared to be portable across platforms. Thus, direct
usage of the functions like fseek, stat, etc. as well as direct usage of
off_t and struct stat is strongly not recommended. Instead the portable
macros should be used.
The macros behave similarly to the non-FAST variants with copy=1 and
dtor=0, but will try to return the zval without making a copy by utilizing
return_value_ptr.
c. POST data handling
The sapi_request_info's members post_data, post_data_len and raw_post_data as
well as raw_post_data_len have been replaced with a temp PHP stream
request_body.
The recommended way to access raw POST data is to open and use a php://input
stream wrapper. It is safe to be used concurrently and more than once.
zend_fseek - portable fseek equivalent
zend_ftell - portable ftell equivalent
zend_lseek - portable lseek equivalent
zend_fstat - portable fstat equivalent
zend_stat - portable stat equivalent
d. Arginfo changes
f. zend_parse_parameters() specs
The pass_rest_by_reference argument of the ZEND_BEGIN_ARG_INFO and
ZEND_BEGIN_ARG_INFO_EX() is no longer used. The value passed to it is ignored.
The new spec 'S' introduced, which expects an argument of type zend_string *.
The new specs 'i' and 'I' introduced, which expect an argument of type php_int_t.
Instead a variadic argument is created using ZEND_ARG_VARIADIC_INFO():
g. sprintf() formats
ZEND_ARG_VARIADIC_INFO(0, name) /* pass rest by value */
ZEND_ARG_VARIADIC_INFO(1, name) /* pass rest by reference */
ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, name)
/* pass rest by prefer-ref */
New printf modifier 'p' was implemented to platform independently output php_int_t,
php_uint_t and php_size_t datatypes. That modifier can be used with'd', 'u', 'x' and 'o'
printf format specs with spprintf, snprintf and the wrapping printf implementations.
%pu is sufficient for both php_uint_t and php_size_t. the code using %p spec to output
pointer address might need to be enclosed into #ifdef when it unlickily followed by 'd',
'u', 'x' or 'o'.
ZEND_ARG_VARIADIC_INFO() should only be used for the last argument.
The only exceptions are the snprintf and zend_sprintf functions yet, because in some cases
they can use the implemenations available on the system, not the PHP one. Fro snprintf the
the macros ZEND_INT_FMT ZEND_UINT_FMT should be used.
The following changes were applied to the zend_arg_info struct:
h. HashTable API
typedef struct _zend_arg_info {
const char *class_name;
zend_uint class_name_len;
zend_uchar type_hint;
+ zend_uchar pass_by_reference;
zend_bool allow_null;
- zend_bool pass_by_reference;
+ zend_bool is_variadic;
} zend_arg_info;
Datatype for array indexes was changed to php_uint_t, for string keys to zend_string *.
The following changes were applied to the zend_internal_function_info struct:
i. New portable macros for large file support
typedef struct _zend_internal_function_info {
zend_uint required_num_args;
zend_uchar _type_hint;
zend_bool return_reference;
- zend_bool pass_rest_by_reference;
+ zend_bool _allow_null;
+ zend_bool _is_variadic;
} zend_internal_function_info;
Function(s) Alias Comment
stat, _stat64 zend_stat for use with zend_stat_t
fstat, _fstat64 zend_fstat for use with zend_stat_t
lseek, _lseeki64 zend_lseek for use with zend_off_t
ftell, _ftelli64 zend_ftell for use with zend_off_t
fseek, _fseeki64 zend_fseek for use with zend_off_t
The CHECK_ARG_SEND_TYPE(), ARG_MUST_BE_SENT_BY_REF(),
ARG_SHOULD_BE_SENT_BY_REF() and ARG_MAY_BE_SENT_BY_REF() macros now assume
that the argument passed to them is a zend_function* and that it is non-NULL.
j. New portable macros for integers
e. tsrm_virtual_cwd.h moved to zend_virtual_cwd.h
Memory allocation is now managed by emalloc/efree instead of malloc/free.
f. empty strings are interned
String created using STR_EMPTY_ALLOC() are now interned.
convert_to_string use STR_EMPTY_ALLOC() for zval when IS_NULL.
str_efree() shoud be preferred as efree() on such strings can cause memory
corruption.
g. Additional str_* APIs
In addition to the previously existing str_free() and str_efree() macros, the
following macros have been introduced to simplify dealing with potentially
interned strings:
str_efree_rel(str) - efree_rel() if not interned
str_erealloc(str, new_len) - erealloc() or emalloc+memcpy if interned
str_estrndup(str, len) - estrndup() if not interned
str_strndup(str, len) - zend_strndup() if not interned
str_hash(str, len) - INTERNED_HASH(str) if interned,
zend_hash_func(str, len+1) otherwise
h. Addition of zend_hash_reindex
A zend_hash_reindex() function with the following prototype has been added:
void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys);
If only_integer_keys==0, this function will change all keys to be continuous,
zero-based integers in hash order. If only_integer_keys==1 the same will be
done only for keys that were already integers previously, while leaving
string keys alone.
i. Addition of zend_hash_splice
A zend_hash_splice() macro with the following prototype has been added:
void zend_hash_splice(
HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor,
uint offset, uint length,
void **list, uint list_count, HashTable *removed
);
This function performs an in-place splice operation on a hashtable:
The elements between offset and offset+length are removed and the elements in
list[list_count] are inserted in their place. The removed elements can be
optionally collected into a hashtable.
This operation reindexes the hashtable, i.e. integer keys will be zero-based
and sequential, while string keys stay intact. The same applies to the
elements inserted into the removed HT.
As a side-effect of this addition the signature of the php_splice() function
changed:
void php_splice(
HashTable *ht, zend_uint offset, zend_uint length,
zval ***list, zend_uint list_count, HashTable *removed TSRMLS_DC
)
This function now directly forwards to zend_hash_splice(), resets the
IAP of ht (for compatibility with the previous implementation) and resets
CVs if the passed hashtable is the global symbol table.
j. Unserialization of manipulated object strings
Strings requiring unserialization of objects are now explicitly checked
whether the object they contain implements the Serializable interface.
This solves the situation where manipulated strings could be passed for
objects using Serializable to disallow serialization. An object
implementing Serializable will always start with "C:" in the serialized
string, all other objects are represented with starting "O:". Objects
implementing Serializable to disable serialization using
zend_class_unserialize_deny and zend_class_serialize_deny, when
instantiated from the serializer with a manipulated "O:" string at the
start, will most likely be defectively initialized. This is now
fixed at the appropriate place by checking for the presence of the
serialize callback in the class entry.
k. Removal of IS_CONSTANT_ARRAY and IS_CONSTANT_INDEX hack
These two #defines disappeared. Instead we have now IS_CONSTANT_AST which
covers also the functionality IS_CONSTANT_ARRAY bid and furthermore the
hack for marking zvals as constant index with IS_CONSTANT_INDEX is now
superfluous and so removed.
Please note that IS_CONSTANT_AST now has the same value than
IS_CONSTANT_ARRAY had.
Function(s) Alias Comment
snprintf with "%ld" or "%lld", _ltoa_s, _i64toa_s ZEND_ITOA for use with zend_int_t
atol, atoll, _atoi64 ZEND_ATOI for use with zend_int_t
strtol, strtoll, _strtoi64 ZEND_STRTOI for use with zend_int_t
strtoul, strtoull, _strtoui64 ZEND_STRTOUI for use with zend_int_t
abs, llabs, _abs64 ZEND_ABS for use with zend_int_t
- ZEND_INT_MAX Aliased with PHP_INT_MAX in php.h, replaces LONG_MAX where appropriate
- ZEND_INT_MIN Aliased with PHP_INT_MIN in php.h, replaces LONG_MIN where appropriate
- ZEND_UINT_MAX ULONG_MAX
- SIZEOF_ZEND_INT Replaces SIZEOF_ZEND_LONG where appropriate
- ZEND_SIZE_MAX Max value of zend_size_t
========================
2. Build system changes
========================
a. Unix build system changes
- The bison version check is now a blacklist instead of a whitelist.
- The bison binary can be specified through the YACC environment/configure
variable. Previously `bison` was assumed to be in $PATH.
b. Windows build system changes
- The configure option --enable-static-analyze isn't available anymore.
The new option was introduced --with-analyzer.
- It is possible to disable PGO for single extensions, to do that
define a global variable PHP_MYMODULE_PGO evaluating to false
inside config.w32
+1 -1
View File
@@ -44,7 +44,7 @@ int(0)
int(2)
int(0)
Warning: Missing argument 2 for test3() in %s on line %d
Warning: Missing argument 2 for test3()%s
int(1)
int(2)
int(1)
+1 -1
View File
@@ -85,7 +85,7 @@ bool(false)
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
bool(false)
Warning: Missing argument 2 for test3() in %s on line %d
Warning: Missing argument 2 for test3()%s
int(1)
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
+1 -1
View File
@@ -60,7 +60,7 @@ array(2) {
array(0) {
}
Warning: Missing argument 2 for test3() in %s on line %d
Warning: Missing argument 2 for test3()%s
array(1) {
[0]=>
int(1)
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Identical comparison of array with references
--FILE--
<?php
$foo = 42;
$array1 = [&$foo];
$array2 = [$foo];
var_dump($array1 === $array2);
?>
--EXPECT--
bool(true)
+1 -1
View File
@@ -6,4 +6,4 @@ Bug #24773 (unset() of integers treated as arrays causes a crash)
unset($array["lvl1"]["lvl2"]["b"]);
?>
--EXPECTF--
Fatal error: Cannot unset string offsets in %s on line %d
Fatal error: Cannot use string offset as an array in %s on line %d
-1
View File
@@ -42,7 +42,6 @@ $page["name"] = A::A_ftk();
Non-static method A::A_ftk() should not be called statically
1 %sbug38047.php:13 get_error_context()
2 %sbug38047.php:36 kalus_error_handler()
3 %sbug38047.php:36 A_ftk()
Missing argument 1 for A::A_ftk(), called in %sbug38047.php on line 36 and defined
1 %sbug38047.php:13 get_error_context()
+1 -1
View File
@@ -25,7 +25,7 @@ try {
--EXPECTF--
1. exception 'Exception' with message 'aaa' in %sbug52361.php:5
Stack trace:
#0 %sbug52361.php(16): aaa->__destruct()
#0 %sbug52361.php(13): aaa->__destruct()
#1 %sbug52361.php(16): bbb()
#2 {main}
2. exception 'Exception' with message 'bbb' in %sbug52361.php:13
+2 -9
View File
@@ -1,5 +1,5 @@
--TEST--
Bug #54013 (ReflectionParam for duplicate parameter contains garbage)
Bug #54013 (ReflectionParam for duplicate parameter contains garbage) (PHP7)
--FILE--
<?php
@@ -21,11 +21,4 @@ var_dump($params[0], $params[1]);
?>
--EXPECTF--
object(ReflectionParameter)#%d (1) {
["name"]=>
string(8) "aaaaaaaa"
}
object(ReflectionParameter)#%d (1) {
["name"]=>
string(8) "aaaaaaaa"
}
Fatal error: Redefinition of parameter $aaaaaaaa in %sbug54013.php on line 5
+6 -3
View File
@@ -1,5 +1,5 @@
--TEST--
Bug #60825 (Segfault when running symfony 2 tests)
Bug #60825 (Segfault when running symfony 2 tests) (PHP7)
--DESCRIPTION--
run this with valgrind
--FILE--
@@ -13,7 +13,10 @@ class test {
}
$a = new test;
require_once $a;
debug_zval_dump(test::$x);
debug_zval_dump($a, test::$x);
?>
--EXPECTF--
string(%d) "%sbug60825.php" refcount(2)
object(test)#%d (0) refcount(%d){
}
object(test)#%d (0) refcount(%d){
}
+3 -3
View File
@@ -1,5 +1,5 @@
--TEST--
Bug #64515 (Memoryleak when using the same variablename 2times in function declaration)
Bug #64515 (Memoryleak when using the same variablename 2times in function declaration) (PHP7)
--FILE--
<?php
function foo($unused = null, $unused = null, $arg = array()) {
@@ -8,5 +8,5 @@ function foo($unused = null, $unused = null, $arg = array()) {
foo();
echo "okey";
?>
--EXPECT--
okey
--EXPECTF--
Fatal error: Redefinition of parameter $unused in %sbug64515.php on line 2
+1 -3
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects)
--XFAIL--
We can not fix this bug without a significant (performace slow down) change to gc
--FILE--
<?php
$bar = NULL;
@@ -38,7 +36,7 @@ object(bad)#4 (1) {
*/
?>
--EXPECTF--
bject(bad)#%d (1) {
object(bad)#%d (1) {
["_private":"bad":private]=>
array(1) {
[0]=>
+6 -1
View File
@@ -11,7 +11,8 @@ class Test
protected static $array = [
self::FIRST => 'first',
'second',
'third'
'third',
4,
];
public function __construct()
@@ -22,9 +23,13 @@ class Test
$test = new Test();
?>
===DONE===
--EXPECTF--
array (
1 => 'first',
2 => 'second',
3 => 'third',
4 => 4,
)
===DONE===
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Bug #67856 (Leak when using array_reduce with by-ref function)
--FILE--
<?php
$array = [1, 2, 3];
var_dump(array_reduce($array, function(&$a, &$b) {
return $a + $b;
}, 0));
?>
--EXPECT--
int(6)
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #67858: Leak when $php_errormsg already set
--INI--
track_errors=1
error_reporting=E_ALL
--FILE--
<?php
function f() {
$php_errormsg = [1, 2, 3];
echo $var;
var_dump($php_errormsg);
}
f();
?>
--EXPECTF--
Notice: Undefined variable: var in %s on line %d
string(23) "Undefined variable: var"
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #67874 Crash in array_map()
--FILE--
<?php
$a = array(1,2,3);
$data = array($a);
$data = array_map('current', $data);
var_dump($data);
?>
--EXPECT--
array(1) {
[0]=>
int(1)
}
+1 -1
View File
@@ -13,6 +13,6 @@ call_user_func(array('foo', 'teste'));
?>
--EXPECTF--
Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method foo::teste() should not be called statically in %s on line %d
Strict Standards: %son-static method foo::teste() should not be called statically in %s on line %d
Fatal error: Using $this when not in object context in %s on line %d
+1 -1
View File
@@ -18,7 +18,7 @@ var_dump(call_user_func(array('foo', 'teste')));
?>
--EXPECTF--
Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method foo::teste() should not be called statically in %s on line %d
Strict Standards: %son-static method foo::teste() should not be called statically in %s on line %d
%string|unicode%(1) "x"
array(1) {
[0]=>
@@ -0,0 +1,30 @@
--TEST--
Conversion of a class constant to a reference after it has been cached
--FILE--
<?php
class Test {
const TEST = 'TEST';
private $prop;
public function readConst() {
$this->prop = self::TEST;
}
}
function doTest() {
$obj = new Test;
$obj->readConst();
unset($obj);
var_dump(Test::TEST);
}
doTest();
eval('class Test2 extends Test {}');
doTest();
?>
--EXPECT--
string(4) "TEST"
string(4) "TEST"
+4 -1
View File
@@ -47,7 +47,10 @@ array(1) {
["this"]=>
object(foo)#%d (1) {
["a"]=>
*RECURSION*
array(1) {
[0]=>
*RECURSION*
}
}
}
}
-2
View File
@@ -6,9 +6,7 @@ errmsg: arrays are not allowed in class constants
class test {
const TEST = array(1,2,3);
}
var_dump(test::TEST);
echo "Done\n";
?>
--EXPECTF--
+1 -1
View File
@@ -105,7 +105,7 @@ Hello, you
Notice: Undefined variable: this in %s on line %d
NULL
Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method Hello::world() should not be called statically in %s on line %d
Strict Standards: %son-static method Hello::world() should not be called statically in %s on line %d
Hello, you
Notice: Undefined variable: this in %s on line %d
+1 -1
View File
@@ -16,5 +16,5 @@ var_dump(gc_collect_cycles());
echo "ok\n";
?>
--EXPECT--
int(10002)
int(2)
ok
+2 -2
View File
@@ -33,5 +33,5 @@ unset($foo);
unset($bar);
var_dump(gc_collect_cycles());
?>
--EXPECT--
int(2)
--EXPECTREGEX--
int\([23]\)
+3 -2
View File
@@ -28,6 +28,7 @@ Stack trace:
Next exception 'Exception' with message 'foobar' in %sgc_030.php:%d
Stack trace:
#0 %sgc_030.php(%d): foo->__destruct()
#1 {main}
#0 [internal function]: foo->__destruct()
#1 %sgc_030.php(%d): gc_collect_cycles()
#2 {main}
thrown in %sgc_030.php on line %d
+9 -9
View File
@@ -11,26 +11,26 @@ $b =& $a;
$a[0][0] = $a;
debug_zval_dump($a);
?>
--EXPECT--
array(1) refcount(1){
--EXPECTF--
array(1) refcount(%d){
[0]=>
array(1) refcount(3){
array(1) refcount(%d){
[0]=>
array(1) refcount(3){
array(1) refcount(%d){
[0]=>
*RECURSION*
}
}
}
array(1) refcount(1){
array(1) refcount(%d){
[0]=>
array(1) refcount(3){
array(1) refcount(%d){
[0]=>
array(1) refcount(1){
array(1) refcount(%d){
[0]=>
array(1) refcount(3){
array(1) refcount(%d){
[0]=>
array(1) refcount(1){
array(1) refcount(%d){
[0]=>
*RECURSION*
}
@@ -12,7 +12,6 @@ foreach ($gen as &$value) { }
--EXPECTF--
Fatal error: Uncaught exception 'Exception' with message 'You can only iterate a generator by-reference if it declared that it yields by-reference' in %s:%d
Stack trace:
#0 %s(%d): unknown()
#1 {main}
#0 {main}
thrown in %s on line %d
+1 -2
View File
@@ -56,7 +56,6 @@ Stack trace:
exception 'Exception' with message 'Cannot traverse an already closed generator' in %s:%d
Stack trace:
#0 %s(%d): unknown()
#1 {main}
#0 {main}
in generator
-2
View File
@@ -3,9 +3,7 @@
--FILE--
<?php
const C = array();
var_dump(C);
?>
--EXPECTF--
array(0) {
}
@@ -0,0 +1,19 @@
--TEST--
Inc/dec of reference object properties
--FILE--
<?php
$obj = new stdClass;
$obj->cursor = 0;
$ref =& $obj->cursor;
$obj->cursor++;
var_dump($obj->cursor);
$obj->cursor--;
var_dump($obj->cursor);
?>
--EXPECT--
int(1)
int(0)
+1 -1
View File
@@ -35,7 +35,7 @@ object(foo)#%d (0) {
object(foo)#%d (0) {
}
Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method foo::test() should not be called statically in %s on line %d
Strict Standards: %son-static method foo::test() should not be called statically in %s on line %d
Strict Standards: Non-static method bar::show() should not be called statically in %s on line %d
object(foo)#%d (0) {
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Use power operator on reference
--FILE--
<?php
$a = 2;
$b = 3;
$ref =& $b;
$a **= $b;
var_dump($a);
?>
--EXPECT--
int(8)
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Throw reference
--FILE--
<?php
$e = new Exception;
$ref =& $e;
throw $e;
?>
--EXPECTF--
Fatal error: Uncaught exception 'Exception' in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
+276 -285
View File
@@ -46,21 +46,22 @@
/* true multithread-shared globals */
ZEND_API zend_class_entry *zend_standard_class_def = NULL;
ZEND_API int (*zend_printf)(const char *format, ...);
ZEND_API size_t (*zend_printf)(const char *format, ...);
ZEND_API zend_write_func_t zend_write;
ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC);
ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
ZEND_API void (*zend_block_interruptions)(void);
ZEND_API void (*zend_unblock_interruptions)(void);
ZEND_API void (*zend_ticks_function)(int ticks);
ZEND_API void (*zend_ticks_function)(int ticks TSRMLS_DC);
ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
size_t (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
zend_string *(*zend_vstrpprintf)(size_t max_len, const char *format, va_list ap);
ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
void (*zend_on_timeout)(int seconds TSRMLS_DC);
static void (*zend_message_dispatcher_p)(long message, const void *data TSRMLS_DC);
static void (*zend_message_dispatcher_p)(zend_long message, const void *data TSRMLS_DC);
static int (*zend_get_configuration_directive_p)(const char *name, uint name_length, zval *contents);
static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
@@ -123,8 +124,6 @@ static HashTable *global_persistent_list = NULL;
ZEND_API zend_utility_values zend_uv;
ZEND_API zval zval_used_for_init; /* True global variable */
/* version information */
static char *zend_version_info;
static uint zend_version_info_length;
@@ -133,11 +132,9 @@ static uint zend_version_info_length;
static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, zend_bool is_object TSRMLS_DC) /* {{{ */
{
zval **tmp;
char *string_key;
HashPosition iterator;
ulong num_key;
uint str_len;
zval *tmp;
zend_string *string_key;
zend_ulong num_key;
int i;
for (i = 0; i < indent; i++) {
@@ -145,46 +142,45 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent,
}
ZEND_PUTS_EX("(\n");
indent += PRINT_ZVAL_INDENT;
zend_hash_internal_pointer_reset_ex(ht, &iterator);
while (zend_hash_get_current_data_ex(ht, (void **) &tmp, &iterator) == SUCCESS) {
ZEND_HASH_FOREACH_KEY_VAL(ht, num_key, string_key, tmp) {
if (Z_TYPE_P(tmp) == IS_INDIRECT) {
tmp = Z_INDIRECT_P(tmp);
if (Z_TYPE_P(tmp) == IS_UNDEF) {
continue;
}
}
for (i = 0; i < indent; i++) {
ZEND_PUTS_EX(" ");
}
ZEND_PUTS_EX("[");
switch (zend_hash_get_current_key_ex(ht, &string_key, &str_len, &num_key, 0, &iterator)) {
case HASH_KEY_IS_STRING:
if (is_object) {
const char *prop_name, *class_name;
int prop_len;
int mangled = zend_unmangle_property_name_ex(string_key, str_len - 1, &class_name, &prop_name, &prop_len);
if (string_key) {
if (is_object) {
const char *prop_name, *class_name;
int prop_len;
int mangled = zend_unmangle_property_name_ex(string_key->val, string_key->len, &class_name, &prop_name, &prop_len);
ZEND_WRITE_EX(prop_name, prop_len);
if (class_name && mangled == SUCCESS) {
if (class_name[0]=='*') {
ZEND_PUTS_EX(":protected");
} else {
ZEND_PUTS_EX(":");
ZEND_PUTS_EX(class_name);
ZEND_PUTS_EX(":private");
}
ZEND_WRITE_EX(prop_name, prop_len);
if (class_name && mangled == SUCCESS) {
if (class_name[0]=='*') {
ZEND_PUTS_EX(":protected");
} else {
ZEND_PUTS_EX(":");
ZEND_PUTS_EX(class_name);
ZEND_PUTS_EX(":private");
}
} else {
ZEND_WRITE_EX(string_key, str_len-1);
}
break;
case HASH_KEY_IS_LONG:
{
char key[25];
snprintf(key, sizeof(key), "%ld", num_key);
ZEND_PUTS_EX(key);
}
break;
} else {
ZEND_WRITE_EX(string_key->val, string_key->len);
}
} else {
char key[25];
snprintf(key, sizeof(key), ZEND_LONG_FMT, num_key);
ZEND_PUTS_EX(key);
}
ZEND_PUTS_EX("] => ");
zend_print_zval_r_ex(write_func, *tmp, indent+PRINT_ZVAL_INDENT TSRMLS_CC);
zend_print_zval_r_ex(write_func, tmp, indent+PRINT_ZVAL_INDENT TSRMLS_CC);
ZEND_PUTS_EX("\n");
zend_hash_move_forward_ex(ht, &iterator);
}
} ZEND_HASH_FOREACH_END();
indent -= PRINT_ZVAL_INDENT;
for (i = 0; i < indent; i++) {
ZEND_PUTS_EX(" ");
@@ -195,145 +191,124 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent,
static void print_flat_hash(HashTable *ht TSRMLS_DC) /* {{{ */
{
zval **tmp;
char *string_key;
HashPosition iterator;
ulong num_key;
uint str_len;
zval *tmp;
zend_string *string_key;
zend_ulong num_key;
int i = 0;
zend_hash_internal_pointer_reset_ex(ht, &iterator);
while (zend_hash_get_current_data_ex(ht, (void **) &tmp, &iterator) == SUCCESS) {
ZEND_HASH_FOREACH_KEY_VAL_IND(ht, num_key, string_key, tmp) {
if (i++ > 0) {
ZEND_PUTS(",");
}
ZEND_PUTS("[");
switch (zend_hash_get_current_key_ex(ht, &string_key, &str_len, &num_key, 0, &iterator)) {
case HASH_KEY_IS_STRING:
ZEND_PUTS(string_key);
break;
case HASH_KEY_IS_LONG:
zend_printf("%ld", num_key);
break;
if (string_key) {
ZEND_WRITE(string_key->val, string_key->len);
} else {
zend_printf(ZEND_ULONG_FMT, num_key);
}
ZEND_PUTS("] => ");
zend_print_flat_zval_r(*tmp TSRMLS_CC);
zend_hash_move_forward_ex(ht, &iterator);
}
zend_print_flat_zval_r(tmp TSRMLS_CC);
} ZEND_HASH_FOREACH_END();
}
/* }}} */
ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_copy) /* {{{ */
ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy TSRMLS_DC) /* {{{ */
{
if (Z_TYPE_P(expr)==IS_STRING) {
*use_copy = 0;
return;
if (Z_TYPE_P(expr) == IS_STRING) {
return 0;
}
again:
switch (Z_TYPE_P(expr)) {
case IS_NULL:
Z_STRLEN_P(expr_copy) = 0;
Z_STRVAL_P(expr_copy) = STR_EMPTY_ALLOC();
break;
case IS_BOOL:
if (Z_LVAL_P(expr)) {
Z_STRLEN_P(expr_copy) = 1;
Z_STRVAL_P(expr_copy) = estrndup("1", 1);
case IS_FALSE:
ZVAL_EMPTY_STRING(expr_copy);
break;
case IS_TRUE:
if (CG(one_char_string)['1']) {
ZVAL_INTERNED_STR(expr_copy, CG(one_char_string)['1']);
} else {
Z_STRLEN_P(expr_copy) = 0;
Z_STRVAL_P(expr_copy) = STR_EMPTY_ALLOC();
ZVAL_NEW_STR(expr_copy, zend_string_init("1", 1, 0));
}
break;
case IS_RESOURCE: {
char buf[sizeof("Resource id #") + MAX_LENGTH_OF_LONG];
int len;
len = snprintf(buf, sizeof(buf), "Resource id #" ZEND_LONG_FMT, Z_RES_HANDLE_P(expr));
ZVAL_NEW_STR(expr_copy, zend_string_init(buf, len, 0));
}
break;
case IS_RESOURCE:
Z_STRVAL_P(expr_copy) = (char *) emalloc(sizeof("Resource id #") - 1 + MAX_LENGTH_OF_LONG);
Z_STRLEN_P(expr_copy) = snprintf(Z_STRVAL_P(expr_copy), sizeof("Resource id #") - 1 + MAX_LENGTH_OF_LONG, "Resource id #%ld", Z_LVAL_P(expr));
break;
case IS_ARRAY:
zend_error(E_NOTICE, "Array to string conversion");
Z_STRLEN_P(expr_copy) = sizeof("Array") - 1;
Z_STRVAL_P(expr_copy) = estrndup("Array", Z_STRLEN_P(expr_copy));
// TODO: use interned string ???
ZVAL_NEW_STR(expr_copy, zend_string_init("Array", sizeof("Array") - 1, 0));
break;
case IS_OBJECT:
{
TSRMLS_FETCH();
if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
if (Z_OBJ_HANDLER_P(expr, cast_object)) {
Z_ADDREF_P(expr);
if (Z_OBJ_HANDLER_P(expr, cast_object)(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zval_ptr_dtor(expr);
break;
}
if (Z_OBJ_HANDLER_P(expr, cast_object)) {
zval *val;
ALLOC_ZVAL(val);
INIT_PZVAL_COPY(val, expr);
zval_copy_ctor(val);
if (Z_OBJ_HANDLER_P(expr, cast_object)(val, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zval_ptr_dtor(&val);
break;
}
zval_ptr_dtor(&val);
}
if (!Z_OBJ_HANDLER_P(expr, cast_object) && Z_OBJ_HANDLER_P(expr, get)) {
zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC);
Z_ADDREF_P(z);
if (Z_TYPE_P(z) != IS_OBJECT) {
zend_make_printable_zval(z, expr_copy, use_copy);
if (*use_copy) {
zval_ptr_dtor(&z);
} else {
ZVAL_ZVAL(expr_copy, z, 0, 1);
*use_copy = 1;
}
return;
}
zval_ptr_dtor(&z);
}
zend_error(EG(exception) ? E_ERROR : E_RECOVERABLE_ERROR, "Object of class %s could not be converted to string", Z_OBJCE_P(expr)->name);
Z_STRLEN_P(expr_copy) = 0;
Z_STRVAL_P(expr_copy) = STR_EMPTY_ALLOC();
zval_ptr_dtor(expr);
}
if (!Z_OBJ_HANDLER_P(expr, cast_object) && Z_OBJ_HANDLER_P(expr, get)) {
zval rv;
zval *z = Z_OBJ_HANDLER_P(expr, get)(expr, &rv TSRMLS_CC);
Z_ADDREF_P(z);
if (Z_TYPE_P(z) != IS_OBJECT) {
if (zend_make_printable_zval(z, expr_copy TSRMLS_CC)) {
zval_ptr_dtor(z);
} else {
ZVAL_ZVAL(expr_copy, z, 0, 1);
}
return 1;
}
zval_ptr_dtor(z);
}
zend_error(EG(exception) ? E_ERROR : E_RECOVERABLE_ERROR, "Object of class %s could not be converted to string", Z_OBJCE_P(expr)->name->val);
ZVAL_EMPTY_STRING(expr_copy);
break;
case IS_DOUBLE:
*expr_copy = *expr;
zval_copy_ctor(expr_copy);
ZVAL_DUP(expr_copy, expr);
zend_locale_sprintf_double(expr_copy ZEND_FILE_LINE_CC);
break;
case IS_REFERENCE:
expr = Z_REFVAL_P(expr);
if (Z_TYPE_P(expr) == IS_STRING) {
ZVAL_STR(expr_copy, zend_string_copy(Z_STR_P(expr)));
return 1;
}
goto again;
break;
default:
*expr_copy = *expr;
zval_copy_ctor(expr_copy);
ZVAL_DUP(expr_copy, expr);
convert_to_string(expr_copy);
break;
}
Z_TYPE_P(expr_copy) = IS_STRING;
*use_copy = 1;
return 1;
}
/* }}} */
ZEND_API int zend_print_zval(zval *expr, int indent) /* {{{ */
ZEND_API int zend_print_zval(zval *expr, int indent TSRMLS_DC) /* {{{ */
{
return zend_print_zval_ex(zend_write, expr, indent);
return zend_print_zval_ex(zend_write, expr, indent TSRMLS_CC);
}
/* }}} */
ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent) /* {{{ */
ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC) /* {{{ */
{
zval expr_copy;
int use_copy;
zend_string *str = zval_get_string(expr);
int len = str->len;
zend_make_printable_zval(expr, &expr_copy, &use_copy);
if (use_copy) {
expr = &expr_copy;
if (len != 0) {
write_func(str->val, len);
}
if (Z_STRLEN_P(expr) == 0) { /* optimize away empty strings */
if (use_copy) {
zval_dtor(expr);
}
return 0;
}
write_func(Z_STRVAL_P(expr), Z_STRLEN_P(expr));
if (use_copy) {
zval_dtor(expr);
}
return Z_STRLEN_P(expr);
zend_string_release(str);
return len;
}
/* }}} */
@@ -342,49 +317,51 @@ ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC) /* {{{ */
switch (Z_TYPE_P(expr)) {
case IS_ARRAY:
ZEND_PUTS("Array (");
if (++Z_ARRVAL_P(expr)->nApplyCount>1) {
if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr)) &&
++Z_ARRVAL_P(expr)->u.v.nApplyCount>1) {
ZEND_PUTS(" *RECURSION*");
Z_ARRVAL_P(expr)->nApplyCount--;
Z_ARRVAL_P(expr)->u.v.nApplyCount--;
return;
}
print_flat_hash(Z_ARRVAL_P(expr) TSRMLS_CC);
ZEND_PUTS(")");
Z_ARRVAL_P(expr)->nApplyCount--;
if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr))) {
Z_ARRVAL_P(expr)->u.v.nApplyCount--;
}
break;
case IS_OBJECT:
{
HashTable *properties = NULL;
const char *class_name = NULL;
zend_uint clen;
zend_string *class_name = NULL;
if (Z_OBJ_HANDLER_P(expr, get_class_name)) {
Z_OBJ_HANDLER_P(expr, get_class_name)(expr, &class_name, &clen, 0 TSRMLS_CC);
class_name = Z_OBJ_HANDLER_P(expr, get_class_name)(Z_OBJ_P(expr), 0 TSRMLS_CC);
}
if (class_name) {
zend_printf("%s Object (", class_name);
zend_printf("%s Object (", class_name->val);
} else {
zend_printf("%s Object (", "Unknown Class");
}
if (class_name) {
efree((char*)class_name);
zend_string_release(class_name);
}
if (Z_OBJ_HANDLER_P(expr, get_properties)) {
properties = Z_OBJPROP_P(expr);
}
if (properties) {
if (++properties->nApplyCount>1) {
if (++properties->u.v.nApplyCount>1) {
ZEND_PUTS(" *RECURSION*");
properties->nApplyCount--;
properties->u.v.nApplyCount--;
return;
}
print_flat_hash(properties TSRMLS_CC);
properties->nApplyCount--;
properties->u.v.nApplyCount--;
}
ZEND_PUTS(")");
break;
}
default:
zend_print_variable(expr);
zend_print_variable(expr TSRMLS_CC);
break;
}
}
@@ -398,54 +375,57 @@ ZEND_API void zend_print_zval_r(zval *expr, int indent TSRMLS_DC) /* {{{ */
ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC) /* {{{ */
{
ZVAL_DEREF(expr);
switch (Z_TYPE_P(expr)) {
case IS_ARRAY:
ZEND_PUTS_EX("Array\n");
if (++Z_ARRVAL_P(expr)->nApplyCount>1) {
if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr)) &&
++Z_ARRVAL_P(expr)->u.v.nApplyCount>1) {
ZEND_PUTS_EX(" *RECURSION*");
Z_ARRVAL_P(expr)->nApplyCount--;
Z_ARRVAL_P(expr)->u.v.nApplyCount--;
return;
}
print_hash(write_func, Z_ARRVAL_P(expr), indent, 0 TSRMLS_CC);
Z_ARRVAL_P(expr)->nApplyCount--;
if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr))) {
Z_ARRVAL_P(expr)->u.v.nApplyCount--;
}
break;
case IS_OBJECT:
{
HashTable *properties;
const char *class_name = NULL;
zend_uint clen;
zend_string *class_name = NULL;
int is_temp;
if (Z_OBJ_HANDLER_P(expr, get_class_name)) {
Z_OBJ_HANDLER_P(expr, get_class_name)(expr, &class_name, &clen, 0 TSRMLS_CC);
class_name = Z_OBJ_HANDLER_P(expr, get_class_name)(Z_OBJ_P(expr), 0 TSRMLS_CC);
}
if (class_name) {
ZEND_PUTS_EX(class_name);
ZEND_PUTS_EX(class_name->val);
} else {
ZEND_PUTS_EX("Unknown Class");
}
ZEND_PUTS_EX(" Object\n");
if (class_name) {
efree((char*)class_name);
zend_string_release(class_name);
}
if ((properties = Z_OBJDEBUG_P(expr, is_temp)) == NULL) {
break;
}
if (++properties->nApplyCount>1) {
if (++properties->u.v.nApplyCount>1) {
ZEND_PUTS_EX(" *RECURSION*");
properties->nApplyCount--;
properties->u.v.nApplyCount--;
return;
}
print_hash(write_func, properties, indent, 1 TSRMLS_CC);
properties->nApplyCount--;
properties->u.v.nApplyCount--;
if (is_temp) {
zend_hash_destroy(properties);
efree(properties);
FREE_HASHTABLE(properties);
}
break;
}
default:
zend_print_zval_ex(write_func, expr, indent);
zend_print_zval_ex(write_func, expr, indent TSRMLS_CC);
break;
}
}
@@ -463,7 +443,7 @@ static FILE *zend_fopen_wrapper(const char *filename, char **opened_path TSRMLS_
#ifdef ZTS
static zend_bool asp_tags_default = 0;
static zend_bool short_tags_default = 1;
static zend_uint compiler_options_default = ZEND_COMPILE_DEFAULT;
static uint32_t compiler_options_default = ZEND_COMPILE_DEFAULT;
#else
# define asp_tags_default 0
# define short_tags_default 1
@@ -501,20 +481,25 @@ static void zend_init_exception_op(TSRMLS_D) /* {{{ */
/* }}} */
#ifdef ZTS
static void function_copy_ctor(zval *zv)
{
zend_function *old_func = Z_FUNC_P(zv);
Z_FUNC_P(zv) = pemalloc(sizeof(zend_internal_function), 1);
memcpy(Z_FUNC_P(zv), old_func, sizeof(zend_internal_function));
function_add_ref(Z_FUNC_P(zv));
}
static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS_DC) /* {{{ */
{
zend_function tmp_func;
zend_class_entry *tmp_class;
compiler_globals->compiled_filename = NULL;
compiler_globals->function_table = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(compiler_globals->function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
zend_hash_copy(compiler_globals->function_table, global_function_table, NULL, &tmp_func, sizeof(zend_function));
zend_hash_init_ex(compiler_globals->function_table, 1024, NULL, ZEND_FUNCTION_DTOR, 1, 0);
zend_hash_copy(compiler_globals->function_table, global_function_table, function_copy_ctor);
compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(compiler_globals->class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
zend_hash_copy(compiler_globals->class_table, global_class_table, (copy_ctor_func_t) zend_class_add_ref, &tmp_class, sizeof(zend_class_entry *));
zend_hash_init_ex(compiler_globals->class_table, 64, NULL, ZEND_CLASS_DTOR, 1, 0);
zend_hash_copy(compiler_globals->class_table, global_class_table, zend_class_add_ref);
zend_set_default_compile_time_values(TSRMLS_C);
@@ -522,7 +507,7 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS
compiler_globals->auto_globals = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(compiler_globals->auto_globals, 8, NULL, NULL, 1, 0);
zend_hash_copy(compiler_globals->auto_globals, global_auto_globals_table, NULL, NULL, sizeof(zend_auto_global) /* empty element */);
zend_hash_copy(compiler_globals->auto_globals, global_auto_globals_table, NULL /* empty element */);
compiler_globals->last_static_member = zend_hash_num_elements(compiler_globals->class_table);
if (compiler_globals->last_static_member) {
@@ -552,7 +537,7 @@ static void compiler_globals_dtor(zend_compiler_globals *compiler_globals TSRMLS
free(compiler_globals->static_members_table);
}
if (compiler_globals->script_encoding_list) {
pefree(compiler_globals->script_encoding_list, 1);
pefree((char*)compiler_globals->script_encoding_list, 1);
}
compiler_globals->last_static_member = 0;
}
@@ -565,9 +550,8 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals TSRMLS
zend_init_rsrc_plist(TSRMLS_C);
zend_init_exception_op(TSRMLS_C);
EG(lambda_count) = 0;
EG(user_error_handler) = NULL;
EG(user_exception_handler) = NULL;
EG(in_execution) = 0;
ZVAL_UNDEF(&EG(user_error_handler));
ZVAL_UNDEF(&EG(user_exception_handler));
EG(in_autoload) = NULL;
EG(current_execute_data) = NULL;
EG(current_module) = NULL;
@@ -621,16 +605,28 @@ static void php_scanner_globals_ctor(zend_php_scanner_globals *scanner_globals_p
void zend_init_opcodes_handlers(void);
static zend_bool php_auto_globals_create_globals(const char *name, uint name_len TSRMLS_DC) /* {{{ */
static void module_destructor_zval(zval *zv) /* {{{ */
{
zval *globals;
zend_module_entry *module = (zend_module_entry*)Z_PTR_P(zv);
ALLOC_ZVAL(globals);
Z_SET_REFCOUNT_P(globals, 1);
Z_SET_ISREF_P(globals);
Z_TYPE_P(globals) = IS_ARRAY;
Z_ARRVAL_P(globals) = &EG(symbol_table);
zend_hash_update(&EG(symbol_table), name, name_len + 1, &globals, sizeof(zval *), NULL);
module_destructor(module);
free(module);
}
/* }}} */
static void auto_global_dtor(zval *zv) /* {{{ */
{
free(Z_PTR_P(zv));
}
/* }}} */
static zend_bool php_auto_globals_create_globals(zend_string *name TSRMLS_DC) /* {{{ */
{
zval globals;
ZVAL_ARR(&globals, &EG(symbol_table));
ZVAL_NEW_REF(&globals, &globals);
zend_hash_update(&EG(symbol_table).ht, name, &globals);
return 0;
}
/* }}} */
@@ -677,6 +673,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions TS
zend_ticks_function = utility_functions->ticks_function;
zend_on_timeout = utility_functions->on_timeout;
zend_vspprintf = utility_functions->vspprintf_function;
zend_vstrpprintf = utility_functions->vstrpprintf_function;
zend_getenv = utility_functions->getenv_function;
zend_resolve_path = utility_functions->resolve_path_function;
@@ -704,19 +701,14 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions TS
GLOBAL_AUTO_GLOBALS_TABLE = (HashTable *) malloc(sizeof(HashTable));
GLOBAL_CONSTANTS_TABLE = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(GLOBAL_FUNCTION_TABLE, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
zend_hash_init_ex(GLOBAL_CLASS_TABLE, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
zend_hash_init_ex(GLOBAL_AUTO_GLOBALS_TABLE, 8, NULL, NULL, 1, 0);
zend_hash_init_ex(GLOBAL_CONSTANTS_TABLE, 20, NULL, ZEND_CONSTANT_DTOR, 1, 0);
zend_hash_init_ex(GLOBAL_FUNCTION_TABLE, 1024, NULL, ZEND_FUNCTION_DTOR, 1, 0);
zend_hash_init_ex(GLOBAL_CLASS_TABLE, 64, NULL, ZEND_CLASS_DTOR, 1, 0);
zend_hash_init_ex(GLOBAL_AUTO_GLOBALS_TABLE, 8, NULL, auto_global_dtor, 1, 0);
zend_hash_init_ex(GLOBAL_CONSTANTS_TABLE, 128, NULL, ZEND_CONSTANT_DTOR, 1, 0);
zend_hash_init_ex(&module_registry, 50, NULL, ZEND_MODULE_DTOR, 1, 0);
zend_hash_init_ex(&module_registry, 32, NULL, module_destructor_zval, 1, 0);
zend_init_rsrc_list_dtors();
/* This zval can be used to initialize allocate zval's to an uninit'ed value */
Z_UNSET_ISREF(zval_used_for_init);
Z_SET_REFCOUNT(zval_used_for_init, 1);
Z_TYPE(zval_used_for_init) = IS_NULL;
#ifdef ZTS
ts_allocate_id(&compiler_globals_id, sizeof(zend_compiler_globals), (ts_allocate_ctor) compiler_globals_ctor, (ts_allocate_dtor) compiler_globals_dtor);
ts_allocate_id(&executor_globals_id, sizeof(zend_executor_globals), (ts_allocate_ctor) executor_globals_ctor, (ts_allocate_dtor) executor_globals_dtor);
@@ -740,14 +732,14 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions TS
ini_scanner_globals_ctor(&ini_scanner_globals TSRMLS_CC);
php_scanner_globals_ctor(&language_scanner_globals TSRMLS_CC);
zend_set_default_compile_time_values(TSRMLS_C);
EG(user_error_handler) = NULL;
EG(user_exception_handler) = NULL;
ZVAL_UNDEF(&EG(user_error_handler));
ZVAL_UNDEF(&EG(user_exception_handler));
#endif
zend_interned_strings_init(TSRMLS_C);
zend_startup_builtin_functions(TSRMLS_C);
zend_register_standard_constants(TSRMLS_C);
zend_register_auto_global("GLOBALS", sizeof("GLOBALS") - 1, 1, php_auto_globals_create_globals TSRMLS_CC);
zend_register_auto_global(zend_string_init("GLOBALS", sizeof("GLOBALS") - 1, 1), 1, php_auto_globals_create_globals TSRMLS_CC);
#ifndef ZTS
zend_init_rsrc_plist(TSRMLS_C);
@@ -880,7 +872,7 @@ ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
}
CG(unclean_shutdown) = 1;
CG(active_class_entry) = NULL;
CG(in_compilation) = EG(in_execution) = 0;
CG(in_compilation) = 0;
EG(current_execute_data) = NULL;
LONGJMP(*EG(bailout), FAILURE);
}
@@ -938,8 +930,7 @@ void zend_call_destructors(TSRMLS_D) /* {{{ */
ZEND_API void zend_deactivate(TSRMLS_D) /* {{{ */
{
/* we're no longer executing anything */
EG(opline_ptr) = NULL;
EG(active_symbol_table) = NULL;
EG(current_execute_data) = NULL;
zend_try {
shutdown_scanner(TSRMLS_C);
@@ -981,7 +972,7 @@ ZEND_API void zend_deactivate(TSRMLS_D) /* {{{ */
/* }}} */
BEGIN_EXTERN_C()
ZEND_API void zend_message_dispatcher(long message, const void *data TSRMLS_DC) /* {{{ */
ZEND_API void zend_message_dispatcher(zend_long message, const void *data TSRMLS_DC) /* {{{ */
{
if (zend_message_dispatcher_p) {
zend_message_dispatcher_p(message, data TSRMLS_CC);
@@ -1019,14 +1010,15 @@ ZEND_API int zend_get_configuration_directive(const char *name, uint name_length
ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
{
char *str;
int len;
va_list args;
va_list usr_copy;
zval ***params;
zval *retval;
zval *z_error_type, *z_error_message, *z_error_filename, *z_error_lineno, *z_context;
zval params[5];
zval retval;
const char *error_filename;
uint error_lineno;
zval *orig_user_error_handler;
uint error_lineno = 0;
zval orig_user_error_handler;
zend_bool in_compilation;
zend_class_entry *saved_class_entry;
zend_stack bp_stack;
@@ -1037,10 +1029,14 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
zend_stack declare_stack;
zend_stack list_stack;
zend_stack context_stack;
zend_array *symbol_table;
TSRMLS_FETCH();
/* Report about uncaught exception in case of fatal errors */
if (EG(exception)) {
zend_execute_data *ex;
zend_op *opline;
switch (type) {
case E_CORE_ERROR:
case E_ERROR:
@@ -1048,13 +1044,19 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
case E_PARSE:
case E_COMPILE_ERROR:
case E_USER_ERROR:
if (zend_is_executing(TSRMLS_C)) {
error_lineno = zend_get_executed_lineno(TSRMLS_C);
ex = EG(current_execute_data);
opline = NULL;
while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) {
ex = ex->prev_execute_data;
}
if (ex && ex->opline->opcode == ZEND_HANDLE_EXCEPTION &&
EG(opline_before_exception)) {
opline = EG(opline_before_exception);
}
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
EG(exception) = NULL;
if (zend_is_executing(TSRMLS_C) && EG(opline_ptr)) {
active_opline->lineno = error_lineno;
if (opline) {
ex->opline = opline;
}
break;
default:
@@ -1083,11 +1085,16 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
case E_USER_DEPRECATED:
case E_RECOVERABLE_ERROR:
if (zend_is_compiling(TSRMLS_C)) {
error_filename = zend_get_compiled_filename(TSRMLS_C);
error_filename = zend_get_compiled_filename(TSRMLS_C)->val;
error_lineno = zend_get_compiled_lineno(TSRMLS_C);
} else if (zend_is_executing(TSRMLS_C)) {
error_filename = zend_get_executed_filename(TSRMLS_C);
error_lineno = zend_get_executed_lineno(TSRMLS_C);
if (error_filename[0] == '[') { /* [no active file] */
error_filename = NULL;
error_lineno = 0;
} else {
error_lineno = zend_get_executed_lineno(TSRMLS_C);
}
} else {
error_filename = NULL;
error_lineno = 0;
@@ -1116,7 +1123,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
va_start(args, format);
/* if we don't have a user defined error handler */
if (!EG(user_error_handler)
if (Z_TYPE(EG(user_error_handler)) == IS_UNDEF
|| !(EG(user_error_handler_error_reporting) & type)
|| EG(error_handling) != EH_NORMAL) {
zend_error_cb(type, error_filename, error_lineno, format, args);
@@ -1132,12 +1139,6 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
break;
default:
/* Handle the error in user space */
ALLOC_INIT_ZVAL(z_error_message);
ALLOC_INIT_ZVAL(z_error_type);
ALLOC_INIT_ZVAL(z_error_filename);
ALLOC_INIT_ZVAL(z_error_lineno);
ALLOC_INIT_ZVAL(z_context);
/* va_copy() is __va_copy() in old gcc versions.
* According to the autoconf manual, using
* memcpy(&dst, &src, sizeof(va_list))
@@ -1150,44 +1151,35 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
# endif
#endif
va_copy(usr_copy, args);
Z_STRLEN_P(z_error_message) = zend_vspprintf(&Z_STRVAL_P(z_error_message), 0, format, usr_copy);
len = zend_vspprintf(&str, 0, format, usr_copy);
ZVAL_NEW_STR(&params[1], zend_string_init(str, len, 0));
efree(str);
#ifdef va_copy
va_end(usr_copy);
#endif
Z_TYPE_P(z_error_message) = IS_STRING;
Z_LVAL_P(z_error_type) = type;
Z_TYPE_P(z_error_type) = IS_LONG;
ZVAL_LONG(&params[0], type);
if (error_filename) {
ZVAL_STRING(z_error_filename, error_filename, 1);
ZVAL_STRING(&params[2], error_filename);
} else {
ZVAL_NULL(&params[2]);
}
Z_LVAL_P(z_error_lineno) = error_lineno;
Z_TYPE_P(z_error_lineno) = IS_LONG;
ZVAL_LONG(&params[3], error_lineno);
if (!EG(active_symbol_table)) {
zend_rebuild_symbol_table(TSRMLS_C);
}
symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
/* during shutdown the symbol table table can be still null */
if (!EG(active_symbol_table)) {
Z_TYPE_P(z_context) = IS_NULL;
if (!symbol_table) {
ZVAL_NULL(&params[4]);
} else {
Z_ARRVAL_P(z_context) = EG(active_symbol_table);
Z_TYPE_P(z_context) = IS_ARRAY;
zval_copy_ctor(z_context);
ZVAL_NEW_ARR(&params[4]);
zend_array_dup(Z_ARRVAL(params[4]), &symbol_table->ht);
}
params = (zval ***) emalloc(sizeof(zval **)*5);
params[0] = &z_error_type;
params[1] = &z_error_message;
params[2] = &z_error_filename;
params[3] = &z_error_lineno;
params[4] = &z_context;
orig_user_error_handler = EG(user_error_handler);
EG(user_error_handler) = NULL;
ZVAL_COPY_VALUE(&orig_user_error_handler, &EG(user_error_handler));
ZVAL_UNDEF(&EG(user_error_handler));
/* User error handler may include() additinal PHP files.
* If an error was generated during comilation PHP will compile
@@ -1209,9 +1201,10 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
CG(in_compilation) = 0;
}
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC) == SUCCESS) {
if (retval) {
if (Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval) == 0) {
ZVAL_UNDEF(&retval);
if (call_user_function_ex(CG(function_table), NULL, &orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC) == SUCCESS) {
if (Z_TYPE(retval) != IS_UNDEF) {
if (Z_TYPE(retval) == IS_FALSE) {
zend_error_cb(type, error_filename, error_lineno, format, args);
}
zval_ptr_dtor(&retval);
@@ -1234,19 +1227,17 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
CG(in_compilation) = 1;
}
if (!EG(user_error_handler)) {
EG(user_error_handler) = orig_user_error_handler;
}
else {
zval_ptr_dtor(&params[4]);
zval_ptr_dtor(&params[3]);
zval_ptr_dtor(&params[2]);
zval_ptr_dtor(&params[1]);
zval_ptr_dtor(&params[0]);
if (Z_TYPE(EG(user_error_handler)) == IS_UNDEF) {
ZVAL_COPY_VALUE(&EG(user_error_handler), &orig_user_error_handler);
} else {
zval_ptr_dtor(&orig_user_error_handler);
}
efree(params);
zval_ptr_dtor(&z_error_message);
zval_ptr_dtor(&z_error_type);
zval_ptr_dtor(&z_error_filename);
zval_ptr_dtor(&z_error_lineno);
zval_ptr_dtor(&z_context);
break;
}
@@ -1255,7 +1246,8 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
if (type == E_PARSE) {
/* eval() errors do not affect exit_status */
if (!(EG(current_execute_data) &&
EG(current_execute_data)->opline &&
EG(current_execute_data)->func &&
ZEND_USER_CODE(EG(current_execute_data)->func->type) &&
EG(current_execute_data)->opline->opcode == ZEND_INCLUDE_OR_EVAL &&
EG(current_execute_data)->opline->extended_value == ZEND_EVAL)) {
EG(exit_status) = 255;
@@ -1295,14 +1287,13 @@ ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *form
}
/* }}} */
ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_count, ...) /* {{{ */
ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval *retval, int file_count, ...) /* {{{ */
{
va_list files;
int i;
zend_file_handle *file_handle;
zend_op_array *orig_op_array = EG(active_op_array);
zval **orig_retval_ptr_ptr = EG(return_value_ptr_ptr);
long orig_interactive = CG(interactive);
zend_op_array *op_array;
zend_long orig_interactive = CG(interactive);
va_start(files, file_count);
for (i = 0; i < file_count; i++) {
@@ -1319,33 +1310,31 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
}
}
EG(active_op_array) = zend_compile_file(file_handle, type TSRMLS_CC);
op_array = zend_compile_file(file_handle, type TSRMLS_CC);
if (file_handle->opened_path) {
int dummy = 1;
zend_hash_add(&EG(included_files), file_handle->opened_path, strlen(file_handle->opened_path) + 1, (void *)&dummy, sizeof(int), NULL);
zend_hash_str_add_empty_element(&EG(included_files), file_handle->opened_path, strlen(file_handle->opened_path));
}
zend_destroy_file_handle(file_handle TSRMLS_CC);
if (EG(active_op_array)) {
EG(return_value_ptr_ptr) = retval ? retval : NULL;
zend_execute(EG(active_op_array) TSRMLS_CC);
if (op_array) {
zend_execute(op_array, retval TSRMLS_CC);
zend_exception_restore(TSRMLS_C);
if (EG(exception)) {
if (EG(user_exception_handler)) {
zval *orig_user_exception_handler;
zval **params[1], *retval2, *old_exception;
if (Z_TYPE(EG(user_exception_handler)) != IS_UNDEF) {
zval orig_user_exception_handler;
zval params[1], retval2;
zend_object *old_exception;
old_exception = EG(exception);
EG(exception) = NULL;
params[0] = &old_exception;
orig_user_exception_handler = EG(user_exception_handler);
if (call_user_function_ex(CG(function_table), NULL, orig_user_exception_handler, &retval2, 1, params, 1, NULL TSRMLS_CC) == SUCCESS) {
if (retval2 != NULL) {
zval_ptr_dtor(&retval2);
}
ZVAL_OBJ(&params[0], old_exception);
ZVAL_COPY_VALUE(&orig_user_exception_handler, &EG(user_exception_handler));
ZVAL_UNDEF(&retval2);
if (call_user_function_ex(CG(function_table), NULL, &orig_user_exception_handler, &retval2, 1, params, 1, NULL TSRMLS_CC) == SUCCESS) {
zval_ptr_dtor(&retval2);
if (EG(exception)) {
zval_ptr_dtor(&EG(exception));
OBJ_RELEASE(EG(exception));
EG(exception) = NULL;
}
zval_ptr_dtor(&old_exception);
OBJ_RELEASE(old_exception);
} else {
EG(exception) = old_exception;
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
@@ -1354,19 +1343,15 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
}
}
destroy_op_array(EG(active_op_array) TSRMLS_CC);
efree(EG(active_op_array));
destroy_op_array(op_array TSRMLS_CC);
efree(op_array);
} else if (type==ZEND_REQUIRE) {
va_end(files);
EG(active_op_array) = orig_op_array;
EG(return_value_ptr_ptr) = orig_retval_ptr_ptr;
CG(interactive) = orig_interactive;
return FAILURE;
}
}
va_end(files);
EG(active_op_array) = orig_op_array;
EG(return_value_ptr_ptr) = orig_retval_ptr_ptr;
CG(interactive) = orig_interactive;
return SUCCESS;
@@ -1382,7 +1367,7 @@ ZEND_API char *zend_make_compiled_string_description(const char *name TSRMLS_DC)
char *compiled_string_description;
if (zend_is_compiling(TSRMLS_C)) {
cur_filename = zend_get_compiled_filename(TSRMLS_C);
cur_filename = zend_get_compiled_filename(TSRMLS_C)->val;
cur_lineno = zend_get_compiled_lineno(TSRMLS_C);
} else if (zend_is_executing(TSRMLS_C)) {
cur_filename = zend_get_executed_filename(TSRMLS_C);
@@ -1401,6 +1386,12 @@ void free_estring(char **str_p) /* {{{ */
{
efree(*str_p);
}
void free_string_zval(zval *zv) /* {{{ */
{
zend_string *str = Z_PTR_P(zv);
zend_string_release(str);
}
/* }}} */
/*
+245 -267
View File
@@ -22,7 +22,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "2.6.0-dev"
#define ZEND_VERSION "2.8.0-dev"
#define ZEND_ENGINE_2
@@ -52,20 +52,20 @@
# define ZEND_PATHS_SEPARATOR ':'
#endif
#ifdef ZEND_WIN32
/* Only use this macro if you know for sure that all of the switches values
are covered by its case statements */
#define EMPTY_SWITCH_DEFAULT_CASE() \
default: \
__assume(0); \
break;
#if ZEND_DEBUG
# define EMPTY_SWITCH_DEFAULT_CASE() default: ZEND_ASSERT(0); break;
#elif defined(ZEND_WIN32)
# define EMPTY_SWITCH_DEFAULT_CASE() default: __assume(0); break;
#else
#define EMPTY_SWITCH_DEFAULT_CASE()
# define EMPTY_SWITCH_DEFAULT_CASE()
#endif
/* all HAVE_XXX test have to be after the include of zend_config above */
#include <stdio.h>
#include <assert.h>
#ifdef HAVE_UNIX_H
# include <unix.h>
@@ -179,6 +179,14 @@ char *alloca ();
# define ZEND_ATTRIBUTE_DEPRECATED
#endif
#if defined(__GNUC__) && ZEND_GCC_VERSION >= 4003
# define ZEND_ATTRIBUTE_UNUSED __attribute__((unused))
# define ZEND_ATTRIBUTE_UNUSED_LABEL __attribute__((cold, unused));
#else
# define ZEND_ATTRIBUTE_UNUSED
# define ZEND_ATTRIBUTE_UNUSED_LABEL
#endif
#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 && defined(__i386__)
# define ZEND_FASTCALL __attribute__((fastcall))
#elif defined(_MSC_VER) && defined(_M_IX86)
@@ -252,7 +260,6 @@ char *alloca ();
#include "zend_alloc.h"
#include "zend_types.h"
#include "zend_string.h"
#ifdef HAVE_LIMITS_H
# include <limits.h>
@@ -266,14 +273,14 @@ char *alloca ();
#define LONG_MIN (- LONG_MAX - 1)
#endif
#if SIZEOF_LONG == 4
#if SIZEOF_ZEND_LONG == 4
#define MAX_LENGTH_OF_LONG 11
static const char long_min_digits[] = "2147483648";
#elif SIZEOF_LONG == 8
#elif SIZEOF_ZEND_LONG == 8
#define MAX_LENGTH_OF_LONG 20
static const char long_min_digits[] = "9223372036854775808";
#else
#error "Unknown SIZEOF_LONG"
#error "Unknown SIZEOF_ZEND_LONG"
#endif
#define MAX_LENGTH_OF_DOUBLE 32
@@ -284,11 +291,16 @@ typedef enum {
} ZEND_RESULT_CODE;
#include "zend_hash.h"
#include "zend_ts_hash.h"
#include "zend_llist.h"
#define INTERNAL_FUNCTION_PARAMETERS int ht, zval *return_value, zval **return_value_ptr, zval *this_ptr, int return_value_used TSRMLS_DC
#define INTERNAL_FUNCTION_PARAM_PASSTHRU ht, return_value, return_value_ptr, this_ptr, return_value_used TSRMLS_CC
#define INTERNAL_FUNCTION_PARAMETERS uint32_t param_count, zval *return_value TSRMLS_DC
#define INTERNAL_FUNCTION_PARAM_PASSTHRU param_count, return_value TSRMLS_CC
#define USED_RET() \
(!EG(current_execute_data) || \
!EG(current_execute_data)->prev_execute_data || \
!ZEND_USER_CODE(EG(current_execute_data)->prev_execute_data->func->common.type) || \
!(EG(current_execute_data)->prev_execute_data->opline->result_type & EXT_TYPE_UNUSED))
#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)
void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((noreturn));
@@ -296,75 +308,38 @@ void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((nore
# define zend_error_noreturn zend_error
#endif
/*
* zval
*/
typedef struct _zend_class_entry zend_class_entry;
typedef struct _zend_guard {
zend_bool in_get;
zend_bool in_set;
zend_bool in_unset;
zend_bool in_isset;
zend_bool dummy; /* sizeof(zend_guard) must not be equal to sizeof(void*) */
} zend_guard;
typedef struct _zend_object {
zend_class_entry *ce;
HashTable *properties;
zval **properties_table;
HashTable *guards; /* protects from __get/__set ... recursion */
} zend_object;
#include "zend_object_handlers.h"
#include "zend_ast.h"
typedef union _zvalue_value {
long lval; /* long value */
double dval; /* double value */
struct {
char *val;
int len;
} str;
HashTable *ht; /* hash table value */
zend_object_value obj;
zend_ast *ast;
} zvalue_value;
/* overloaded elements data types */
#define OE_IS_ARRAY (1<<0)
#define OE_IS_OBJECT (1<<1)
#define OE_IS_METHOD (1<<2)
struct _zval_struct {
/* Variable information */
zvalue_value value; /* value */
zend_uint refcount__gc;
zend_uchar type; /* active type */
zend_uchar is_ref__gc;
};
#define Z_REFCOUNT_PP(ppz) Z_REFCOUNT_P(*(ppz))
#define Z_SET_REFCOUNT_PP(ppz, rc) Z_SET_REFCOUNT_P(*(ppz), rc)
#define Z_ADDREF_PP(ppz) Z_ADDREF_P(*(ppz))
#define Z_DELREF_PP(ppz) Z_DELREF_P(*(ppz))
#define Z_ISREF_PP(ppz) Z_ISREF_P(*(ppz))
#define Z_SET_ISREF_PP(ppz) Z_SET_ISREF_P(*(ppz))
#define Z_UNSET_ISREF_PP(ppz) Z_UNSET_ISREF_P(*(ppz))
#define Z_SET_ISREF_TO_PP(ppz, isref) Z_SET_ISREF_TO_P(*(ppz), isref)
#define Z_REFCOUNT_P(pz) zval_refcount_p(pz)
#define Z_REFCOUNT_P(pz) zval_refcount_p(pz)
#define Z_SET_REFCOUNT_P(pz, rc) zval_set_refcount_p(pz, rc)
#define Z_ADDREF_P(pz) zval_addref_p(pz)
#define Z_DELREF_P(pz) zval_delref_p(pz)
#define Z_ISREF_P(pz) zval_isref_p(pz)
#define Z_SET_ISREF_P(pz) zval_set_isref_p(pz)
#define Z_UNSET_ISREF_P(pz) zval_unset_isref_p(pz)
#define Z_SET_ISREF_TO_P(pz, isref) zval_set_isref_to_p(pz, isref)
#define Z_ADDREF_P(pz) zval_addref_p(pz)
#define Z_DELREF_P(pz) zval_delref_p(pz)
#define Z_REFCOUNT(z) Z_REFCOUNT_P(&(z))
#define Z_REFCOUNT(z) Z_REFCOUNT_P(&(z))
#define Z_SET_REFCOUNT(z, rc) Z_SET_REFCOUNT_P(&(z), rc)
#define Z_ADDREF(z) Z_ADDREF_P(&(z))
#define Z_DELREF(z) Z_DELREF_P(&(z))
#define Z_ISREF(z) Z_ISREF_P(&(z))
#define Z_SET_ISREF(z) Z_SET_ISREF_P(&(z))
#define Z_UNSET_ISREF(z) Z_UNSET_ISREF_P(&(z))
#define Z_SET_ISREF_TO(z, isref) Z_SET_ISREF_TO_P(&(z), isref)
#define Z_ADDREF(z) Z_ADDREF_P(&(z))
#define Z_DELREF(z) Z_DELREF_P(&(z))
#define Z_TRY_ADDREF_P(pz) do { \
if (Z_REFCOUNTED_P((pz))) { \
Z_ADDREF_P((pz)); \
} \
} while (0)
#define Z_TRY_DELREF_P(pz) do { \
if (Z_REFCOUNTED_P((pz))) { \
Z_DELREF_P((pz)); \
} \
} while (0)
#define Z_TRY_ADDREF(z) Z_TRY_ADDREF_P(&(z))
#define Z_TRY_DELREF(z) Z_TRY_DELREF_P(&(z))
#if ZEND_DEBUG
#define zend_always_inline inline
@@ -388,43 +363,63 @@ struct _zval_struct {
#endif /* ZEND_DEBUG */
#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)
# define EXPECTED(condition) __builtin_expect(condition, 1)
# define UNEXPECTED(condition) __builtin_expect(condition, 0)
# define EXPECTED(condition) __builtin_expect(!(!(condition)), 1)
# define UNEXPECTED(condition) __builtin_expect(!(!(condition)), 0)
#else
# define EXPECTED(condition) (condition)
# define UNEXPECTED(condition) (condition)
#endif
static zend_always_inline zend_uint zval_refcount_p(zval* pz) {
return pz->refcount__gc;
#ifndef XtOffsetOf
# if defined(CRAY) || (defined(__ARMCC_VERSION) && !defined(LINUX))
# ifdef __STDC__
# define XtOffset(p_type, field) _Offsetof(p_type, field)
# else
# ifdef CRAY2
# define XtOffset(p_type, field) \
(sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
# else /* !CRAY2 */
# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field))
# endif /* !CRAY2 */
# endif /* __STDC__ */
# else /* ! (CRAY || __arm) */
# define XtOffset(p_type, field) \
((zend_long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
# endif /* !CRAY */
# ifdef offsetof
# define XtOffsetOf(s_type, field) offsetof(s_type, field)
# else
# define XtOffsetOf(s_type, field) XtOffset(s_type*, field)
# endif
#endif
#include "zend_string.h"
static zend_always_inline uint32_t zval_refcount_p(zval* pz) {
ZEND_ASSERT(Z_REFCOUNTED_P(pz) || Z_IMMUTABLE_P(pz));
return GC_REFCOUNT(Z_COUNTED_P(pz));
}
static zend_always_inline zend_uint zval_set_refcount_p(zval* pz, zend_uint rc) {
return pz->refcount__gc = rc;
static zend_always_inline uint32_t zval_set_refcount_p(zval* pz, uint32_t rc) {
ZEND_ASSERT(Z_REFCOUNTED_P(pz));
return GC_REFCOUNT(Z_COUNTED_P(pz)) = rc;
}
static zend_always_inline zend_uint zval_addref_p(zval* pz) {
return ++pz->refcount__gc;
static zend_always_inline uint32_t zval_addref_p(zval* pz) {
ZEND_ASSERT(Z_REFCOUNTED_P(pz));
return ++GC_REFCOUNT(Z_COUNTED_P(pz));
}
static zend_always_inline zend_uint zval_delref_p(zval* pz) {
return --pz->refcount__gc;
}
static zend_always_inline zend_bool zval_isref_p(zval* pz) {
return pz->is_ref__gc;
}
static zend_always_inline zend_bool zval_set_isref_p(zval* pz) {
return pz->is_ref__gc = 1;
}
static zend_always_inline zend_bool zval_unset_isref_p(zval* pz) {
return pz->is_ref__gc = 0;
}
static zend_always_inline zend_bool zval_set_isref_to_p(zval* pz, zend_bool isref) {
return pz->is_ref__gc = isref;
static zend_always_inline uint32_t zval_delref_p(zval* pz) {
ZEND_ASSERT(Z_REFCOUNTED_P(pz));
return --GC_REFCOUNT(Z_COUNTED_P(pz));
}
/* excpt.h on Digital Unix 4.0 defines function_table */
@@ -442,20 +437,18 @@ typedef struct _zend_serialize_data zend_serialize_data;
typedef struct _zend_unserialize_data zend_unserialize_data;
struct _zend_trait_method_reference {
const char* method_name;
unsigned int mname_len;
zend_string *method_name;
zend_class_entry *ce;
const char* class_name;
unsigned int cname_len;
zend_string *class_name;
};
typedef struct _zend_trait_method_reference zend_trait_method_reference;
struct _zend_trait_precedence {
zend_trait_method_reference *trait_method;
zend_class_entry** exclude_from_classes;
zend_trait_method_reference *trait_method;
union {
zend_class_entry *ce;
zend_string *class_name;
} *exclude_from_classes;
};
typedef struct _zend_trait_precedence zend_trait_precedence;
@@ -465,29 +458,27 @@ struct _zend_trait_alias {
/**
* name for method to be added
*/
const char* alias;
unsigned int alias_len;
zend_string *alias;
/**
* modifiers to be set on trait method
*/
zend_uint modifiers;
uint32_t modifiers;
};
typedef struct _zend_trait_alias zend_trait_alias;
struct _zend_class_entry {
char type;
const char *name;
zend_uint name_length;
zend_string *name;
struct _zend_class_entry *parent;
int refcount;
zend_uint ce_flags;
uint32_t ce_flags;
HashTable function_table;
HashTable properties_info;
zval **default_properties_table;
zval **default_static_members_table;
zval **static_members_table;
zval *default_properties_table;
zval *default_static_members_table;
zval *static_members_table;
HashTable constants_table;
int default_properties_count;
int default_static_members_count;
@@ -509,30 +500,29 @@ struct _zend_class_entry {
zend_class_iterator_funcs iterator_funcs;
/* handlers */
zend_object_value (*create_object)(zend_class_entry *class_type TSRMLS_DC);
zend_object* (*create_object)(zend_class_entry *class_type TSRMLS_DC);
zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type TSRMLS_DC); /* a class implements this interface */
union _zend_function *(*get_static_method)(zend_class_entry *ce, char* method, int method_len TSRMLS_DC);
union _zend_function *(*get_static_method)(zend_class_entry *ce, zend_string* method TSRMLS_DC);
/* serializer callbacks */
int (*serialize)(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC);
int (*unserialize)(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC);
int (*serialize)(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC);
int (*unserialize)(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC);
zend_class_entry **interfaces;
zend_uint num_interfaces;
uint32_t num_interfaces;
zend_class_entry **traits;
zend_uint num_traits;
uint32_t num_traits;
zend_trait_alias **trait_aliases;
zend_trait_precedence **trait_precedences;
union {
struct {
const char *filename;
zend_uint line_start;
zend_uint line_end;
const char *doc_comment;
zend_uint doc_comment_len;
zend_string *filename;
uint32_t line_start;
uint32_t line_end;
zend_string *doc_comment;
} user;
struct {
const struct _zend_function_entry *builtin_functions;
@@ -544,17 +534,18 @@ struct _zend_class_entry {
#include "zend_stream.h"
typedef struct _zend_utility_functions {
void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
int (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
int (*write_function)(const char *str, uint str_length);
size_t (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
size_t (*write_function)(const char *str, size_t str_length);
FILE *(*fopen_function)(const char *filename, char **opened_path TSRMLS_DC);
void (*message_handler)(long message, const void *data TSRMLS_DC);
void (*block_interruptions)(void);
void (*unblock_interruptions)(void);
int (*get_configuration_directive)(const char *name, uint name_length, zval *contents);
void (*ticks_function)(int ticks);
void (*ticks_function)(int ticks TSRMLS_DC);
void (*on_timeout)(int seconds TSRMLS_DC);
int (*stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
int (*vspprintf_function)(char **pbuf, size_t max_len, const char *format, va_list ap);
size_t (*vspprintf_function)(char **pbuf, size_t max_len, const char *format, va_list ap);
zend_string *(*vstrpprintf_function)(size_t max_len, const char *format, va_list ap);
char *(*getenv_function)(char *name, size_t name_len TSRMLS_DC);
char *(*resolve_path_function)(const char *filename, int filename_len TSRMLS_DC);
} zend_utility_functions;
@@ -578,33 +569,6 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
#define ZEND_TRUTH(x) ((x) ? 1 : 0)
#define ZEND_LOG_XOR(a, b) (ZEND_TRUTH(a) ^ ZEND_TRUTH(b))
/* data types */
/* All data types <= IS_BOOL have their constructor/destructors skipped */
#define IS_NULL 0
#define IS_LONG 1
#define IS_DOUBLE 2
#define IS_BOOL 3
#define IS_ARRAY 4
#define IS_OBJECT 5
#define IS_STRING 6
#define IS_RESOURCE 7
#define IS_CONSTANT 8
#define IS_CONSTANT_AST 9
#define IS_CALLABLE 10
#define IS_CONSTANT_TYPE_MASK 0x00f
#define IS_CONSTANT_UNQUALIFIED 0x010
#define IS_LEXICAL_VAR 0x020
#define IS_LEXICAL_REF 0x040
#define IS_CONSTANT_IN_NAMESPACE 0x100
#define IS_CONSTANT_TYPE(type) (((type) & IS_CONSTANT_TYPE_MASK) >= IS_CONSTANT && ((type) & IS_CONSTANT_TYPE_MASK) <= IS_CONSTANT_AST)
/* overloaded elements data types */
#define OE_IS_ARRAY (1<<0)
#define OE_IS_OBJECT (1<<1)
#define OE_IS_METHOD (1<<2)
int zend_startup(zend_utility_functions *utility_functions, char **extensions TSRMLS_DC);
void zend_shutdown(TSRMLS_D);
void zend_register_standard_ini_entries(TSRMLS_D);
@@ -645,9 +609,9 @@ END_EXTERN_C()
BEGIN_EXTERN_C()
ZEND_API char *get_zend_version(void);
ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_copy);
ZEND_API int zend_print_zval(zval *expr, int indent);
ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent);
ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy TSRMLS_DC);
ZEND_API int zend_print_zval(zval *expr, int indent TSRMLS_DC);
ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC);
ZEND_API void zend_print_zval_r(zval *expr, int indent TSRMLS_DC);
ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC);
ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC);
@@ -671,22 +635,9 @@ END_EXTERN_C()
BEGIN_EXTERN_C()
ZEND_API void free_estring(char **str_p);
ZEND_API void free_string_zval(zval *zv);
END_EXTERN_C()
/* FIXME: Check if we can save if (ptr) too */
#define STR_FREE(ptr) if (ptr) { str_efree(ptr); }
#define STR_FREE_REL(ptr) if (ptr) { str_efree_rel(ptr); }
#ifndef ZTS
#define STR_EMPTY_ALLOC() CG(interned_empty_string)? CG(interned_empty_string) : estrndup("", sizeof("")-1)
#else
#define STR_EMPTY_ALLOC() estrndup("", sizeof("")-1)
#endif
#define STR_REALLOC(ptr, size) \
ptr = (char *) erealloc(ptr, size);
/* output support */
#define ZEND_WRITE(str, str_len) zend_write((str), (str_len))
#define ZEND_WRITE_EX(str, str_len) write_func((str), (str_len))
@@ -695,16 +646,17 @@ END_EXTERN_C()
#define ZEND_PUTC(c) zend_write(&(c), 1)
BEGIN_EXTERN_C()
extern ZEND_API int (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
extern ZEND_API size_t (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
extern ZEND_API zend_write_func_t zend_write;
extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC);
extern ZEND_API void (*zend_block_interruptions)(void);
extern ZEND_API void (*zend_unblock_interruptions)(void);
extern ZEND_API void (*zend_ticks_function)(int ticks);
extern ZEND_API void (*zend_ticks_function)(int ticks TSRMLS_DC);
extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
extern ZEND_API void (*zend_on_timeout)(int seconds TSRMLS_DC);
extern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
extern int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
extern size_t (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
extern zend_string *(*zend_vstrpprintf)(size_t max_len, const char *format, va_list ap);
extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
extern ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
@@ -733,7 +685,7 @@ END_EXTERN_C()
#endif
BEGIN_EXTERN_C()
ZEND_API void zend_message_dispatcher(long message, const void *data TSRMLS_DC);
ZEND_API void zend_message_dispatcher(zend_long message, const void *data TSRMLS_DC);
ZEND_API int zend_get_configuration_directive(const char *name, uint name_length, zval *contents);
END_EXTERN_C()
@@ -747,101 +699,127 @@ END_EXTERN_C()
#define ZMSG_LOG_SCRIPT_NAME 6L
#define ZMSG_MEMORY_LEAKS_GRAND_TOTAL 7L
#define INIT_PZVAL(z) \
(z)->refcount__gc = 1; \
(z)->is_ref__gc = 0;
#define INIT_ZVAL(z) z = zval_used_for_init;
#define ALLOC_INIT_ZVAL(zp) \
ALLOC_ZVAL(zp); \
INIT_ZVAL(*zp);
#define MAKE_STD_ZVAL(zv) \
ALLOC_ZVAL(zv); \
INIT_PZVAL(zv);
#define PZVAL_IS_REF(z) Z_ISREF_P(z)
#define ZVAL_COPY_VALUE(z, v) \
do { \
(z)->value = (v)->value; \
Z_TYPE_P(z) = Z_TYPE_P(v); \
#define ZVAL_COPY_VALUE(z, v) \
do { \
zval *_z1 = (z); \
zval *_z2 = (v); \
(_z1)->value = (_z2)->value; \
Z_TYPE_INFO_P(_z1) = Z_TYPE_INFO_P(_z2); \
} while (0)
#define INIT_PZVAL_COPY(z, v) \
do { \
ZVAL_COPY_VALUE(z, v); \
Z_SET_REFCOUNT_P(z, 1); \
Z_UNSET_ISREF_P(z); \
#define ZVAL_COPY(z, v) \
do { \
zval *__z1 = (z); \
zval *__z2 = (v); \
ZVAL_COPY_VALUE(__z1, __z2); \
if (Z_OPT_REFCOUNTED_P(__z1)) { \
Z_ADDREF_P(__z1); \
} \
} while (0)
#define SEPARATE_ZVAL(ppzv) \
do { \
if (Z_REFCOUNT_PP((ppzv)) > 1) { \
zval *new_zv; \
Z_DELREF_PP(ppzv); \
ALLOC_ZVAL(new_zv); \
INIT_PZVAL_COPY(new_zv, *(ppzv)); \
*(ppzv) = new_zv; \
zval_copy_ctor(new_zv); \
} \
#define ZVAL_DUP(z, v) \
do { \
zval *__z1 = (z); \
zval *__z2 = (v); \
ZVAL_COPY_VALUE(__z1, __z2); \
zval_opt_copy_ctor(__z1); \
} while (0)
#define SEPARATE_ZVAL_IF_NOT_REF(ppzv) \
if (!PZVAL_IS_REF(*ppzv)) { \
SEPARATE_ZVAL(ppzv); \
}
#define ZVAL_DEREF(z) do { \
if (UNEXPECTED(Z_ISREF_P(z))) { \
(z) = Z_REFVAL_P(z); \
} \
} while (0)
#define SEPARATE_ZVAL_TO_MAKE_IS_REF(ppzv) \
if (!PZVAL_IS_REF(*ppzv)) { \
SEPARATE_ZVAL(ppzv); \
Z_SET_ISREF_PP((ppzv)); \
}
#define ZVAL_MAKE_REF(zv) do { \
zval *__zv = (zv); \
if (!Z_ISREF_P(__zv)) { \
ZVAL_NEW_REF(__zv, __zv); \
} \
} while (0)
#define COPY_PZVAL_TO_ZVAL(zv, pzv) \
(zv) = *(pzv); \
if (Z_REFCOUNT_P(pzv)>1) { \
zval_copy_ctor(&(zv)); \
Z_DELREF_P((pzv)); \
} else { \
FREE_ZVAL(pzv); \
} \
INIT_PZVAL(&(zv));
#define MAKE_COPY_ZVAL(ppzv, pzv) \
INIT_PZVAL_COPY(pzv, *(ppzv)); \
zval_copy_ctor((pzv));
#define ZVAL_UNREF(z) do { \
zval *_z = (z); \
zend_reference *ref; \
ZEND_ASSERT(Z_ISREF_P(_z)); \
ref = Z_REF_P(_z); \
ZVAL_COPY_VALUE(_z, &ref->val); \
efree(ref); \
} while (0)
#define REPLACE_ZVAL_VALUE(ppzv_dest, pzv_src, copy) { \
int is_ref, refcount; \
\
SEPARATE_ZVAL_IF_NOT_REF(ppzv_dest); \
is_ref = Z_ISREF_PP(ppzv_dest); \
refcount = Z_REFCOUNT_PP(ppzv_dest); \
zval_dtor(*ppzv_dest); \
ZVAL_COPY_VALUE(*ppzv_dest, pzv_src); \
if (copy) { \
zval_copy_ctor(*ppzv_dest); \
} \
Z_SET_ISREF_TO_PP(ppzv_dest, is_ref); \
Z_SET_REFCOUNT_PP(ppzv_dest, refcount); \
}
#define SEPARATE_STRING(zv) do { \
zval *_zv = (zv); \
if (Z_REFCOUNTED_P(_zv) && \
Z_REFCOUNT_P(_zv) > 1) { \
Z_DELREF_P(_zv); \
zval_copy_ctor_func(_zv); \
} \
} while (0)
#define SEPARATE_ARG_IF_REF(varptr) \
if (PZVAL_IS_REF(varptr)) { \
zval *original_var = varptr; \
ALLOC_ZVAL(varptr); \
INIT_PZVAL_COPY(varptr, original_var); \
zval_copy_ctor(varptr); \
} else { \
Z_ADDREF_P(varptr); \
}
#define SEPARATE_ARRAY(zv) do { \
zval *_zv = (zv); \
if (Z_REFCOUNT_P(_zv) > 1) { \
if (!Z_IMMUTABLE_P(_zv)) { \
Z_DELREF_P(_zv); \
} \
zval_copy_ctor_func(_zv); \
} \
} while (0)
#define SEPARATE_ZVAL_NOREF(zv) do { \
zval *_zv = (zv); \
if (Z_COPYABLE_P(_zv) || \
Z_IMMUTABLE_P(_zv)) { \
if (Z_REFCOUNT_P(_zv) > 1) { \
if (!Z_IMMUTABLE_P(_zv)) { \
Z_DELREF_P(_zv); \
} \
zval_copy_ctor_func(_zv); \
} \
} \
} while (0)
#define SEPARATE_ZVAL(zv) do { \
zval *_zv = (zv); \
if (Z_REFCOUNTED_P(_zv) || \
Z_IMMUTABLE_P(_zv)) { \
if (Z_REFCOUNT_P(_zv) > 1) { \
if (Z_COPYABLE_P(_zv) || \
Z_IMMUTABLE_P(_zv)) { \
if (!Z_IMMUTABLE_P(_zv)) { \
Z_DELREF_P(_zv); \
} \
zval_copy_ctor_func(_zv); \
} else if (Z_ISREF_P(_zv)) { \
Z_DELREF_P(_zv); \
ZVAL_DUP(_zv, Z_REFVAL_P(_zv)); \
} \
} \
} \
} while (0)
#define SEPARATE_ZVAL_IF_NOT_REF(zv) do { \
zval *_zv = (zv); \
if (Z_COPYABLE_P(_zv) || \
Z_IMMUTABLE_P(_zv)) { \
if (Z_REFCOUNT_P(_zv) > 1) { \
if (!Z_IMMUTABLE_P(_zv)) { \
Z_DELREF_P(_zv); \
} \
zval_copy_ctor_func(_zv); \
} \
} \
} while (0)
#define SEPARATE_ARG_IF_REF(varptr) do { \
ZVAL_DEREF(varptr); \
if (Z_REFCOUNTED_P(varptr)) { \
Z_ADDREF_P(varptr); \
} \
} while (0)
#define READY_TO_DESTROY(zv) \
(Z_REFCOUNT_P(zv) == 1 && \
(Z_TYPE_P(zv) != IS_OBJECT || \
zend_objects_store_get_refcount(zv TSRMLS_CC) == 1))
(Z_REFCOUNTED_P(zv) && Z_REFCOUNT_P(zv) == 1)
#define ZEND_MAX_RESERVED_RESOURCES 4
@@ -858,7 +836,7 @@ typedef enum {
typedef struct {
zend_error_handling_t handling;
zend_class_entry *exception;
zval *user_handler;
zval user_handler;
} zend_error_handling;
ZEND_API void zend_save_error_handling(zend_error_handling *current TSRMLS_DC);
+1318 -1218
View File
File diff suppressed because it is too large. Load diff
+794 -249
View File
File diff suppressed because it is too large. Load diff
+32 -23
View File
@@ -1231,9 +1231,9 @@ ZEND_API zend_mm_heap *zend_mm_startup(void)
}
#if ZEND_DEBUG
static long zend_mm_find_leaks(zend_mm_segment *segment, zend_mm_block *b)
static zend_long zend_mm_find_leaks(zend_mm_segment *segment, zend_mm_block *b)
{
long leaks = 0;
zend_long leaks = 0;
zend_mm_block *p, *q;
p = ZEND_MM_NEXT_BLOCK(b);
@@ -1276,7 +1276,7 @@ static void zend_mm_check_leaks(zend_mm_heap *heap TSRMLS_DC)
{
zend_mm_segment *segment = heap->segments_list;
zend_mm_block *p, *q;
zend_uint total = 0;
uint32_t total = 0;
if (!segment) {
return;
@@ -1291,7 +1291,7 @@ static void zend_mm_check_leaks(zend_mm_heap *heap TSRMLS_DC)
}
if (!ZEND_MM_IS_FREE_BLOCK(p)) {
if (p->magic == MEM_BLOCK_VALID) {
long repeated;
zend_long repeated;
zend_leak_info leak;
ZEND_MM_SET_MAGIC(p, MEM_BLOCK_LEAK);
@@ -1373,7 +1373,7 @@ static int zend_mm_check_ptr(zend_mm_heap *heap, void *ptr, int silent ZEND_FILE
#ifdef ZTS
if (ZEND_MM_BAD_THREAD_ID(p)) {
if (!silent) {
zend_debug_alloc_output("Invalid pointer: ((thread_id=0x%0.8X) != (expected=0x%0.8X))\n", (long)p->thread_id, (long)tsrm_thread_id());
zend_debug_alloc_output("Invalid pointer: ((thread_id=0x%0.8X) != (expected=0x%0.8X))\n", (zend_long)p->thread_id, (zend_long)tsrm_thread_id());
had_problems = 1;
} else {
return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
@@ -1758,11 +1758,22 @@ static void zend_mm_safe_error(zend_mm_heap *heap,
uint error_lineno;
TSRMLS_FETCH();
if (zend_is_compiling(TSRMLS_C)) {
error_filename = zend_get_compiled_filename(TSRMLS_C);
zend_string *str = zend_get_compiled_filename(TSRMLS_C);
error_filename = str ? str->val : NULL;
error_lineno = zend_get_compiled_lineno(TSRMLS_C);
} else if (EG(in_execution)) {
error_filename = EG(active_op_array)?EG(active_op_array)->filename:NULL;
error_lineno = EG(opline_ptr)?(*EG(opline_ptr))->lineno:0;
} else if (EG(current_execute_data)) {
zend_execute_data *ex = EG(current_execute_data);
while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) {
ex = ex->prev_execute_data;
}
if (ex) {
error_filename = ex->func->op_array.filename->val;
error_lineno = ex->opline->lineno;
} else {
error_filename = NULL;
error_lineno = 0;
}
} else {
error_filename = NULL;
error_lineno = 0;
@@ -1973,9 +1984,9 @@ static void *_zend_mm_alloc_int(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_D
#endif
HANDLE_UNBLOCK_INTERRUPTIONS();
#if ZEND_DEBUG
zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted at %s:%d (tried to allocate %lu bytes)", heap->limit, __zend_filename, __zend_lineno, size);
zend_mm_safe_error(heap, "Allowed memory size of " ZEND_ULONG_FMT " bytes exhausted at %s:%d (tried to allocate " ZEND_ULONG_FMT " bytes)", heap->limit, __zend_filename, __zend_lineno, size);
#else
zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted (tried to allocate %lu bytes)", heap->limit, size);
zend_mm_safe_error(heap, "Allowed memory size of " ZEND_ULONG_FMT " bytes exhausted (tried to allocate " ZEND_ULONG_FMT " bytes)", heap->limit, size);
#endif
}
@@ -2286,9 +2297,9 @@ realloc_segment:
#endif
HANDLE_UNBLOCK_INTERRUPTIONS();
#if ZEND_DEBUG
zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted at %s:%d (tried to allocate %ld bytes)", heap->limit, __zend_filename, __zend_lineno, size);
zend_mm_safe_error(heap, "Allowed memory size of " ZEND_ULONG_FMT " bytes exhausted at %s:%d (tried to allocate " ZEND_ULONG_FMT " bytes)", heap->limit, __zend_filename, __zend_lineno, size);
#else
zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted (tried to allocate %ld bytes)", heap->limit, size);
zend_mm_safe_error(heap, "Allowed memory size of " ZEND_ULONG_FMT " bytes exhausted (tried to allocate " ZEND_ULONG_FMT " bytes)", heap->limit, size);
#endif
return NULL;
}
@@ -2463,7 +2474,7 @@ ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_
static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
{
size_t res = nmemb;
unsigned long overflow = 0;
zend_ulong overflow = 0;
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1"
: "=&a"(res), "=&d" (overflow)
@@ -2483,7 +2494,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
{
size_t res = nmemb;
unsigned long overflow = 0;
zend_ulong overflow = 0;
#ifdef __ILP32__ /* x32 */
# define LP_SUFF "l"
@@ -2512,7 +2523,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
{
size_t res;
unsigned long overflow;
zend_ulong overflow;
__asm__ ("umlal %0,%1,%2,%3"
: "=r"(res), "=r"(overflow)
@@ -2533,7 +2544,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
{
size_t res;
unsigned long overflow;
zend_ulong overflow;
__asm__ ("mul %0,%2,%3\n\tumulh %1,%2,%3\n\tadds %0,%0,%4\n\tadc %1,%1,xzr"
: "=&r"(res), "=&r"(overflow)
@@ -2619,7 +2630,7 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
int length;
size_t length;
char *p;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
@@ -2638,7 +2649,7 @@ ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
return p;
}
ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
ZEND_API char *_estrndup(const char *s, size_t length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
char *p;
#ifdef ZEND_SIGNALS
@@ -2659,7 +2670,7 @@ ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_
}
ZEND_API char *zend_strndup(const char *s, uint length)
ZEND_API char *zend_strndup(const char *s, size_t length)
{
char *p;
#ifdef ZEND_SIGNALS
@@ -2682,10 +2693,8 @@ ZEND_API char *zend_strndup(const char *s, uint length)
}
ZEND_API int zend_set_memory_limit(size_t memory_limit)
ZEND_API int zend_set_memory_limit(size_t memory_limit TSRMLS_DC)
{
TSRMLS_FETCH();
AG(mm_heap)->limit = (memory_limit >= AG(mm_heap)->block_size) ? memory_limit : AG(mm_heap)->block_size;
return SUCCESS;
+11 -26
View File
@@ -26,20 +26,21 @@
#include "../TSRM/TSRM.h"
#include "zend.h"
#include "zend_types.h"
#ifndef ZEND_MM_ALIGNMENT
# define ZEND_MM_ALIGNMENT 8
# define ZEND_MM_ALIGNMENT_LOG2 3
#elif ZEND_MM_ALIGNMENT < 4
# define ZEND_MM_ALIGNMENT Z_L(8)
# define ZEND_MM_ALIGNMENT_LOG2 Z_L(3)
#elif ZEND_MM_ALIGNMENT < Z_L(4)
# undef ZEND_MM_ALIGNMENT
# undef ZEND_MM_ALIGNMENT_LOG2
# define ZEND_MM_ALIGNMENT 4
# define ZEND_MM_ALIGNMENT_LOG2 2
# define ZEND_MM_ALIGNMENT Z_L(4)
# define ZEND_MM_ALIGNMENT_LOG2 Z_L(2)
#endif
#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1)
#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-Z_L(1))
#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK)
#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - Z_L(1)) & ZEND_MM_ALIGNMENT_MASK)
typedef struct _zend_leak_info {
void *addr;
@@ -52,7 +53,7 @@ typedef struct _zend_leak_info {
BEGIN_EXTERN_C()
ZEND_API char *zend_strndup(const char *s, unsigned int length) ZEND_ATTRIBUTE_MALLOC;
ZEND_API char *zend_strndup(const char *s, size_t length) ZEND_ATTRIBUTE_MALLOC;
ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_ALLOC_SIZE(1);
ZEND_API void *_safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
@@ -63,7 +64,7 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
ZEND_API void *_safe_erealloc(void *ptr, size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
ZEND_API void *_safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset);
ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
ZEND_API char *_estrndup(const char *s, size_t length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
/* Standard wrapper macros */
@@ -136,10 +137,7 @@ inline static void * __zend_realloc(void *p, size_t len)
#define perealloc_recoverable_rel(ptr, size, persistent) ((persistent)?__zend_realloc((ptr), (size)):erealloc_recoverable_rel((ptr), (size)))
#define pestrdup_rel(s, persistent) ((persistent)?strdup(s):estrdup_rel(s))
#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):STR_EMPTY_ALLOC())
#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):STR_EMPTY_ALLOC())
ZEND_API int zend_set_memory_limit(size_t memory_limit);
ZEND_API int zend_set_memory_limit(size_t memory_limit TSRMLS_DC);
ZEND_API void start_memory_manager(TSRMLS_D);
ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC);
@@ -161,19 +159,6 @@ ZEND_API size_t zend_memory_peak_usage(int real_usage TSRMLS_DC);
END_EXTERN_C()
/* fast cache for zval's */
#define ALLOC_ZVAL(z) \
(z) = (zval *) emalloc(sizeof(zval))
#define FREE_ZVAL(z) \
efree_rel(z)
#define ALLOC_ZVAL_REL(z) \
(z) = (zval *) emalloc_rel(sizeof(zval))
#define FREE_ZVAL_REL(z) \
efree_rel(z)
/* fast cache for HashTables */
#define ALLOC_HASHTABLE(ht) \
(ht) = (HashTable *) emalloc(sizeof(HashTable))
+118
View File
@@ -0,0 +1,118 @@
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
/* $Id:$ */
#ifndef _ZEND_ARENA_H_
#define _ZEND_ARENA_H_
#include "zend.h"
typedef struct _zend_arena zend_arena;
struct _zend_arena {
char *ptr;
char *end;
zend_arena *prev;
};
static zend_always_inline zend_arena* zend_arena_create(size_t size)
{
zend_arena *arena = (zend_arena*)emalloc(size);
arena->ptr = (char*) arena + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena));
arena->end = (char*) arena + size;
arena->prev = NULL;
return arena;
}
static zend_always_inline void zend_arena_destroy(zend_arena *arena)
{
do {
zend_arena *prev = arena->prev;
efree(arena);
arena = prev;
} while (arena);
}
#define ZEND_ARENA_ALIGNMENT 8U
static zend_always_inline void* zend_arena_alloc(zend_arena **arena_ptr, size_t size)
{
zend_arena *arena = *arena_ptr;
char *ptr = arena->ptr;
size = ZEND_MM_ALIGNED_SIZE(size);
if (EXPECTED(size <= (size_t)(arena->end - ptr))) {
arena->ptr = ptr + size;
} else {
size_t arena_size =
UNEXPECTED((size + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena))) > (size_t)(arena->end - (char*) arena)) ?
(size + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena))) :
(arena->end - (char*) arena);
zend_arena *new_arena = (zend_arena*)emalloc(arena_size);
ptr = (char*) new_arena + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena));
new_arena->ptr = (char*) new_arena + ZEND_MM_ALIGNED_SIZE(sizeof(zend_arena)) + size;
new_arena->end = (char*) new_arena + arena_size;
new_arena->prev = arena;
*arena_ptr = new_arena;
}
return (void*) ptr;
}
static zend_always_inline void* zend_arena_calloc(zend_arena **arena_ptr, size_t count, size_t unit_size)
{
size_t size = unit_size * count;
void *ret;
ZEND_ASSERT(size >= unit_size && size >= count);
ret = zend_arena_alloc(arena_ptr, size);
memset(ret, 0, size);
return ret;
}
static zend_always_inline void* zend_arena_checkpoint(zend_arena *arena)
{
return arena->ptr;
}
static zend_always_inline void zend_arena_release(zend_arena **arena_ptr, void *checkpoint)
{
zend_arena *arena = *arena_ptr;
while (UNEXPECTED((char*)checkpoint > arena->end) ||
UNEXPECTED((char*)checkpoint < (char*)arena)) {
zend_arena *prev = arena->prev;
efree(arena);
*arena_ptr = arena = prev;
}
arena->ptr = (char*)checkpoint;
}
#endif /* _ZEND_ARENA_H_ */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
*/
+53 -27
View File
@@ -28,8 +28,7 @@ ZEND_API zend_ast *zend_ast_create_constant(zval *zv)
zend_ast *ast = emalloc(sizeof(zend_ast) + sizeof(zval));
ast->kind = ZEND_CONST;
ast->children = 0;
ast->u.val = (zval*)(ast + 1);
INIT_PZVAL_COPY(ast->u.val, zv);
ZVAL_COPY_VALUE(&ast->u.val, zv);
return ast;
}
@@ -89,7 +88,7 @@ ZEND_API int zend_ast_is_ct_constant(zend_ast *ast)
int i;
if (ast->kind == ZEND_CONST) {
return !IS_CONSTANT_TYPE(Z_TYPE_P(ast->u.val));
return !Z_CONSTANT(ast->u.val);
} else {
for (i = 0; i < ast->children; i++) {
if ((&ast->u.child)[i]) {
@@ -102,6 +101,37 @@ ZEND_API int zend_ast_is_ct_constant(zend_ast *ast)
}
}
static void zend_ast_add_array_element(zval *result, zval *offset, zval *expr TSRMLS_DC)
{
switch (Z_TYPE_P(offset)) {
case IS_UNDEF:
zend_hash_next_index_insert(Z_ARRVAL_P(result), expr);
break;
case IS_STRING:
zend_symtable_update(Z_ARRVAL_P(result), Z_STR_P(offset), expr);
zval_dtor(offset);
break;
case IS_NULL:
zend_symtable_update(Z_ARRVAL_P(result), STR_EMPTY_ALLOC(), expr);
break;
case IS_LONG:
zend_hash_index_update(Z_ARRVAL_P(result), Z_LVAL_P(offset), expr);
break;
case IS_FALSE:
zend_hash_index_update(Z_ARRVAL_P(result), 0, expr);
break;
case IS_TRUE:
zend_hash_index_update(Z_ARRVAL_P(result), 1, expr);
break;
case IS_DOUBLE:
zend_hash_index_update(Z_ARRVAL_P(result), zend_dval_to_lval(Z_DVAL_P(offset)), expr);
break;
default:
zend_error(E_ERROR, "Illegal offset type");
break;
}
}
ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *scope TSRMLS_DC)
{
zval op1, op2;
@@ -253,24 +283,22 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
case ZEND_CONST:
/* class constants may be updated in-place */
if (scope) {
if (IS_CONSTANT_TYPE(Z_TYPE_P(ast->u.val))) {
if (Z_OPT_CONSTANT(ast->u.val)) {
zval_update_constant_ex(&ast->u.val, 1, scope TSRMLS_CC);
}
*result = *ast->u.val;
zval_copy_ctor(result);
ZVAL_DUP(result, &ast->u.val);
} else {
*result = *ast->u.val;
zval_copy_ctor(result);
if (IS_CONSTANT_TYPE(Z_TYPE_P(result))) {
zval_update_constant_ex(&result, 1, scope TSRMLS_CC);
ZVAL_DUP(result, &ast->u.val);
if (Z_OPT_CONSTANT_P(result)) {
zval_update_constant_ex(result, 1, scope TSRMLS_CC);
}
}
break;
case ZEND_BOOL_AND:
zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
if (zend_is_true(&op1)) {
if (zend_is_true(&op1 TSRMLS_CC)) {
zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
ZVAL_BOOL(result, zend_is_true(&op2));
ZVAL_BOOL(result, zend_is_true(&op2 TSRMLS_CC));
zval_dtor(&op2);
} else {
ZVAL_BOOL(result, 0);
@@ -279,18 +307,18 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
break;
case ZEND_BOOL_OR:
zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
if (zend_is_true(&op1)) {
if (zend_is_true(&op1 TSRMLS_CC)) {
ZVAL_BOOL(result, 1);
} else {
zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
ZVAL_BOOL(result, zend_is_true(&op2));
ZVAL_BOOL(result, zend_is_true(&op2 TSRMLS_CC));
zval_dtor(&op2);
}
zval_dtor(&op1);
break;
case ZEND_SELECT:
zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
if (zend_is_true(&op1)) {
if (zend_is_true(&op1 TSRMLS_CC)) {
if (!(&ast->u.child)[1]) {
*result = op1;
} else {
@@ -315,19 +343,17 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
zval_dtor(&op2);
break;
case ZEND_INIT_ARRAY:
INIT_PZVAL(result);
array_init(result);
{
int i;
zend_bool has_key;
for (i = 0; i < ast->children; i+=2) {
zval *expr;
MAKE_STD_ZVAL(expr);
if ((has_key = !!(&ast->u.child)[i])) {
if ((&ast->u.child)[i]) {
zend_ast_evaluate(&op1, (&ast->u.child)[i], scope TSRMLS_CC);
} else {
ZVAL_UNDEF(&op1);
}
zend_ast_evaluate(expr, (&ast->u.child)[i+1], scope TSRMLS_CC);
zend_do_add_static_array_element(result, has_key?&op1:NULL, expr);
zend_ast_evaluate(&op2, (&ast->u.child)[i+1], scope TSRMLS_CC);
zend_ast_add_array_element(result, &op1, &op2 TSRMLS_CC);
}
}
break;
@@ -335,9 +361,9 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
{
zval *tmp;
zval tmp;
zend_fetch_dimension_by_zval(&tmp, &op1, &op2 TSRMLS_CC);
ZVAL_ZVAL(result, tmp, 1, 1);
ZVAL_ZVAL(result, &tmp, 1, 1);
}
zval_dtor(&op1);
zval_dtor(&op2);
@@ -352,8 +378,8 @@ ZEND_API zend_ast *zend_ast_copy(zend_ast *ast)
if (ast == NULL) {
return NULL;
} else if (ast->kind == ZEND_CONST) {
zend_ast *copy = zend_ast_create_constant(ast->u.val);
zval_copy_ctor(copy->u.val);
zend_ast *copy = zend_ast_create_constant(&ast->u.val);
zval_copy_ctor(&copy->u.val);
return copy;
} else if (ast->children) {
zend_ast *new = emalloc(sizeof(zend_ast) + sizeof(zend_ast*) * (ast->children - 1));
@@ -373,7 +399,7 @@ ZEND_API void zend_ast_destroy(zend_ast *ast)
int i;
if (ast->kind == ZEND_CONST) {
zval_dtor(ast->u.val);
zval_dtor(&ast->u.val);
} else {
for (i = 0; i < ast->children; i++) {
if ((&ast->u.child)[i]) {
+1 -3
View File
@@ -22,8 +22,6 @@
#ifndef ZEND_AST_H
#define ZEND_AST_H
typedef struct _zend_ast zend_ast;
#include "zend.h"
typedef enum _zend_ast_kind {
@@ -40,7 +38,7 @@ struct _zend_ast {
unsigned short kind;
unsigned short children;
union {
zval *val;
zval val;
zend_ast *child;
} u;
};
File diff suppressed because it is too large. Load diff
+100 -125
View File
@@ -37,7 +37,7 @@
typedef struct _zend_closure {
zend_object std;
zend_function func;
zval *this_ptr;
zval this_ptr;
HashTable *debug_info;
} zend_closure;
@@ -47,25 +47,21 @@ static zend_object_handlers closure_handlers;
ZEND_METHOD(Closure, __invoke) /* {{{ */
{
zend_function *func = EG(current_execute_data)->function_state.function;
zval ***arguments;
zval *closure_result_ptr = NULL;
zend_function *func = EG(current_execute_data)->func;
zval *arguments;
arguments = emalloc(sizeof(zval**) * ZEND_NUM_ARGS());
arguments = emalloc(sizeof(zval) * ZEND_NUM_ARGS());
if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), arguments) == FAILURE) {
efree(arguments);
zend_error(E_RECOVERABLE_ERROR, "Cannot get arguments for calling closure");
RETVAL_FALSE;
} else if (call_user_function_ex(CG(function_table), NULL, this_ptr, &closure_result_ptr, ZEND_NUM_ARGS(), arguments, 1, NULL TSRMLS_CC) == FAILURE) {
} else if (call_user_function_ex(CG(function_table), NULL, getThis(), return_value, ZEND_NUM_ARGS(), arguments, 1, NULL TSRMLS_CC) == FAILURE) {
RETVAL_FALSE;
} else if (closure_result_ptr) {
zval_ptr_dtor(&return_value);
*return_value_ptr = closure_result_ptr;
}
efree(arguments);
/* destruct the function also, then - we have allocated it in get_method */
efree((char*)func->internal_function.function_name);
zend_string_release(func->internal_function.function_name);
efree(func);
}
/* }}} */
@@ -76,13 +72,13 @@ ZEND_METHOD(Closure, bind)
{
zval *newthis, *zclosure, *scope_arg = NULL;
zend_closure *closure;
zend_class_entry *ce, **ce_p;
zend_class_entry *ce;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oo!|z", &zclosure, zend_ce_closure, &newthis, &scope_arg) == FAILURE) {
RETURN_NULL();
}
closure = (zend_closure *)zend_object_store_get_object(zclosure TSRMLS_CC);
closure = (zend_closure *)Z_OBJ_P(zclosure);
if ((newthis != NULL) && (closure->func.common.fn_flags & ZEND_ACC_STATIC)) {
zend_error(E_WARNING, "Cannot bind an instance to a static closure");
@@ -94,34 +90,16 @@ ZEND_METHOD(Closure, bind)
} else if (Z_TYPE_P(scope_arg) == IS_NULL) {
ce = NULL;
} else {
char *class_name;
int class_name_len;
zval tmp_zval;
INIT_ZVAL(tmp_zval);
if (Z_TYPE_P(scope_arg) == IS_STRING) {
class_name = Z_STRVAL_P(scope_arg);
class_name_len = Z_STRLEN_P(scope_arg);
} else {
tmp_zval = *scope_arg;
zval_copy_ctor(&tmp_zval);
convert_to_string(&tmp_zval);
class_name = Z_STRVAL(tmp_zval);
class_name_len = Z_STRLEN(tmp_zval);
}
if ((class_name_len == sizeof("static") - 1) &&
(memcmp("static", class_name, sizeof("static") - 1) == 0)) {
zend_string *class_name = zval_get_string(scope_arg);
if ((class_name->len == sizeof("static") - 1) &&
(memcmp("static", class_name->val, sizeof("static") - 1) == 0)) {
ce = closure->func.common.scope;
}
else if (zend_lookup_class_ex(class_name, class_name_len, NULL, 1, &ce_p TSRMLS_CC) == FAILURE) {
zend_error(E_WARNING, "Class '%s' not found", class_name);
zval_dtor(&tmp_zval);
} else if ((ce = zend_lookup_class_ex(class_name, NULL, 1 TSRMLS_CC)) == NULL) {
zend_error(E_WARNING, "Class '%s' not found", class_name->val);
zend_string_release(class_name);
RETURN_NULL();
} else {
ce = *ce_p;
}
zval_dtor(&tmp_zval);
zend_string_release(class_name);
}
} else { /* scope argument not given; do not change the scope by default */
ce = closure->func.common.scope;
@@ -131,7 +109,7 @@ ZEND_METHOD(Closure, bind)
}
/* }}} */
static zend_function *zend_closure_get_constructor(zval *object TSRMLS_DC) /* {{{ */
static zend_function *zend_closure_get_constructor(zend_object *object TSRMLS_DC) /* {{{ */
{
zend_error(E_RECOVERABLE_ERROR, "Instantiation of 'Closure' is not allowed");
return NULL;
@@ -140,13 +118,13 @@ static zend_function *zend_closure_get_constructor(zval *object TSRMLS_DC) /* {{
static int zend_closure_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
{
return (Z_OBJ_HANDLE_P(o1) != Z_OBJ_HANDLE_P(o2));
return (Z_OBJ_P(o1) != Z_OBJ_P(o2));
}
/* }}} */
ZEND_API zend_function *zend_get_closure_invoke_method(zval *obj TSRMLS_DC) /* {{{ */
ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *object TSRMLS_DC) /* {{{ */
{
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
zend_closure *closure = (zend_closure *)object;
zend_function *invoke = (zend_function*)emalloc(sizeof(zend_function));
invoke->common = closure->func.common;
@@ -155,65 +133,63 @@ ZEND_API zend_function *zend_get_closure_invoke_method(zval *obj TSRMLS_DC) /* {
invoke->internal_function.handler = ZEND_MN(Closure___invoke);
invoke->internal_function.module = 0;
invoke->internal_function.scope = zend_ce_closure;
invoke->internal_function.function_name = estrndup(ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1);
invoke->internal_function.function_name = zend_string_init(ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1, 0);
return invoke;
}
/* }}} */
ZEND_API const zend_function *zend_get_closure_method_def(zval *obj TSRMLS_DC) /* {{{ */
{
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
zend_closure *closure = (zend_closure *)Z_OBJ_P(obj);
return &closure->func;
}
/* }}} */
ZEND_API zval* zend_get_closure_this_ptr(zval *obj TSRMLS_DC) /* {{{ */
{
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
return closure->this_ptr;
zend_closure *closure = (zend_closure *)Z_OBJ_P(obj);
return &closure->this_ptr;
}
/* }}} */
static zend_function *zend_closure_get_method(zval **object_ptr, char *method_name, int method_len, const zend_literal *key TSRMLS_DC) /* {{{ */
static zend_function *zend_closure_get_method(zend_object **object, zend_string *method, const zval *key TSRMLS_DC) /* {{{ */
{
char *lc_name;
ALLOCA_FLAG(use_heap)
zend_string *lc_name;
lc_name = do_alloca(method_len + 1, use_heap);
zend_str_tolower_copy(lc_name, method_name, method_len);
if ((method_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1) &&
memcmp(lc_name, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
lc_name = zend_string_alloc(method->len, 0);
zend_str_tolower_copy(lc_name->val, method->val, method->len);
if ((method->len == sizeof(ZEND_INVOKE_FUNC_NAME)-1) &&
memcmp(lc_name->val, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
) {
free_alloca(lc_name, use_heap);
return zend_get_closure_invoke_method(*object_ptr TSRMLS_CC);
zend_string_free(lc_name);
return zend_get_closure_invoke_method(*object TSRMLS_CC);
}
free_alloca(lc_name, use_heap);
return std_object_handlers.get_method(object_ptr, method_name, method_len, key TSRMLS_CC);
zend_string_free(lc_name);
return std_object_handlers.get_method(object, method, key TSRMLS_CC);
}
/* }}} */
static zval *zend_closure_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) /* {{{ */
static zval *zend_closure_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) /* {{{ */
{
ZEND_CLOSURE_PROPERTY_ERROR();
Z_ADDREF(EG(uninitialized_zval));
return &EG(uninitialized_zval);
}
/* }}} */
static void zend_closure_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC) /* {{{ */
static void zend_closure_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) /* {{{ */
{
ZEND_CLOSURE_PROPERTY_ERROR();
}
/* }}} */
static zval **zend_closure_get_property_ptr_ptr(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) /* {{{ */
static zval *zend_closure_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */
{
ZEND_CLOSURE_PROPERTY_ERROR();
return NULL;
}
/* }}} */
static int zend_closure_has_property(zval *object, zval *member, int has_set_exists, const zend_literal *key TSRMLS_DC) /* {{{ */
static int zend_closure_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot TSRMLS_DC) /* {{{ */
{
if (has_set_exists != 2) {
ZEND_CLOSURE_PROPERTY_ERROR();
@@ -222,13 +198,13 @@ static int zend_closure_has_property(zval *object, zval *member, int has_set_exi
}
/* }}} */
static void zend_closure_unset_property(zval *object, zval *member, const zend_literal *key TSRMLS_DC) /* {{{ */
static void zend_closure_unset_property(zval *object, zval *member, void **cache_slot TSRMLS_DC) /* {{{ */
{
ZEND_CLOSURE_PROPERTY_ERROR();
}
/* }}} */
static void zend_closure_free_storage(void *object TSRMLS_DC) /* {{{ */
static void zend_closure_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
{
zend_closure *closure = (zend_closure *)object;
@@ -237,7 +213,7 @@ static void zend_closure_free_storage(void *object TSRMLS_DC) /* {{{ */
if (closure->func.type == ZEND_USER_FUNCTION) {
zend_execute_data *ex = EG(current_execute_data);
while (ex) {
if (ex->op_array == &closure->func.op_array) {
if (ex->func == &closure->func) {
zend_error(E_ERROR, "Cannot destroy active lambda function");
}
ex = ex->prev_execute_data;
@@ -250,42 +226,37 @@ static void zend_closure_free_storage(void *object TSRMLS_DC) /* {{{ */
efree(closure->debug_info);
}
if (closure->this_ptr) {
if (Z_TYPE(closure->this_ptr) != IS_UNDEF) {
zval_ptr_dtor(&closure->this_ptr);
}
efree(closure);
}
/* }}} */
static zend_object_value zend_closure_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
static zend_object *zend_closure_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
{
zend_closure *closure;
zend_object_value object;
closure = emalloc(sizeof(zend_closure));
memset(closure, 0, sizeof(zend_closure));
zend_object_std_init(&closure->std, class_type TSRMLS_CC);
closure->std.handlers = &closure_handlers;
object.handle = zend_objects_store_put(closure, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) zend_closure_free_storage, NULL TSRMLS_CC);
object.handlers = &closure_handlers;
return object;
return (zend_object*)closure;
}
/* }}} */
static zend_object_value zend_closure_clone(zval *zobject TSRMLS_DC) /* {{{ */
static zend_object *zend_closure_clone(zval *zobject TSRMLS_DC) /* {{{ */
{
zend_closure *closure = (zend_closure *)zend_object_store_get_object(zobject TSRMLS_CC);
zend_closure *closure = (zend_closure *)Z_OBJ_P(zobject);
zval result;
zend_create_closure(&result, &closure->func, closure->func.common.scope, closure->this_ptr TSRMLS_CC);
return Z_OBJVAL(result);
zend_create_closure(&result, &closure->func, closure->func.common.scope, &closure->this_ptr TSRMLS_CC);
return Z_OBJ(result);
}
/* }}} */
int zend_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC) /* {{{ */
int zend_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr TSRMLS_DC) /* {{{ */
{
zend_closure *closure;
@@ -293,17 +264,17 @@ int zend_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function
return FAILURE;
}
closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
closure = (zend_closure *)Z_OBJ_P(obj);
*fptr_ptr = &closure->func;
if (closure->this_ptr) {
if (zobj_ptr) {
*zobj_ptr = closure->this_ptr;
if (Z_TYPE(closure->this_ptr) != IS_UNDEF) {
if (obj_ptr) {
*obj_ptr = Z_OBJ(closure->this_ptr);
}
*ce_ptr = Z_OBJCE_P(closure->this_ptr);
*ce_ptr = Z_OBJCE(closure->this_ptr);
} else {
if (zobj_ptr) {
*zobj_ptr = NULL;
if (obj_ptr) {
*obj_ptr = NULL;
}
*ce_ptr = closure->func.common.scope;
}
@@ -313,55 +284,52 @@ int zend_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function
static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
{
zend_closure *closure = (zend_closure *)zend_object_store_get_object(object TSRMLS_CC);
zval *val;
zend_closure *closure = (zend_closure *)Z_OBJ_P(object);
zval val;
struct _zend_arg_info *arg_info = closure->func.common.arg_info;
*is_temp = 0;
if (closure->debug_info == NULL) {
ALLOC_HASHTABLE(closure->debug_info);
zend_hash_init(closure->debug_info, 1, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_init(closure->debug_info, 8, NULL, ZVAL_PTR_DTOR, 0);
}
if (closure->debug_info->nApplyCount == 0) {
if (closure->debug_info->u.v.nApplyCount == 0) {
if (closure->func.type == ZEND_USER_FUNCTION && closure->func.op_array.static_variables) {
HashTable *static_variables = closure->func.op_array.static_variables;
MAKE_STD_ZVAL(val);
array_init(val);
zend_hash_copy(Z_ARRVAL_P(val), static_variables, (copy_ctor_func_t)zval_add_ref, NULL, sizeof(zval*));
zend_hash_update(closure->debug_info, "static", sizeof("static"), (void *) &val, sizeof(zval *), NULL);
ZVAL_NEW_ARR(&val);
zend_array_dup(Z_ARRVAL(val), static_variables);
zend_hash_str_update(closure->debug_info, "static", sizeof("static")-1, &val);
}
if (closure->this_ptr) {
Z_ADDREF_P(closure->this_ptr);
zend_symtable_update(closure->debug_info, "this", sizeof("this"), (void *) &closure->this_ptr, sizeof(zval *), NULL);
if (Z_TYPE(closure->this_ptr) != IS_UNDEF) {
Z_ADDREF(closure->this_ptr);
zend_hash_str_update(closure->debug_info, "this", sizeof("this")-1, &closure->this_ptr);
}
if (arg_info) {
zend_uint i, required = closure->func.common.required_num_args;
uint32_t i, required = closure->func.common.required_num_args;
MAKE_STD_ZVAL(val);
array_init(val);
array_init(&val);
for (i = 0; i < closure->func.common.num_args; i++) {
char *name, *info;
int name_len, info_len;
zend_string *name;
zval info;
if (arg_info->name) {
name_len = zend_spprintf(&name, 0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
arg_info->name);
name = zend_strpprintf(0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
arg_info->name);
} else {
name_len = zend_spprintf(&name, 0, "%s$param%d",
arg_info->pass_by_reference ? "&" : "",
i + 1);
name = zend_strpprintf(0, "%s$param%d",
arg_info->pass_by_reference ? "&" : "",
i + 1);
}
info_len = zend_spprintf(&info, 0, "%s",
i >= required ? "<optional>" : "<required>");
add_assoc_stringl_ex(val, name, name_len + 1, info, info_len, 0);
efree(name);
ZVAL_STR(&info, zend_strpprintf(0, "%s", i >= required ? "<optional>" : "<required>"));
zend_hash_update(Z_ARRVAL(val), name, &info);
zend_string_release(name);
arg_info++;
}
zend_hash_update(closure->debug_info, "parameter", sizeof("parameter"), (void *) &val, sizeof(zval *), NULL);
zend_hash_str_update(closure->debug_info, "parameter", sizeof("parameter")-1, &val);
}
}
@@ -369,12 +337,18 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_
}
/* }}} */
static HashTable *zend_closure_get_gc(zval *obj, zval ***table, int *n TSRMLS_DC) /* {{{ */
static HashTable *zend_closure_get_gc(zval *obj, zval **table, int *n TSRMLS_DC) /* {{{ */
{
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
zend_closure *closure = (zend_closure *)Z_OBJ_P(obj);
*table = closure->this_ptr ? &closure->this_ptr : NULL;
*n = closure->this_ptr ? 1 : 0;
if (closure->debug_info != NULL) {
zend_hash_destroy(closure->debug_info);
efree(closure->debug_info);
closure->debug_info = NULL;
}
*table = Z_TYPE(closure->this_ptr) != IS_NULL ? &closure->this_ptr : NULL;
*n = Z_TYPE(closure->this_ptr) != IS_NULL ? 1 : 0;
return (closure->func.type == ZEND_USER_FUNCTION) ?
closure->func.op_array.static_variables : NULL;
}
@@ -418,6 +392,8 @@ void zend_register_closure_ce(TSRMLS_D) /* {{{ */
zend_ce_closure->unserialize = zend_class_unserialize_deny;
memcpy(&closure_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
closure_handlers.free_obj = zend_closure_free_storage;
closure_handlers.clone_obj = NULL;
closure_handlers.get_constructor = zend_closure_get_constructor;
closure_handlers.get_method = zend_closure_get_method;
closure_handlers.write_property = zend_closure_write_property;
@@ -439,12 +415,12 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
object_init_ex(res, zend_ce_closure);
closure = (zend_closure *)zend_object_store_get_object(res TSRMLS_CC);
closure = (zend_closure *)Z_OBJ_P(res);
closure->func = *func;
closure->func.common.prototype = NULL;
if ((scope == NULL) && (this_ptr != NULL)) {
if ((scope == NULL) && this_ptr && (Z_TYPE_P(this_ptr) != IS_UNDEF)) {
/* use dummy scope if we're binding an object without specifying a scope */
/* maybe it would be better to create one for this purpose */
scope = zend_ce_closure;
@@ -456,7 +432,7 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
ALLOC_HASHTABLE(closure->func.op_array.static_variables);
zend_hash_init(closure->func.op_array.static_variables, zend_hash_num_elements(static_variables), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_apply_with_arguments(static_variables TSRMLS_CC, (apply_func_args_t)zval_copy_static_var, 1, closure->func.op_array.static_variables);
zend_hash_apply_with_arguments(static_variables TSRMLS_CC, zval_copy_static_var, 1, closure->func.op_array.static_variables);
}
closure->func.op_array.run_time_cache = NULL;
(*closure->func.op_array.refcount)++;
@@ -464,12 +440,12 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
/* verify that we aren't binding internal function to a wrong scope */
if(func->common.scope != NULL) {
if(scope && !instanceof_function(scope, func->common.scope TSRMLS_CC)) {
zend_error(E_WARNING, "Cannot bind function %s::%s to scope class %s", func->common.scope->name, func->common.function_name, scope->name);
zend_error(E_WARNING, "Cannot bind function %s::%s to scope class %s", func->common.scope->name->val, func->common.function_name->val, scope->name->val);
scope = NULL;
}
if(scope && this_ptr && (func->common.fn_flags & ZEND_ACC_STATIC) == 0 &&
!instanceof_function(Z_OBJCE_P(this_ptr), closure->func.common.scope TSRMLS_CC)) {
zend_error(E_WARNING, "Cannot bind function %s::%s to object of class %s", func->common.scope->name, func->common.function_name, Z_OBJCE_P(this_ptr)->name);
zend_error(E_WARNING, "Cannot bind function %s::%s to object of class %s", func->common.scope->name->val, func->common.function_name->val, Z_OBJCE_P(this_ptr)->name->val);
scope = NULL;
this_ptr = NULL;
}
@@ -480,16 +456,15 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
}
}
closure->this_ptr = NULL;
ZVAL_UNDEF(&closure->this_ptr);
/* Invariants:
* If the closure is unscoped, it has no bound object.
* The the closure is scoped, it's either static or it's bound */
closure->func.common.scope = scope;
if (scope) {
closure->func.common.fn_flags |= ZEND_ACC_PUBLIC;
if (this_ptr && (closure->func.common.fn_flags & ZEND_ACC_STATIC) == 0) {
closure->this_ptr = this_ptr;
Z_ADDREF_P(this_ptr);
if (this_ptr && Z_TYPE_P(this_ptr) == IS_OBJECT && (closure->func.common.fn_flags & ZEND_ACC_STATIC) == 0) {
ZVAL_COPY(&closure->this_ptr, this_ptr);
} else {
closure->func.common.fn_flags |= ZEND_ACC_STATIC;
}
+1 -1
View File
@@ -29,7 +29,7 @@ void zend_register_closure_ce(TSRMLS_D);
extern ZEND_API zend_class_entry *zend_ce_closure;
ZEND_API void zend_create_closure(zval *res, zend_function *op_array, zend_class_entry *scope, zval *this_ptr TSRMLS_DC);
ZEND_API zend_function *zend_get_closure_invoke_method(zval *obj TSRMLS_DC);
ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *obj TSRMLS_DC);
ZEND_API const zend_function *zend_get_closure_method_def(zval *obj TSRMLS_DC);
ZEND_API zval* zend_get_closure_this_ptr(zval *obj TSRMLS_DC);
+1712 -1235
View File
File diff suppressed because it is too large. Load diff
+181 -197
View File
@@ -45,45 +45,32 @@
#define RESET_DOC_COMMENT() \
{ \
if (CG(doc_comment)) { \
efree(CG(doc_comment)); \
zend_string_release(CG(doc_comment)); \
CG(doc_comment) = NULL; \
} \
CG(doc_comment_len) = 0; \
}
typedef struct _zend_op_array zend_op_array;
typedef struct _zend_op zend_op;
typedef struct _zend_compiler_context {
zend_uint opcodes_size;
uint32_t opcodes_size;
int vars_size;
int literals_size;
int current_brk_cont;
int backpatch_count;
int nested_calls;
int used_stack;
int in_finally;
HashTable *labels;
} zend_compiler_context;
typedef struct _zend_literal {
zval constant;
zend_ulong hash_value;
zend_uint cache_slot;
} zend_literal;
#define Z_HASH_P(zv) \
(((zend_literal*)(zv))->hash_value)
typedef union _znode_op {
zend_uint constant;
zend_uint var;
zend_uint num;
uint32_t constant;
uint32_t var;
uint32_t num;
zend_ulong hash;
zend_uint opline_num; /* Needs to be signed */
uint32_t opline_num; /* Needs to be signed */
zend_op *jmp_addr;
zval *zv;
zend_literal *literal;
void *ptr; /* Used for passing pointers from the compile to execution phase, currently used for traits */
} znode_op;
@@ -95,7 +82,7 @@ typedef struct _znode { /* used only during compilation */
zend_op_array *op_array;
zend_ast *ast;
} u;
zend_uint EA; /* extended attributes */
uint32_t EA; /* extended attributes */
} znode;
typedef struct _zend_execute_data zend_execute_data;
@@ -113,7 +100,7 @@ struct _zend_op {
znode_op op1;
znode_op op2;
znode_op result;
ulong extended_value;
zend_ulong extended_value;
uint lineno;
zend_uchar opcode;
zend_uchar op1_type;
@@ -131,20 +118,24 @@ typedef struct _zend_brk_cont_element {
typedef struct _zend_label {
int brk_cont;
zend_uint opline_num;
uint32_t opline_num;
} zend_label;
typedef struct _zend_try_catch_element {
zend_uint try_op;
zend_uint catch_op; /* ketchup! */
zend_uint finally_op;
zend_uint finally_end;
uint32_t try_op;
uint32_t catch_op; /* ketchup! */
uint32_t finally_op;
uint32_t finally_end;
} zend_try_catch_element;
#if SIZEOF_LONG == 8
#define THIS_HASHVAL 210728972157UL
#if SIZEOF_ZEND_LONG == 8
# ifdef _WIN32
# define THIS_HASHVAL 6385726429Ui64
# else
# define THIS_HASHVAL 6385726429ULL
# endif
#else
#define THIS_HASHVAL 275574653UL
#define THIS_HASHVAL 2090759133UL
#endif
/* method flags (types) */
@@ -217,26 +208,23 @@ typedef struct _zend_try_catch_element {
/* function has arguments with type hinting */
#define ZEND_ACC_HAS_TYPE_HINTS 0x10000000
char *zend_visibility_string(zend_uint fn_flags);
char *zend_visibility_string(uint32_t fn_flags);
typedef struct _zend_property_info {
zend_uint flags;
const char *name;
int name_length;
ulong h;
uint32_t flags;
zend_string *name;
zend_ulong h;
int offset;
const char *doc_comment;
int doc_comment_len;
zend_string *doc_comment;
zend_class_entry *ce;
} zend_property_info;
typedef struct _zend_arg_info {
const char *name;
zend_uint name_len;
const char *class_name;
zend_uint class_name_len;
const char *name; // TODO: convert into zend_string ???
uint32_t name_len;
const char *class_name; // TODO: convert into zend_string ???
uint32_t class_name_len;
zend_uchar type_hint;
zend_uchar pass_by_reference;
zend_bool allow_null;
@@ -249,45 +237,36 @@ typedef struct _zend_arg_info {
*/
typedef struct _zend_internal_function_info {
const char *_name;
zend_uint _name_len;
uint32_t _name_len;
const char *_class_name;
zend_uint required_num_args;
uint32_t required_num_args;
zend_uchar _type_hint;
zend_bool return_reference;
zend_bool _allow_null;
zend_bool _is_variadic;
} zend_internal_function_info;
typedef struct _zend_compiled_variable {
const char *name;
int name_len;
ulong hash_value;
} zend_compiled_variable;
struct _zend_op_array {
/* Common elements */
zend_uchar type;
const char *function_name;
zend_string *function_name;
zend_class_entry *scope;
zend_uint fn_flags;
union _zend_function *prototype;
zend_uint num_args;
zend_uint required_num_args;
uint32_t fn_flags;
zend_function *prototype;
uint32_t num_args;
uint32_t required_num_args;
zend_arg_info *arg_info;
/* END of common elements */
zend_uint *refcount;
uint32_t *refcount;
zend_op *opcodes;
zend_uint last;
uint32_t last;
zend_compiled_variable *vars;
zend_string **vars;
int last_var;
zend_uint T;
zend_uint nested_calls;
zend_uint used_stack;
uint32_t T;
zend_brk_cont_element *brk_cont_array;
int last_brk_cont;
@@ -299,16 +278,15 @@ struct _zend_op_array {
/* static variables support */
HashTable *static_variables;
zend_uint this_var;
uint32_t this_var;
const char *filename;
zend_uint line_start;
zend_uint line_end;
const char *doc_comment;
zend_uint doc_comment_len;
zend_uint early_binding; /* the linked list of delayed declarations */
zend_string *filename;
uint32_t line_start;
uint32_t line_end;
zend_string *doc_comment;
uint32_t early_binding; /* the linked list of delayed declarations */
zend_literal *literals;
zval *literals;
int last_literal;
void **run_time_cache;
@@ -324,12 +302,12 @@ struct _zend_op_array {
typedef struct _zend_internal_function {
/* Common elements */
zend_uchar type;
const char * function_name;
zend_string* function_name;
zend_class_entry *scope;
zend_uint fn_flags;
union _zend_function *prototype;
zend_uint num_args;
zend_uint required_num_args;
uint32_t fn_flags;
zend_function *prototype;
uint32_t num_args;
uint32_t required_num_args;
zend_arg_info *arg_info;
/* END of common elements */
@@ -337,35 +315,30 @@ typedef struct _zend_internal_function {
struct _zend_module_entry *module;
} zend_internal_function;
#define ZEND_FN_SCOPE_NAME(function) ((function) && (function)->common.scope ? (function)->common.scope->name : "")
#define ZEND_FN_SCOPE_NAME(function) ((function) && (function)->common.scope ? (function)->common.scope->name->val : "")
typedef union _zend_function {
union _zend_function {
zend_uchar type; /* MUST be the first element of this struct! */
struct {
zend_uchar type; /* never used */
const char *function_name;
zend_string *function_name;
zend_class_entry *scope;
zend_uint fn_flags;
uint32_t fn_flags;
union _zend_function *prototype;
zend_uint num_args;
zend_uint required_num_args;
uint32_t num_args;
uint32_t required_num_args;
zend_arg_info *arg_info;
} common;
zend_op_array op_array;
zend_internal_function internal_function;
} zend_function;
typedef struct _zend_function_state {
zend_function *function;
void **arguments;
} zend_function_state;
};
typedef struct _zend_function_call_entry {
zend_function *fbc;
zend_uint arg_num;
uint32_t op_number;
uint32_t arg_num;
zend_bool uses_argument_unpacking;
} zend_function_call_entry;
@@ -382,43 +355,51 @@ typedef struct _list_llist_element {
znode value;
} list_llist_element;
union _temp_variable;
typedef struct _call_slot {
zend_function *fbc;
zval *object;
zend_class_entry *called_scope;
zend_uint num_additional_args;
zend_bool is_ctor_call;
zend_bool is_ctor_result_used;
} call_slot;
typedef enum _vm_frame_kind {
VM_FRAME_NESTED_FUNCTION, /* stackless VM call to function */
VM_FRAME_NESTED_CODE, /* stackless VM call to include/require/eval */
VM_FRAME_TOP_FUNCTION, /* direct VM call to function from external C code */
VM_FRAME_TOP_CODE /* direct VM call to "main" code from external C code */
} vm_frame_kind;
struct _zend_execute_data {
struct _zend_op *opline;
zend_function_state function_state;
zend_op_array *op_array;
zval *object;
HashTable *symbol_table;
struct _zend_execute_data *prev_execute_data;
zval *old_error_reporting;
zend_bool nested;
zval **original_return_value;
zend_class_entry *current_scope;
zend_class_entry *current_called_scope;
zval *current_this;
struct _zend_op *fast_ret; /* used by FAST_CALL/FAST_RET (finally keyword) */
zval *delayed_exception;
call_slot *call_slots;
call_slot *call;
struct _zend_op *opline; /* executed opline */
zend_execute_data *call; /* current call */
void **run_time_cache;
zend_function *func; /* executed op_array */
uint32_t num_args;
zend_uchar flags;
zend_uchar frame_kind;
zend_class_entry *called_scope;
zend_object *object;
zend_execute_data *prev_nested_call;
zend_execute_data *prev_execute_data;
zval *return_value;
zend_class_entry *scope; /* function scope (self) */
zend_array *symbol_table;
struct _zend_op *fast_ret; /* used by FAST_CALL/FAST_RET (finally keyword) */
zend_object *delayed_exception;
zval old_error_reporting;
};
#define ZEND_CALL_CTOR (1 << 0)
#define ZEND_CALL_CTOR_RESULT_UNUSED (1 << 1)
#define ZEND_CALL_FRAME_SLOT \
((ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval)) - 1) / ZEND_MM_ALIGNED_SIZE(sizeof(zval)))
#define ZEND_CALL_ARG(call, n) \
(((zval*)(call)) + ((n) + (ZEND_CALL_FRAME_SLOT - 1)))
#define EX(element) execute_data.element
#define EX_TMP_VAR(ex, n) ((temp_variable*)(((char*)(ex)) + ((int)(n))))
#define EX_TMP_VAR_NUM(ex, n) (EX_TMP_VAR(ex, 0) - (1 + (n)))
#define EX_VAR_2(ex, n) ((zval*)(((char*)(ex)) + ((int)(n))))
#define EX_VAR_NUM_2(ex, n) (((zval*)(ex)) + (ZEND_CALL_FRAME_SLOT + ((int)(n))))
#define EX_CV_NUM(ex, n) (((zval***)(((char*)(ex))+ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data))))+(n))
#define EX_VAR(n) EX_VAR_2(execute_data, n)
#define EX_VAR_NUM(n) EX_VAR_NUM_2(execute_data, n)
#define EX_VAR_TO_NUM(n) (EX_VAR_2(NULL, n) - EX_VAR_NUM_2(NULL, 0))
#define IS_CONST (1<<0)
#define IS_TMP_VAR (1<<1)
@@ -444,9 +425,9 @@ ZEND_API int lex_scan(zval *zendlval TSRMLS_DC);
void startup_scanner(TSRMLS_D);
void shutdown_scanner(TSRMLS_D);
ZEND_API char *zend_set_compiled_filename(const char *new_compiled_filename TSRMLS_DC);
ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename TSRMLS_DC);
ZEND_API char *zend_get_compiled_filename(TSRMLS_D);
ZEND_API zend_string *zend_set_compiled_filename(zend_string *new_compiled_filename TSRMLS_DC);
ZEND_API void zend_restore_compiled_filename(zend_string *original_compiled_filename TSRMLS_DC);
ZEND_API zend_string *zend_get_compiled_filename(TSRMLS_D);
ZEND_API int zend_get_compiled_lineno(TSRMLS_D);
ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D);
@@ -454,7 +435,7 @@ void zend_resolve_non_class_name(znode *element_name, zend_bool *check_namespace
void zend_resolve_function_name(znode *element_name, zend_bool *check_namespace TSRMLS_DC);
void zend_resolve_const_name(znode *element_name, zend_bool *check_namespace TSRMLS_DC);
void zend_resolve_class_name(znode *class_name TSRMLS_DC);
ZEND_API const char* zend_get_compiled_variable_name(const zend_op_array *op_array, zend_uint var, int* name_len);
ZEND_API zend_string *zend_get_compiled_variable_name(const zend_op_array *op_array, uint32_t var);
#ifdef ZTS
const char *zend_get_zendtext(TSRMLS_D);
@@ -463,44 +444,44 @@ int zend_get_zendleng(TSRMLS_D);
/* parser-driven code generators */
void zend_do_binary_op(zend_uchar op, znode *result, const znode *op1, const znode *op2 TSRMLS_DC);
void zend_do_unary_op(zend_uchar op, znode *result, const znode *op1 TSRMLS_DC);
void zend_do_binary_assign_op(zend_uchar op, znode *result, const znode *op1, const znode *op2 TSRMLS_DC);
void zend_do_binary_op(zend_uchar op, znode *result, znode *op1, znode *op2 TSRMLS_DC);
void zend_do_unary_op(zend_uchar op, znode *result, znode *op1 TSRMLS_DC);
void zend_do_binary_assign_op(zend_uchar op, znode *result, znode *op1, znode *op2 TSRMLS_DC);
void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC);
void zend_do_assign_ref(znode *result, const znode *lvar, const znode *rvar TSRMLS_DC);
void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC);
void fetch_simple_variable(znode *result, znode *varname, int bp TSRMLS_DC);
void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar op TSRMLS_DC);
void zend_do_indirect_references(znode *result, const znode *num_references, znode *variable TSRMLS_DC);
void zend_do_fetch_static_variable(znode *varname, const znode *static_assignment, int fetch_type TSRMLS_DC);
void zend_do_fetch_static_variable(znode *varname, znode *static_assignment, int fetch_type TSRMLS_DC);
void zend_do_fetch_global_variable(znode *varname, const znode *static_assignment, int fetch_type TSRMLS_DC);
void fetch_array_begin(znode *result, znode *varname, znode *first_dim TSRMLS_DC);
void fetch_array_dim(znode *result, const znode *parent, const znode *dim TSRMLS_DC);
void fetch_string_offset(znode *result, const znode *parent, const znode *offset TSRMLS_DC);
void fetch_array_dim(znode *result, znode *parent, znode *dim TSRMLS_DC);
void fetch_string_offset(znode *result, znode *parent, znode *offset TSRMLS_DC);
void zend_do_fetch_static_member(znode *result, znode *class_znode TSRMLS_DC);
void zend_do_print(znode *result, const znode *arg TSRMLS_DC);
void zend_do_echo(const znode *arg TSRMLS_DC);
void zend_do_print(znode *result, znode *arg TSRMLS_DC);
void zend_do_echo(znode *arg TSRMLS_DC);
typedef int (*unary_op_type)(zval *, zval * TSRMLS_DC);
typedef int (*binary_op_type)(zval *, zval *, zval * TSRMLS_DC);
ZEND_API unary_op_type get_unary_op(int opcode);
ZEND_API binary_op_type get_binary_op(int opcode);
void zend_do_while_cond(const znode *expr, znode *close_bracket_token TSRMLS_DC);
void zend_do_while_cond(znode *expr, znode *close_bracket_token TSRMLS_DC);
void zend_do_while_end(const znode *while_token, const znode *close_bracket_token TSRMLS_DC);
void zend_do_do_while_begin(TSRMLS_D);
void zend_do_do_while_end(const znode *do_token, const znode *expr_open_bracket, const znode *expr TSRMLS_DC);
void zend_do_do_while_end(const znode *do_token, const znode *expr_open_bracket, znode *expr TSRMLS_DC);
void zend_do_if_cond(const znode *cond, znode *closing_bracket_token TSRMLS_DC);
void zend_do_if_cond(znode *cond, znode *closing_bracket_token TSRMLS_DC);
void zend_do_if_after_statement(const znode *closing_bracket_token, unsigned char initialize TSRMLS_DC);
void zend_do_if_end(TSRMLS_D);
void zend_do_for_cond(const znode *expr, znode *second_semicolon_token TSRMLS_DC);
void zend_do_for_cond(znode *expr, znode *second_semicolon_token TSRMLS_DC);
void zend_do_for_before_statement(const znode *cond_start, const znode *second_semicolon_token TSRMLS_DC);
void zend_do_for_end(const znode *second_semicolon_token TSRMLS_DC);
void zend_do_pre_incdec(znode *result, const znode *op1, zend_uchar op TSRMLS_DC);
void zend_do_post_incdec(znode *result, const znode *op1, zend_uchar op TSRMLS_DC);
void zend_do_pre_incdec(znode *result, znode *op1, zend_uchar op TSRMLS_DC);
void zend_do_post_incdec(znode *result, znode *op1, zend_uchar op TSRMLS_DC);
void zend_do_begin_variable_parse(TSRMLS_D);
void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS_DC);
@@ -509,23 +490,23 @@ void zend_check_writable_variable(const znode *variable);
void zend_do_free(znode *op1 TSRMLS_DC);
void zend_do_add_string(znode *result, const znode *op1, znode *op2 TSRMLS_DC);
void zend_do_add_variable(znode *result, const znode *op1, const znode *op2 TSRMLS_DC);
void zend_do_add_string(znode *result, znode *op1, znode *op2 TSRMLS_DC);
void zend_do_add_variable(znode *result, znode *op1, znode *op2 TSRMLS_DC);
int zend_do_verify_access_types(const znode *current_access_type, const znode *new_modifier);
void zend_do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference, znode *fn_flags_znode TSRMLS_DC);
void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC);
void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initialization, znode *class_type, zend_bool pass_by_reference, zend_bool is_variadic TSRMLS_DC);
void zend_do_receive_param(zend_uchar op, znode *varname, znode *initialization, znode *class_type, zend_bool pass_by_reference, zend_bool is_variadic TSRMLS_DC);
int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace TSRMLS_DC);
void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC);
void zend_do_clone(znode *result, const znode *expr TSRMLS_DC);
void zend_do_clone(znode *result, znode *expr TSRMLS_DC);
void zend_do_begin_dynamic_function_call(znode *function_name, int prefix_len TSRMLS_DC);
void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC);
void zend_do_build_full_name(znode *result, znode *prefix, znode *name, int is_class_member TSRMLS_DC);
int zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC);
void zend_do_end_function_call(znode *function_name, znode *result, int is_method, int is_dynamic_fcall TSRMLS_DC);
void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC);
void zend_do_yield(znode *result, znode *value, const znode *key, zend_bool is_variable TSRMLS_DC);
void zend_do_yield(znode *result, znode *value, znode *key, zend_bool is_variable TSRMLS_DC);
void zend_do_handle_exception(TSRMLS_D);
void zend_do_begin_lambda_function_declaration(znode *result, znode *function_token, int return_reference, int is_static TSRMLS_DC);
@@ -537,9 +518,9 @@ void zend_do_bind_catch(znode *try_token, znode *catch_token TSRMLS_DC);
void zend_do_end_catch(znode *catch_token TSRMLS_DC);
void zend_do_finally(znode *finally_token TSRMLS_DC);
void zend_do_end_finally(znode *try_token, znode* catch_token, znode *finally_token TSRMLS_DC);
void zend_do_throw(const znode *expr TSRMLS_DC);
void zend_do_throw(znode *expr TSRMLS_DC);
ZEND_API int do_bind_function(const zend_op_array *op_array, zend_op *opline, HashTable *function_table, zend_bool compile_time);
ZEND_API int do_bind_function(const zend_op_array *op_array, zend_op *opline, HashTable *function_table, zend_bool compile_time TSRMLS_DC);
ZEND_API zend_class_entry *do_bind_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC);
ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array, const zend_op *opline, HashTable *class_table, zend_class_entry *parent_ce, zend_bool compile_time TSRMLS_DC);
ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC);
@@ -564,24 +545,24 @@ void zend_do_unpack_params(znode *params TSRMLS_DC);
void zend_do_boolean_or_begin(znode *expr1, znode *op_token TSRMLS_DC);
void zend_do_boolean_or_end(znode *result, const znode *expr1, const znode *expr2, znode *op_token TSRMLS_DC);
void zend_do_boolean_or_end(znode *result, znode *expr1, znode *expr2, const znode *op_token TSRMLS_DC);
void zend_do_boolean_and_begin(znode *expr1, znode *op_token TSRMLS_DC);
void zend_do_boolean_and_end(znode *result, const znode *expr1, const znode *expr2, const znode *op_token TSRMLS_DC);
void zend_do_boolean_and_end(znode *result, znode *expr1, znode *expr2, const znode *op_token TSRMLS_DC);
void zend_do_brk_cont(zend_uchar op, const znode *expr TSRMLS_DC);
void zend_do_brk_cont(zend_uchar op, znode *expr TSRMLS_DC);
void zend_do_switch_cond(const znode *cond TSRMLS_DC);
void zend_do_switch_end(const znode *case_list TSRMLS_DC);
void zend_do_case_before_statement(const znode *case_list, znode *case_token, const znode *case_expr TSRMLS_DC);
void zend_do_case_before_statement(const znode *case_list, znode *case_token, znode *case_expr TSRMLS_DC);
void zend_do_case_after_statement(znode *result, const znode *case_token TSRMLS_DC);
void zend_do_default_before_statement(const znode *case_list, znode *default_token TSRMLS_DC);
void zend_do_begin_class_declaration(const znode *class_token, znode *class_name, const znode *parent_class_name TSRMLS_DC);
void zend_do_end_class_declaration(const znode *class_token, const znode *parent_token TSRMLS_DC);
void zend_do_declare_property(const znode *var_name, const znode *value, zend_uint access_type TSRMLS_DC);
void zend_do_declare_class_constant(znode *var_name, const znode *value TSRMLS_DC);
void zend_do_declare_property(znode *var_name, znode *value, uint32_t access_type TSRMLS_DC);
void zend_do_declare_class_constant(znode *var_name, znode *value TSRMLS_DC);
void zend_do_fetch_property(znode *result, znode *object, const znode *property TSRMLS_DC);
void zend_do_fetch_property(znode *result, znode *object, znode *property TSRMLS_DC);
void zend_do_halt_compiler_register(TSRMLS_D);
@@ -594,11 +575,11 @@ void zend_do_end_new_object(znode *result, const znode *new_token TSRMLS_DC);
void zend_do_fetch_constant(znode *result, znode *constant_container, znode *constant_name, int mode, zend_bool check_namespace TSRMLS_DC);
void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC);
void zend_do_shell_exec(znode *result, znode *cmd TSRMLS_DC);
void zend_do_init_array(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC);
void zend_do_add_array_element(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC);
void zend_do_add_static_array_element(zval *result, zval *offset, const zval *expr);
void zend_do_init_array(znode *result, znode *expr, znode *offset, zend_bool is_ref TSRMLS_DC);
void zend_do_add_array_element(znode *result, znode *expr, znode *offset, zend_bool is_ref TSRMLS_DC);
void zend_do_end_array(znode *result, const znode *array_node TSRMLS_DC);
void zend_do_list_init(TSRMLS_D);
void zend_do_list_end(znode *result, znode *expr TSRMLS_DC);
void zend_do_add_list_element(const znode *element TSRMLS_DC);
@@ -610,13 +591,13 @@ void zend_init_list(void *result, void *item TSRMLS_DC);
void zend_add_to_list(void *result, void *item TSRMLS_DC);
void zend_do_cast(znode *result, const znode *expr, int type TSRMLS_DC);
void zend_do_include_or_eval(int type, znode *result, const znode *op1 TSRMLS_DC);
void zend_do_cast(znode *result, znode *expr, int type TSRMLS_DC);
void zend_do_include_or_eval(int type, znode *result, znode *op1 TSRMLS_DC);
void zend_do_unset(const znode *variable TSRMLS_DC);
void zend_do_unset(znode *variable TSRMLS_DC);
void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC);
void zend_do_instanceof(znode *result, const znode *expr, const znode *class_znode, int type TSRMLS_DC);
void zend_do_instanceof(znode *result, znode *expr, znode *class_znode, int type TSRMLS_DC);
void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, znode *array, znode *as_token, int variable TSRMLS_DC);
void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token, const znode *as_token, znode *value, znode *key TSRMLS_DC);
@@ -626,17 +607,17 @@ void zend_do_declare_begin(TSRMLS_D);
void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC);
void zend_do_declare_end(const znode *declare_token TSRMLS_DC);
void zend_do_exit(znode *result, const znode *message TSRMLS_DC);
void zend_do_exit(znode *result, znode *message TSRMLS_DC);
void zend_do_begin_silence(znode *strudel_token TSRMLS_DC);
void zend_do_end_silence(const znode *strudel_token TSRMLS_DC);
void zend_do_end_silence(znode *strudel_token TSRMLS_DC);
void zend_do_jmp_set(const znode *value, znode *jmp_token, znode *colon_token TSRMLS_DC);
void zend_do_jmp_set_else(znode *result, const znode *false_value, const znode *jmp_token, const znode *colon_token TSRMLS_DC);
void zend_do_jmp_set(znode *value, znode *jmp_token, znode *colon_token TSRMLS_DC);
void zend_do_jmp_set_else(znode *result, znode *false_value, const znode *jmp_token, znode *colon_token TSRMLS_DC);
void zend_do_begin_qm_op(const znode *cond, znode *qm_token TSRMLS_DC);
void zend_do_qm_true(const znode *true_value, znode *qm_token, znode *colon_token TSRMLS_DC);
void zend_do_qm_false(znode *result, const znode *false_value, const znode *qm_token, const znode *colon_token TSRMLS_DC);
void zend_do_begin_qm_op(znode *cond, znode *qm_token TSRMLS_DC);
void zend_do_qm_true(znode *true_value, znode *qm_token, znode *colon_token TSRMLS_DC);
void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, const znode *colon_token TSRMLS_DC);
void zend_do_extended_info(TSRMLS_D);
void zend_do_extended_fcall_begin(TSRMLS_D);
@@ -648,7 +629,7 @@ void zend_do_abstract_method(const znode *function_name, znode *modifiers, const
void zend_do_declare_constant(znode *name, znode *value TSRMLS_DC);
void zend_do_build_namespace_name(znode *result, znode *prefix, znode *name TSRMLS_DC);
void zend_do_begin_namespace(const znode *name, zend_bool with_brackets TSRMLS_DC);
void zend_do_begin_namespace(znode *name, zend_bool with_brackets TSRMLS_DC);
void zend_do_end_namespace(TSRMLS_D);
void zend_verify_namespace(TSRMLS_D);
void zend_do_use(znode *name, znode *new_name, int is_global TSRMLS_DC);
@@ -661,7 +642,7 @@ void zend_do_constant_expression(znode *result, zend_ast *ast TSRMLS_DC);
void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static TSRMLS_DC);
void zend_do_label(znode *label TSRMLS_DC);
void zend_do_goto(const znode *label TSRMLS_DC);
void zend_do_goto(znode *label TSRMLS_DC);
void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2 TSRMLS_DC);
void zend_release_labels(int temporary TSRMLS_DC);
@@ -675,30 +656,28 @@ ZEND_API void function_add_ref(zend_function *function);
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC);
ZEND_API zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC);
ZEND_API zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC);
ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_count, ...);
ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval *retval, int file_count, ...);
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC);
ZEND_API void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_size TSRMLS_DC);
ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC);
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC);
ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC);
ZEND_API int zend_cleanup_user_class_data(zend_class_entry **pce TSRMLS_DC);
ZEND_API void zend_cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC);
ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC);
ZEND_API void zend_cleanup_internal_classes(TSRMLS_D);
ZEND_API int zend_cleanup_function_data(zend_function *function TSRMLS_DC);
ZEND_API int zend_cleanup_function_data_full(zend_function *function TSRMLS_DC);
ZEND_API void zend_cleanup_op_array_data(zend_op_array *op_array);
ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC);
ZEND_API void zend_function_dtor(zend_function *function);
ZEND_API void destroy_zend_class(zend_class_entry **pce);
void zend_class_add_ref(zend_class_entry **ce);
ZEND_API void zend_function_dtor(zval *zv);
ZEND_API void destroy_zend_class(zval *zv);
void zend_class_add_ref(zval *zv);
ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, const char *src1, int src1_length, const char *src2, int src2_length, int internal);
ZEND_API zend_string *zend_mangle_property_name(const char *src1, int src1_length, const char *src2, int src2_length, int internal);
#define zend_unmangle_property_name(mangled_property, mangled_property_len, class_name, prop_name) \
zend_unmangle_property_name_ex(mangled_property, mangled_property_len, class_name, prop_name, NULL)
ZEND_API int zend_unmangle_property_name_ex(const char *mangled_property, int mangled_property_len, const char **class_name, const char **prop_name, int *prop_len);
#define ZEND_FUNCTION_DTOR (void (*)(void *)) zend_function_dtor
#define ZEND_CLASS_DTOR (void (*)(void *)) destroy_zend_class
#define ZEND_FUNCTION_DTOR zend_function_dtor
#define ZEND_CLASS_DTOR destroy_zend_class
zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC);
void init_op(zend_op *op TSRMLS_DC);
@@ -715,24 +694,22 @@ ZEND_API char *zend_make_compiled_string_description(const char *name TSRMLS_DC)
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers TSRMLS_DC);
int zend_get_class_fetch_type(const char *class_name, uint class_name_len);
typedef zend_bool (*zend_auto_global_callback)(const char *name, uint name_len TSRMLS_DC);
typedef zend_bool (*zend_auto_global_callback)(zend_string *name TSRMLS_DC);
typedef struct _zend_auto_global {
const char *name;
uint name_len;
zend_string *name;
zend_auto_global_callback auto_global_callback;
zend_bool jit;
zend_bool armed;
} zend_auto_global;
ZEND_API int zend_register_auto_global(const char *name, uint name_len, zend_bool jit, zend_auto_global_callback auto_global_callback TSRMLS_DC);
ZEND_API int zend_register_auto_global(zend_string *name, zend_bool jit, zend_auto_global_callback auto_global_callback TSRMLS_DC);
ZEND_API void zend_activate_auto_globals(TSRMLS_D);
ZEND_API zend_bool zend_is_auto_global(const char *name, uint name_len TSRMLS_DC);
ZEND_API zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hashval TSRMLS_DC);
ZEND_API zend_bool zend_is_auto_global(zend_string *name TSRMLS_DC);
ZEND_API size_t zend_dirname(char *path, size_t len);
int zendlex(znode *zendlval TSRMLS_DC);
int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC);
int zend_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC);
/* BEGIN: OPCODES */
@@ -746,12 +723,10 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC);
#define ZEND_FETCH_CLASS_DEFAULT 0
#define ZEND_FETCH_CLASS_SELF 1
#define ZEND_FETCH_CLASS_PARENT 2
#define ZEND_FETCH_CLASS_MAIN 3 /* unused */
#define ZEND_FETCH_CLASS_GLOBAL 4 /* unused */
#define ZEND_FETCH_CLASS_AUTO 5
#define ZEND_FETCH_CLASS_INTERFACE 6
#define ZEND_FETCH_CLASS_STATIC 7
#define ZEND_FETCH_CLASS_TRAIT 14
#define ZEND_FETCH_CLASS_STATIC 3
#define ZEND_FETCH_CLASS_AUTO 4
#define ZEND_FETCH_CLASS_INTERFACE 5
#define ZEND_FETCH_CLASS_TRAIT 6
#define ZEND_FETCH_CLASS_MASK 0x0f
#define ZEND_FETCH_CLASS_NO_AUTOLOAD 0x80
#define ZEND_FETCH_CLASS_SILENT 0x0100
@@ -766,7 +741,6 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC);
#define ZEND_PARSED_NEW (1<<6)
#define ZEND_PARSED_LIST_EXPR (1<<7)
/* unset types */
#define ZEND_UNSET_REG 0
@@ -786,6 +760,9 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC);
#define ZEND_EVAL_CODE 4
#define ZEND_OVERLOADED_FUNCTION_TEMPORARY 5
/* A quick check (type == ZEND_USER_FUNCTION || type == ZEND_EVAL_CODE) */
#define ZEND_USER_CODE(type) ((type & 1) == 0)
#define ZEND_INTERNAL_CLASS 1
#define ZEND_USER_CLASS 2
@@ -838,11 +815,11 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC);
#define ZEND_SEND_PREFER_REF 2
#define CHECK_ARG_SEND_TYPE(zf, arg_num, m) \
((zf)->common.arg_info && \
(arg_num <= (zf)->common.num_args \
(EXPECTED((zf)->common.arg_info != NULL) && \
(EXPECTED(arg_num <= (zf)->common.num_args) \
? ((zf)->common.arg_info[arg_num-1].pass_by_reference & (m)) \
: ((zf)->common.fn_flags & ZEND_ACC_VARIADIC) \
? ((zf)->common.arg_info[(zf)->common.num_args-1].pass_by_reference & (m)) : 0))
: (UNEXPECTED((zf)->common.fn_flags & ZEND_ACC_VARIADIC) != 0) && \
((zf)->common.arg_info[(zf)->common.num_args-1].pass_by_reference & (m))))
#define ARG_MUST_BE_SENT_BY_REF(zf, arg_num) \
CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF)
@@ -867,6 +844,10 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC);
#define ZEND_FAST_CALL_FROM_CATCH 1
#define ZEND_FAST_CALL_FROM_FINALLY 2
#define ZEND_ARRAY_ELEMENT_REF (1<<0)
#define ZEND_ARRAY_NOT_PACKED (1<<1)
#define ZEND_ARRAY_SIZE_SHIFT 2
END_EXTERN_C()
#define ZEND_CLONE_FUNC_NAME "__clone"
@@ -892,7 +873,7 @@ END_EXTERN_C()
/* call op_array handler of extendions */
#define ZEND_COMPILE_HANDLE_OP_ARRAY (1<<1)
/* generate ZEND_DO_FCALL_BY_NAME for internal functions instead of ZEND_DO_FCALL */
/* generate ZEND_INIT_FCALL_BY_NAME for internal functions instead of ZEND_INIT_FCALL */
#define ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS (1<<2)
/* don't perform early binding for classes inherited form internal ones;
@@ -906,6 +887,9 @@ END_EXTERN_C()
/* disable constant substitution at compile-time */
#define ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION (1<<5)
/* disable usage of builtin instruction for strlen() */
#define ZEND_COMPILE_NO_BUILTIN_STRLEN (1<<6)
/* The default value for CG(compiler_options) */
#define ZEND_COMPILE_DEFAULT ZEND_COMPILE_HANDLE_OP_ARRAY
+187 -168
View File
@@ -27,47 +27,67 @@
#include "zend_globals.h"
#include "zend_API.h"
void free_zend_constant(zend_constant *c)
void free_zend_constant(zval *zv)
{
zend_constant *c = Z_PTR_P(zv);
if (!(c->flags & CONST_PERSISTENT)) {
zval_dtor(&c->value);
} else {
zval_internal_dtor(&c->value);
}
str_free(c->name);
if (c->name) {
zend_string_release(c->name);
}
pefree(c, c->flags & CONST_PERSISTENT);
}
void copy_zend_constant(zend_constant *c)
static void copy_zend_constant(zval *zv)
{
c->name = str_strndup(c->name, c->name_len - 1);
zend_constant *c = Z_PTR_P(zv);
Z_PTR_P(zv) = pemalloc(sizeof(zend_constant), c->flags & CONST_PERSISTENT);
memcpy(Z_PTR_P(zv), c, sizeof(zend_constant));
c = Z_PTR_P(zv);
c->name = zend_string_copy(c->name);
if (!(c->flags & CONST_PERSISTENT)) {
zval_copy_ctor(&c->value);
} else {
if (Z_TYPE(c->value) == IS_STRING) {
Z_STR(c->value) = zend_string_dup(Z_STR(c->value), 1);
}
}
}
void zend_copy_constants(HashTable *target, HashTable *source)
{
zend_constant tmp_constant;
zend_hash_copy(target, source, (copy_ctor_func_t) copy_zend_constant, &tmp_constant, sizeof(zend_constant));
zend_hash_copy(target, source, copy_zend_constant);
}
static int clean_non_persistent_constant(const zend_constant *c TSRMLS_DC)
static int clean_non_persistent_constant(zval *zv TSRMLS_DC)
{
zend_constant *c = Z_PTR_P(zv);
return (c->flags & CONST_PERSISTENT) ? ZEND_HASH_APPLY_STOP : ZEND_HASH_APPLY_REMOVE;
}
static int clean_non_persistent_constant_full(const zend_constant *c TSRMLS_DC)
static int clean_non_persistent_constant_full(zval *zv TSRMLS_DC)
{
zend_constant *c = Z_PTR_P(zv);
return (c->flags & CONST_PERSISTENT) ? 0 : 1;
}
static int clean_module_constant(const zend_constant *c, int *module_number TSRMLS_DC)
static int clean_module_constant(zval *el, void *arg TSRMLS_DC)
{
if (c->module_number == *module_number) {
zend_constant *c = (zend_constant *)Z_PTR_P(el);
int module_number = *(int *)arg;
if (c->module_number == module_number) {
return 1;
} else {
return 0;
@@ -77,7 +97,7 @@ static int clean_module_constant(const zend_constant *c, int *module_number TSRM
void clean_module_constants(int module_number TSRMLS_DC)
{
zend_hash_apply_with_argument(EG(zend_constants), (apply_func_arg_t) clean_module_constant, (void *) &module_number TSRMLS_CC);
zend_hash_apply_with_argument(EG(zend_constants), clean_module_constant, (void *) &module_number TSRMLS_CC);
}
@@ -85,9 +105,7 @@ int zend_startup_constants(TSRMLS_D)
{
EG(zend_constants) = (HashTable *) malloc(sizeof(HashTable));
if (zend_hash_init(EG(zend_constants), 20, NULL, ZEND_CONSTANT_DTOR, 1)==FAILURE) {
return FAILURE;
}
zend_hash_init(EG(zend_constants), 128, NULL, ZEND_CONSTANT_DTOR, 1);
return SUCCESS;
}
@@ -137,9 +155,9 @@ int zend_shutdown_constants(TSRMLS_D)
void clean_non_persistent_constants(TSRMLS_D)
{
if (EG(full_tables_cleanup)) {
zend_hash_apply(EG(zend_constants), (apply_func_t) clean_non_persistent_constant_full TSRMLS_CC);
zend_hash_apply(EG(zend_constants), clean_non_persistent_constant_full TSRMLS_CC);
} else {
zend_hash_reverse_apply(EG(zend_constants), (apply_func_t) clean_non_persistent_constant TSRMLS_CC);
zend_hash_reverse_apply(EG(zend_constants), clean_non_persistent_constant TSRMLS_CC);
}
}
@@ -149,8 +167,7 @@ ZEND_API void zend_register_null_constant(const char *name, uint name_len, int f
ZVAL_NULL(&c.value);
c.flags = flags;
c.name = zend_strndup(name, name_len-1);
c.name_len = name_len;
c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
zend_register_constant(&c TSRMLS_CC);
}
@@ -161,20 +178,18 @@ ZEND_API void zend_register_bool_constant(const char *name, uint name_len, zend_
ZVAL_BOOL(&c.value, bval);
c.flags = flags;
c.name = zend_strndup(name, name_len-1);
c.name_len = name_len;
c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
zend_register_constant(&c TSRMLS_CC);
}
ZEND_API void zend_register_long_constant(const char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC)
ZEND_API void zend_register_long_constant(const char *name, uint name_len, zend_long lval, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
ZVAL_LONG(&c.value, lval);
c.flags = flags;
c.name = zend_strndup(name, name_len-1);
c.name_len = name_len;
c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
zend_register_constant(&c TSRMLS_CC);
}
@@ -186,8 +201,7 @@ ZEND_API void zend_register_double_constant(const char *name, uint name_len, dou
ZVAL_DOUBLE(&c.value, dval);
c.flags = flags;
c.name = zend_strndup(name, name_len-1);
c.name_len = name_len;
c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
zend_register_constant(&c TSRMLS_CC);
}
@@ -197,10 +211,9 @@ ZEND_API void zend_register_stringl_constant(const char *name, uint name_len, ch
{
zend_constant c;
ZVAL_STRINGL(&c.value, strval, strlen, 0);
ZVAL_NEW_STR(&c.value, zend_string_init(strval, strlen, flags & CONST_PERSISTENT));
c.flags = flags;
c.name = zend_strndup(name, name_len-1);
c.name_len = name_len;
c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT);
c.module_number = module_number;
zend_register_constant(&c TSRMLS_CC);
}
@@ -211,121 +224,135 @@ ZEND_API void zend_register_string_constant(const char *name, uint name_len, cha
zend_register_stringl_constant(name, name_len, strval, strlen(strval), flags, module_number TSRMLS_CC);
}
static int zend_get_special_constant(const char *name, uint name_len, zend_constant **c TSRMLS_DC)
static zend_constant *zend_get_special_constant(const char *name, uint name_len TSRMLS_DC)
{
int ret;
zend_constant *c;
static char haltoff[] = "__COMPILER_HALT_OFFSET__";
if (!EG(in_execution)) {
return 0;
if (!EG(current_execute_data)) {
return NULL;
} else if (name_len == sizeof("__CLASS__")-1 &&
!memcmp(name, "__CLASS__", sizeof("__CLASS__")-1)) {
zend_constant tmp;
/* Returned constants may be cached, so they have to be stored */
if (EG(scope) && EG(scope)->name) {
int const_name_len;
char *const_name;
ALLOCA_FLAG(use_heap)
zend_string *const_name;
const_name_len = sizeof("\0__CLASS__") + EG(scope)->name_length;
const_name = do_alloca(const_name_len, use_heap);
memcpy(const_name, "\0__CLASS__", sizeof("\0__CLASS__")-1);
zend_str_tolower_copy(const_name + sizeof("\0__CLASS__")-1, EG(scope)->name, EG(scope)->name_length);
if (zend_hash_find(EG(zend_constants), const_name, const_name_len, (void**)c) == FAILURE) {
zend_hash_add(EG(zend_constants), const_name, const_name_len, (void*)&tmp, sizeof(zend_constant), (void**)c);
memset(*c, 0, sizeof(zend_constant));
Z_STRVAL((**c).value) = estrndup(EG(scope)->name, EG(scope)->name_length);
Z_STRLEN((**c).value) = EG(scope)->name_length;
Z_TYPE((**c).value) = IS_STRING;
const_name_len = sizeof("\0__CLASS__") + EG(scope)->name->len;
const_name = zend_string_alloc(const_name_len, 0);
memcpy(const_name->val, "\0__CLASS__", sizeof("\0__CLASS__")-1);
zend_str_tolower_copy(const_name->val + sizeof("\0__CLASS__")-1, EG(scope)->name->val, EG(scope)->name->len);
if ((c = zend_hash_find_ptr(EG(zend_constants), const_name)) == NULL) {
c = emalloc(sizeof(zend_constant));
memset(c, 0, sizeof(zend_constant));
ZVAL_STR(&c->value, zend_string_copy(EG(scope)->name));
zend_hash_add_ptr(EG(zend_constants), const_name, c);
}
free_alloca(const_name, use_heap);
zend_string_release(const_name);
} else {
if (zend_hash_find(EG(zend_constants), "\0__CLASS__", sizeof("\0__CLASS__"), (void**)c) == FAILURE) {
zend_hash_add(EG(zend_constants), "\0__CLASS__", sizeof("\0__CLASS__"), (void*)&tmp, sizeof(zend_constant), (void**)c);
memset(*c, 0, sizeof(zend_constant));
Z_STRVAL((**c).value) = estrndup("", 0);
Z_STRLEN((**c).value) = 0;
Z_TYPE((**c).value) = IS_STRING;
zend_string *const_name = zend_string_init("\0__CLASS__", sizeof("\0__CLASS__")-1, 0);
if ((c = zend_hash_find_ptr(EG(zend_constants), const_name)) == NULL) {
c = emalloc(sizeof(zend_constant));
memset(c, 0, sizeof(zend_constant));
ZVAL_EMPTY_STRING(&c->value);
zend_hash_add_ptr(EG(zend_constants), const_name, c);
}
zend_string_release(const_name);
}
return 1;
return c;
} else if (name_len == sizeof("__COMPILER_HALT_OFFSET__")-1 &&
!memcmp(name, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) {
const char *cfilename;
char *haltname;
int len, clen;
zend_string *haltname;
int clen;
cfilename = zend_get_executed_filename(TSRMLS_C);
clen = strlen(cfilename);
/* check for __COMPILER_HALT_OFFSET__ */
zend_mangle_property_name(&haltname, &len, haltoff,
haltname = zend_mangle_property_name(haltoff,
sizeof("__COMPILER_HALT_OFFSET__") - 1, cfilename, clen, 0);
ret = zend_hash_find(EG(zend_constants), haltname, len+1, (void **) c);
efree(haltname);
return (ret == SUCCESS);
c = zend_hash_find_ptr(EG(zend_constants), haltname);
zend_string_free(haltname);
return c;
} else {
return 0;
return NULL;
}
}
ZEND_API int zend_get_constant(const char *name, uint name_len, zval *result TSRMLS_DC)
ZEND_API zval *zend_get_constant_str(const char *name, uint name_len TSRMLS_DC)
{
zend_constant *c;
int retval = 1;
char *lookup_name;
ALLOCA_FLAG(use_heap)
if (zend_hash_find(EG(zend_constants), name, name_len+1, (void **) &c) == FAILURE) {
lookup_name = zend_str_tolower_dup(name, name_len);
if (zend_hash_find(EG(zend_constants), lookup_name, name_len+1, (void **) &c)==SUCCESS) {
if ((c = zend_hash_str_find_ptr(EG(zend_constants), name, name_len)) == NULL) {
char *lcname = do_alloca(name_len + 1, use_heap);
zend_str_tolower_copy(lcname, name, name_len);
if ((c = zend_hash_str_find_ptr(EG(zend_constants), lcname, name_len)) != NULL) {
if (c->flags & CONST_CS) {
retval=0;
c = NULL;
}
} else {
retval = zend_get_special_constant(name, name_len, &c TSRMLS_CC);
c = zend_get_special_constant(name, name_len TSRMLS_CC);
}
efree(lookup_name);
free_alloca(lcname, use_heap);
}
if (retval) {
*result = c->value;
zval_copy_ctor(result);
Z_SET_REFCOUNT_P(result, 1);
Z_UNSET_ISREF_P(result);
}
return retval;
return c ? &c->value : NULL;
}
ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result, zend_class_entry *scope, ulong flags TSRMLS_DC)
ZEND_API zval *zend_get_constant(zend_string *name TSRMLS_DC)
{
zend_constant *c;
ALLOCA_FLAG(use_heap)
if ((c = zend_hash_find_ptr(EG(zend_constants), name)) == NULL) {
char *lcname = do_alloca(name->len + 1, use_heap);
zend_str_tolower_copy(lcname, name->val, name->len);
if ((c = zend_hash_str_find_ptr(EG(zend_constants), lcname, name->len)) != NULL) {
if (c->flags & CONST_CS) {
c = NULL;
}
} else {
c = zend_get_special_constant(name->val, name->len TSRMLS_CC);
}
free_alloca(lcname, use_heap);
}
return c ? &c->value : NULL;
}
ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope, zend_ulong flags TSRMLS_DC)
{
zend_constant *c;
int retval = 1;
const char *colon;
zend_class_entry *ce = NULL;
char *class_name;
zval **ret_constant;
zend_string *class_name;
const char *name = cname->val;
uint name_len = cname->len;
/* Skip leading \\ */
if (name[0] == '\\') {
name += 1;
name_len -= 1;
cname = NULL;
}
if ((colon = zend_memrchr(name, ':', name_len)) &&
colon > name && (*(colon - 1) == ':')) {
int class_name_len = colon - name - 1;
int const_name_len = name_len - class_name_len - 2;
const char *constant_name = colon + 1;
zend_string *constant_name = zend_string_init(colon + 1, const_name_len, 0);
char *lcname;
zval *ret_constant = NULL;
ALLOCA_FLAG(use_heap)
class_name = estrndup(name, class_name_len);
lcname = zend_str_tolower_dup(class_name, class_name_len);
class_name = zend_string_init(name, class_name_len, 0);
lcname = do_alloca(class_name_len + 1, use_heap);
zend_str_tolower_copy(lcname, name, class_name_len);
if (!scope) {
if (EG(in_execution)) {
if (EG(current_execute_data)) {
scope = EG(scope);
} else {
scope = CG(active_class_entry);
@@ -338,9 +365,7 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
ce = scope;
} else {
zend_error(E_ERROR, "Cannot access self:: when no class scope is active");
retval = 0;
}
efree(lcname);
} else if (class_name_len == sizeof("parent")-1 &&
!memcmp(lcname, "parent", sizeof("parent")-1)) {
if (!scope) {
@@ -350,31 +375,33 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
} else {
ce = scope->parent;
}
efree(lcname);
} else if (class_name_len == sizeof("static")-1 &&
!memcmp(lcname, "static", sizeof("static")-1)) {
if (EG(called_scope)) {
ce = EG(called_scope);
if (EG(current_execute_data) && EG(current_execute_data)->called_scope) {
ce = EG(current_execute_data)->called_scope;
} else {
zend_error(E_ERROR, "Cannot access static:: when no class scope is active");
}
efree(lcname);
} else {
efree(lcname);
ce = zend_fetch_class(class_name, class_name_len, flags TSRMLS_CC);
ce = zend_fetch_class(class_name, flags TSRMLS_CC);
}
if (retval && ce) {
if (zend_hash_find(&ce->constants_table, constant_name, const_name_len+1, (void **) &ret_constant) != SUCCESS) {
retval = 0;
free_alloca(lcname, use_heap);
if (ce) {
ret_constant = zend_hash_find(&ce->constants_table, constant_name);
if (ret_constant == NULL) {
if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
zend_error(E_ERROR, "Undefined class constant '%s::%s'", class_name, constant_name);
zend_error(E_ERROR, "Undefined class constant '%s::%s'", class_name->val, constant_name->val);
}
} else if (Z_ISREF_P(ret_constant)) {
ret_constant = Z_REFVAL_P(ret_constant);
}
} else if (!ce) {
retval = 0;
}
efree(class_name);
goto finish;
zend_string_release(class_name);
zend_string_free(constant_name);
if (ret_constant && Z_CONSTANT_P(ret_constant)) {
zval_update_constant_ex(ret_constant, 1, ce TSRMLS_CC);
}
return ret_constant;
}
/* non-class constant */
@@ -384,138 +411,130 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
int const_name_len = name_len - prefix_len - 1;
const char *constant_name = colon + 1;
char *lcname;
int found_const = 0;
int lcname_len;
ALLOCA_FLAG(use_heap)
lcname = zend_str_tolower_dup(name, prefix_len);
lcname_len = prefix_len + 1 + const_name_len;
lcname = do_alloca(lcname_len + 1, use_heap);
zend_str_tolower_copy(lcname, name, prefix_len);
/* Check for namespace constant */
/* Concatenate lowercase namespace name and constant name */
lcname = erealloc(lcname, prefix_len + 1 + const_name_len + 1);
lcname[prefix_len] = '\\';
memcpy(lcname + prefix_len + 1, constant_name, const_name_len + 1);
if (zend_hash_find(EG(zend_constants), lcname, prefix_len + 1 + const_name_len + 1, (void **) &c) == SUCCESS) {
found_const = 1;
} else {
if ((c = zend_hash_str_find_ptr(EG(zend_constants), lcname, lcname_len)) == NULL) {
/* try lowercase */
zend_str_tolower(lcname + prefix_len + 1, const_name_len);
if (zend_hash_find(EG(zend_constants), lcname, prefix_len + 1 + const_name_len + 1, (void **) &c) == SUCCESS) {
if ((c->flags & CONST_CS) == 0) {
found_const = 1;
if ((c = zend_hash_str_find_ptr(EG(zend_constants), lcname, lcname_len)) != NULL) {
if ((c->flags & CONST_CS) != 0) {
c = NULL;
}
}
}
efree(lcname);
if(found_const) {
*result = c->value;
zval_update_constant_ex(&result, 1, NULL TSRMLS_CC);
zval_copy_ctor(result);
Z_SET_REFCOUNT_P(result, 1);
Z_UNSET_ISREF_P(result);
return 1;
free_alloca(lcname, use_heap);
if (c) {
return &c->value;
}
/* name requires runtime resolution, need to check non-namespaced name */
if ((flags & IS_CONSTANT_UNQUALIFIED) != 0) {
name = constant_name;
name_len = const_name_len;
return zend_get_constant(name, name_len, result TSRMLS_CC);
return zend_get_constant_str(constant_name, const_name_len TSRMLS_CC);
}
retval = 0;
finish:
if (retval) {
zval_update_constant_ex(ret_constant, 1, ce TSRMLS_CC);
*result = **ret_constant;
zval_copy_ctor(result);
INIT_PZVAL(result);
}
return retval;
return NULL;
}
return zend_get_constant(name, name_len, result TSRMLS_CC);
if (cname) {
return zend_get_constant(cname TSRMLS_CC);
} else {
return zend_get_constant_str(name, name_len TSRMLS_CC);
}
}
zend_constant *zend_quick_get_constant(const zend_literal *key, ulong flags TSRMLS_DC)
zend_constant *zend_quick_get_constant(const zval *key, zend_ulong flags TSRMLS_DC)
{
zend_constant *c;
if (zend_hash_quick_find(EG(zend_constants), Z_STRVAL(key->constant), Z_STRLEN(key->constant) + 1, key->hash_value, (void **) &c) == FAILURE) {
if ((c = zend_hash_find_ptr(EG(zend_constants), Z_STR_P(key))) == NULL) {
key++;
if (zend_hash_quick_find(EG(zend_constants), Z_STRVAL(key->constant), Z_STRLEN(key->constant) + 1, key->hash_value, (void **) &c) == FAILURE ||
if ((c = zend_hash_find_ptr(EG(zend_constants), Z_STR_P(key))) == NULL ||
(c->flags & CONST_CS) != 0) {
if ((flags & (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) == (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) {
key++;
if (zend_hash_quick_find(EG(zend_constants), Z_STRVAL(key->constant), Z_STRLEN(key->constant) + 1, key->hash_value, (void **) &c) == FAILURE) {
if ((c = zend_hash_find_ptr(EG(zend_constants), Z_STR_P(key))) == NULL) {
key++;
if (zend_hash_quick_find(EG(zend_constants), Z_STRVAL(key->constant), Z_STRLEN(key->constant) + 1, key->hash_value, (void **) &c) == FAILURE ||
if ((c = zend_hash_find_ptr(EG(zend_constants), Z_STR_P(key))) == NULL ||
(c->flags & CONST_CS) != 0) {
key--;
if (!zend_get_special_constant(Z_STRVAL(key->constant), Z_STRLEN(key->constant), &c TSRMLS_CC)) {
return NULL;
}
c = zend_get_special_constant(Z_STRVAL_P(key), Z_STRLEN_P(key) TSRMLS_CC);
}
}
} else {
key--;
if (!zend_get_special_constant(Z_STRVAL(key->constant), Z_STRLEN(key->constant), &c TSRMLS_CC)) {
return NULL;
}
c = zend_get_special_constant(Z_STRVAL_P(key), Z_STRLEN_P(key) TSRMLS_CC);
}
}
}
return c;
}
static void* zend_hash_add_constant(HashTable *ht, zend_string *key, zend_constant *c)
{
void *ret;
zend_constant *copy = pemalloc(sizeof(zend_constant), c->flags & CONST_PERSISTENT);
memcpy(copy, c, sizeof(zend_constant));
ret = zend_hash_add_ptr(ht, key, copy);
if (!ret) {
pefree(copy, c->flags & CONST_PERSISTENT);
}
return ret;
}
ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
{
char *lowercase_name = NULL;
char *name;
zend_string *lowercase_name = NULL;
zend_string *name;
int ret = SUCCESS;
ulong chash;
#if 0
printf("Registering constant for module %d\n", c->module_number);
#endif
if (!(c->flags & CONST_CS)) {
/* keep in mind that c->name_len already contains the '\0' */
lowercase_name = estrndup(c->name, c->name_len-1);
zend_str_tolower(lowercase_name, c->name_len-1);
lowercase_name = (char*)zend_new_interned_string(lowercase_name, c->name_len, 1 TSRMLS_CC);
lowercase_name = zend_string_alloc(c->name->len, c->flags & CONST_PERSISTENT);
zend_str_tolower_copy(lowercase_name->val, c->name->val, c->name->len);
lowercase_name = zend_new_interned_string(lowercase_name TSRMLS_CC);
name = lowercase_name;
} else {
char *slash = strrchr(c->name, '\\');
char *slash = strrchr(c->name->val, '\\');
if (slash) {
lowercase_name = estrndup(c->name, c->name_len-1);
zend_str_tolower(lowercase_name, slash-c->name);
lowercase_name = (char*)zend_new_interned_string(lowercase_name, c->name_len, 1 TSRMLS_CC);
lowercase_name = zend_string_init(c->name->val, c->name->len, c->flags & CONST_PERSISTENT);
zend_str_tolower(lowercase_name->val, slash - c->name->val);
lowercase_name = zend_new_interned_string(lowercase_name TSRMLS_CC);
name = lowercase_name;
} else {
name = c->name;
}
}
chash = str_hash(name, c->name_len-1);
/* Check if the user is trying to define the internal pseudo constant name __COMPILER_HALT_OFFSET__ */
if ((c->name_len == sizeof("__COMPILER_HALT_OFFSET__")
&& !memcmp(name, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1))
|| zend_hash_quick_add(EG(zend_constants), name, c->name_len, chash, (void *) c, sizeof(zend_constant), NULL)==FAILURE) {
if ((c->name->len == sizeof("__COMPILER_HALT_OFFSET__")-1
&& !memcmp(name->val, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1))
|| zend_hash_add_constant(EG(zend_constants), name, c) == NULL) {
/* The internal __COMPILER_HALT_OFFSET__ is prefixed by NULL byte */
if (c->name[0] == '\0' && c->name_len > sizeof("\0__COMPILER_HALT_OFFSET__")
&& memcmp(name, "\0__COMPILER_HALT_OFFSET__", sizeof("\0__COMPILER_HALT_OFFSET__")) == 0) {
name++;
if (c->name->val[0] == '\0' && c->name->len > sizeof("\0__COMPILER_HALT_OFFSET__")-1
&& memcmp(name->val, "\0__COMPILER_HALT_OFFSET__", sizeof("\0__COMPILER_HALT_OFFSET__")) == 0) {
}
zend_error(E_NOTICE,"Constant %s already defined", name);
str_free(c->name);
zend_error(E_NOTICE,"Constant %s already defined", name->val);
zend_string_release(c->name);
if (!(c->flags & CONST_PERSISTENT)) {
zval_dtor(&c->value);
}
ret = FAILURE;
}
if (lowercase_name) {
str_efree(lowercase_name);
zend_string_release(lowercase_name);
}
return ret;
}
+20 -21
View File
@@ -33,17 +33,16 @@
typedef struct _zend_constant {
zval value;
int flags;
char *name;
uint name_len;
zend_string *name;
int module_number;
} zend_constant;
#define REGISTER_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name), (flags), module_number TSRMLS_CC)
#define REGISTER_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name), (bval), (flags), module_number TSRMLS_CC)
#define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name), (lval), (flags), module_number TSRMLS_CC)
#define REGISTER_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name), (dval), (flags), module_number TSRMLS_CC)
#define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name), (str), (flags), module_number TSRMLS_CC)
#define REGISTER_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), module_number TSRMLS_CC)
#define REGISTER_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name)-1, (flags), module_number TSRMLS_CC)
#define REGISTER_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name)-1, (bval), (flags), module_number TSRMLS_CC)
#define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number TSRMLS_CC)
#define REGISTER_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name)-1, (dval), (flags), module_number TSRMLS_CC)
#define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), module_number TSRMLS_CC)
#define REGISTER_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name)-1, (str), (len), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_NULL_CONSTANT(ns, name, flags) zend_register_null_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_BOOL_CONSTANT(ns, name, bval, flags) zend_register_bool_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (bval), (flags), module_number TSRMLS_CC)
@@ -52,35 +51,35 @@ typedef struct _zend_constant {
#define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (flags), module_number TSRMLS_CC)
#define REGISTER_NS_STRINGL_CONSTANT(ns, name, str, len, flags) zend_register_stringl_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (len), (flags), module_number TSRMLS_CC)
#define REGISTER_MAIN_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name), (bval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name), (lval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name), (dval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name), (str), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name)-1, (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name)-1, (bval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name)-1, (dval), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), 0 TSRMLS_CC)
#define REGISTER_MAIN_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name)-1, (str), (len), (flags), 0 TSRMLS_CC)
BEGIN_EXTERN_C()
void clean_module_constants(int module_number TSRMLS_DC);
void free_zend_constant(zend_constant *c);
void free_zend_constant(zval *zv);
int zend_startup_constants(TSRMLS_D);
int zend_shutdown_constants(TSRMLS_D);
void zend_register_standard_constants(TSRMLS_D);
void clean_non_persistent_constants(TSRMLS_D);
ZEND_API int zend_get_constant(const char *name, uint name_len, zval *result TSRMLS_DC);
ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result, zend_class_entry *scope, ulong flags TSRMLS_DC);
ZEND_API zval *zend_get_constant(zend_string *name TSRMLS_DC);
ZEND_API zval *zend_get_constant_str(const char *name, uint name_len TSRMLS_DC);
ZEND_API zval *zend_get_constant_ex(zend_string *name, zend_class_entry *scope, zend_ulong flags TSRMLS_DC);
ZEND_API void zend_register_bool_constant(const char *name, uint name_len, zend_bool bval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_null_constant(const char *name, uint name_len, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_long_constant(const char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_long_constant(const char *name, uint name_len, zend_long lval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_double_constant(const char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_string_constant(const char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_stringl_constant(const char *name, uint name_len, char *strval, uint strlen, int flags, int module_number TSRMLS_DC);
ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC);
void zend_copy_constants(HashTable *target, HashTable *sourc);
void copy_zend_constant(zend_constant *c);
zend_constant *zend_quick_get_constant(const zend_literal *key, ulong flags TSRMLS_DC);
zend_constant *zend_quick_get_constant(const zval *key, zend_ulong flags TSRMLS_DC);
END_EXTERN_C()
#define ZEND_CONSTANT_DTOR (void (*)(void *)) free_zend_constant
#define ZEND_CONSTANT_DTOR free_zend_constant
#endif
+9 -4
View File
@@ -26,8 +26,13 @@
/* PHP DTrace probes {{{ */
static inline const char *dtrace_get_executed_filename(TSRMLS_D)
{
if (EG(current_execute_data) && EG(current_execute_data)->op_array) {
return EG(current_execute_data)->op_array->filename;
zend_execute_data *ex = EG(current_execute_data);
while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) {
ex = ex->prev_execute_data;
}
if (ex) {
return ex->func->op_array.filename->val;
} else {
return zend_get_executed_filename(TSRMLS_C);
}
@@ -81,7 +86,7 @@ ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC)
}
}
ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC)
ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data, zval *return_value TSRMLS_DC)
{
int lineno;
const char *filename;
@@ -94,7 +99,7 @@ ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, zend_
DTRACE_EXECUTE_ENTRY((char *)filename, lineno);
}
execute_internal(execute_data_ptr, fci, return_value_used TSRMLS_CC);
execute_internal(execute_data, return_value TSRMLS_CC);
if (DTRACE_EXECUTE_RETURN_ENABLED()) {
DTRACE_EXECUTE_RETURN((char *)filename, lineno);
+2 -2
View File
@@ -32,11 +32,11 @@ extern "C" {
#ifdef HAVE_DTRACE
ZEND_API zend_op_array *(*zend_dtrace_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
ZEND_API void (*zend_dtrace_execute)(zend_op_array *op_array TSRMLS_DC);
ZEND_API void (*zend_dtrace_execute_internal)(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC);
ZEND_API void (*zend_dtrace_execute_internal)(zend_execute_data *execute_data, zval *return_value TSRMLS_DC);
ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC);
ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC);
ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC);
ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data, zval *return_value TSRMLS_DC);
#include <zend_dtrace_gen.h>
#endif /* HAVE_DTRACE */
+238 -217
View File
@@ -34,26 +34,29 @@ static zend_class_entry *error_exception_ce;
static zend_object_handlers default_exception_handlers;
ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
void zend_exception_set_previous(zval *exception, zval *add_previous TSRMLS_DC)
void zend_exception_set_previous(zend_object *exception, zend_object *add_previous TSRMLS_DC)
{
zval *previous;
zval tmp, *previous, zv, *pzv;
if (exception == add_previous || !add_previous || !exception) {
return;
}
if (Z_TYPE_P(add_previous) != IS_OBJECT && !instanceof_function(Z_OBJCE_P(add_previous), default_exception_ce TSRMLS_CC)) {
ZVAL_OBJ(&tmp, add_previous);
if (!instanceof_function(Z_OBJCE(tmp), default_exception_ce TSRMLS_CC)) {
zend_error(E_ERROR, "Cannot set non exception as previous exception");
return;
}
while (exception && exception != add_previous && Z_OBJ_HANDLE_P(exception) != Z_OBJ_HANDLE_P(add_previous)) {
previous = zend_read_property(default_exception_ce, exception, "previous", sizeof("previous")-1, 1 TSRMLS_CC);
ZVAL_OBJ(&zv, exception);
pzv = &zv;
do {
previous = zend_read_property(default_exception_ce, pzv, "previous", sizeof("previous")-1, 1 TSRMLS_CC);
if (Z_TYPE_P(previous) == IS_NULL) {
zend_update_property(default_exception_ce, exception, "previous", sizeof("previous")-1, add_previous TSRMLS_CC);
Z_DELREF_P(add_previous);
zend_update_property(default_exception_ce, pzv, "previous", sizeof("previous")-1, &tmp TSRMLS_CC);
GC_REFCOUNT(add_previous)--;
return;
}
exception = previous;
}
pzv = previous;
} while (pzv && Z_OBJ_P(pzv) != add_previous);
}
void zend_exception_save(TSRMLS_D) /* {{{ */
@@ -85,12 +88,11 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
{
#ifdef HAVE_DTRACE
if (DTRACE_EXCEPTION_THROWN_ENABLED()) {
const char *classname;
zend_uint name_len;
zend_string *classname;
if (exception != NULL) {
zend_get_object_classname(exception, &classname, &name_len TSRMLS_CC);
DTRACE_EXCEPTION_THROWN((char *)classname);
classname = zend_get_object_classname(Z_OBJ_P(exception) TSRMLS_CC);
DTRACE_EXCEPTION_THROWN(classname->val);
} else {
DTRACE_EXCEPTION_THROWN(NULL);
}
@@ -98,9 +100,9 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
#endif /* HAVE_DTRACE */
if (exception != NULL) {
zval *previous = EG(exception);
zend_exception_set_previous(exception, EG(exception) TSRMLS_CC);
EG(exception) = exception;
zend_object *previous = EG(exception);
zend_exception_set_previous(Z_OBJ_P(exception), EG(exception) TSRMLS_CC);
EG(exception) = Z_OBJ_P(exception);
if (previous) {
return;
}
@@ -116,7 +118,8 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
zend_throw_exception_hook(exception TSRMLS_CC);
}
if (EG(current_execute_data)->opline == NULL ||
if (!EG(current_execute_data)->func ||
!ZEND_USER_CODE(EG(current_execute_data)->func->common.type) ||
(EG(current_execute_data)->opline+1)->opcode == ZEND_HANDLE_EXCEPTION) {
/* no need to rethrow the exception */
return;
@@ -129,13 +132,14 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
ZEND_API void zend_clear_exception(TSRMLS_D) /* {{{ */
{
if (EG(prev_exception)) {
zval_ptr_dtor(&EG(prev_exception));
OBJ_RELEASE(EG(prev_exception));
EG(prev_exception) = NULL;
}
if (!EG(exception)) {
return;
}
zval_ptr_dtor(&EG(exception));
OBJ_RELEASE(EG(exception));
EG(exception) = NULL;
EG(current_execute_data)->opline = EG(opline_before_exception);
#if ZEND_DEBUG
@@ -144,37 +148,35 @@ ZEND_API void zend_clear_exception(TSRMLS_D) /* {{{ */
}
/* }}} */
static zend_object_value zend_default_exception_new_ex(zend_class_entry *class_type, int skip_top_traces TSRMLS_DC) /* {{{ */
static zend_object *zend_default_exception_new_ex(zend_class_entry *class_type, int skip_top_traces TSRMLS_DC) /* {{{ */
{
zval obj;
zend_object *object;
zval *trace;
zval trace;
Z_OBJVAL(obj) = zend_objects_new(&object, class_type TSRMLS_CC);
Z_OBJ(obj) = object = zend_objects_new(class_type TSRMLS_CC);
Z_OBJ_HT(obj) = &default_exception_handlers;
object_properties_init(object, class_type);
ALLOC_ZVAL(trace);
Z_UNSET_ISREF_P(trace);
Z_SET_REFCOUNT_P(trace, 0);
zend_fetch_debug_backtrace(trace, skip_top_traces, 0, 0 TSRMLS_CC);
zend_fetch_debug_backtrace(&trace, skip_top_traces, 0, 0 TSRMLS_CC);
Z_SET_REFCOUNT(trace, 0);
zend_update_property_string(default_exception_ce, &obj, "file", sizeof("file")-1, zend_get_executed_filename(TSRMLS_C) TSRMLS_CC);
zend_update_property_long(default_exception_ce, &obj, "line", sizeof("line")-1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);
zend_update_property(default_exception_ce, &obj, "trace", sizeof("trace")-1, trace TSRMLS_CC);
zend_update_property(default_exception_ce, &obj, "trace", sizeof("trace")-1, &trace TSRMLS_CC);
return Z_OBJVAL(obj);
return object;
}
/* }}} */
static zend_object_value zend_default_exception_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
static zend_object *zend_default_exception_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
{
return zend_default_exception_new_ex(class_type, 0 TSRMLS_CC);
}
/* }}} */
static zend_object_value zend_error_exception_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
static zend_object *zend_error_exception_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
{
return zend_default_exception_new_ex(class_type, 2 TSRMLS_CC);
}
@@ -193,19 +195,19 @@ ZEND_METHOD(exception, __clone)
Exception constructor */
ZEND_METHOD(exception, __construct)
{
char *message = NULL;
long code = 0;
zend_string *message = NULL;
zend_long code = 0;
zval *object, *previous = NULL;
int argc = ZEND_NUM_ARGS(), message_len;
int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "|slO!", &message, &message_len, &code, &previous, default_exception_ce) == FAILURE) {
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "|SlO!", &message, &code, &previous, default_exception_ce) == FAILURE) {
zend_error(E_ERROR, "Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])");
}
object = getThis();
if (message) {
zend_update_property_stringl(default_exception_ce, object, "message", sizeof("message")-1, message, message_len TSRMLS_CC);
zend_update_property_str(default_exception_ce, object, "message", sizeof("message")-1, message TSRMLS_CC);
}
if (code) {
@@ -223,7 +225,7 @@ ZEND_METHOD(exception, __construct)
ZEND_METHOD(error_exception, __construct)
{
char *message = NULL, *filename = NULL;
long code = 0, severity = E_ERROR, lineno;
zend_long code = 0, severity = E_ERROR, lineno;
zval *object, *previous = NULL;
int argc = ZEND_NUM_ARGS(), message_len, filename_len;
@@ -267,10 +269,7 @@ static void _default_exception_get_entry(zval *object, char *name, int name_len,
zval *value;
value = zend_read_property(default_exception_ce, object, name, name_len, 0 TSRMLS_CC);
*return_value = *value;
zval_copy_ctor(return_value);
INIT_PZVAL(return_value);
ZVAL_COPY(return_value, value);
}
/* }}} */
@@ -335,45 +334,43 @@ ZEND_METHOD(error_exception, getSeverity)
/* }}} */
/* {{{ gettraceasstring() macros */
#define TRACE_APPEND_CHR(chr) \
*str = (char*)erealloc(*str, *len + 1 + 1); \
(*str)[(*len)++] = chr
#define TRACE_APPEND_CHR(chr) \
str = zend_string_realloc(str, str->len + 1, 0); \
str->val[str->len - 1] = chr
#define TRACE_APPEND_STRL(val, vallen) \
{ \
int l = vallen; \
*str = (char*)erealloc(*str, *len + l + 1); \
memcpy((*str) + *len, val, l); \
*len += l; \
#define TRACE_APPEND_STRL(v, l) \
{ \
str = zend_string_realloc(str, str->len + (l), 0); \
memcpy(str->val + str->len - (l), (v), (l)); \
}
#define TRACE_APPEND_STR(val) \
TRACE_APPEND_STRL(val, sizeof(val)-1)
#define TRACE_APPEND_STR(v) \
TRACE_APPEND_STRL((v), sizeof((v))-1)
#define TRACE_APPEND_KEY(key) \
if (zend_hash_find(ht, key, sizeof(key), (void**)&tmp) == SUCCESS) { \
if (Z_TYPE_PP(tmp) != IS_STRING) { \
zend_error(E_WARNING, "Value for %s is no string", key); \
TRACE_APPEND_STR("[unknown]"); \
} else { \
TRACE_APPEND_STRL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); \
} \
}
#define TRACE_APPEND_KEY(key) do { \
tmp = zend_hash_str_find(ht, key, sizeof(key)-1); \
if (tmp) { \
if (Z_TYPE_P(tmp) != IS_STRING) { \
zend_error(E_WARNING, "Value for %s is no string", key); \
TRACE_APPEND_STR("[unknown]"); \
} else { \
TRACE_APPEND_STRL(Z_STRVAL_P(tmp), Z_STRLEN_P(tmp)); \
} \
} \
} while (0)
#define TRACE_ARG_APPEND(vallen) \
*str = (char*)erealloc(*str, *len + 1 + vallen); \
memmove((*str) + *len - l_added + 1 + vallen, (*str) + *len - l_added + 1, l_added);
#define TRACE_ARG_APPEND(vallen) do { \
int len = str->len; \
str = zend_string_realloc(str, len + vallen, 0); \
memmove(str->val + len - l_added + 1 + vallen, str->val + len - l_added + 1, l_added); \
} while (0)
/* }}} */
static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
static void _build_trace_args(zval *arg, zend_string **str_ptr TSRMLS_DC) /* {{{ */
{
char **str;
int *len;
str = va_arg(args, char**);
len = va_arg(args, int*);
zend_string *str = *str_ptr;
/* the trivial way would be to do:
* convert_to_string_ex(arg);
@@ -381,48 +378,49 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
* but that could cause some E_NOTICE and also damn long lines.
*/
switch (Z_TYPE_PP(arg)) {
ZVAL_DEREF(arg);
switch (Z_TYPE_P(arg)) {
case IS_NULL:
TRACE_APPEND_STR("NULL, ");
break;
case IS_STRING: {
int l_added;
TRACE_APPEND_CHR('\'');
if (Z_STRLEN_PP(arg) > 15) {
TRACE_APPEND_STRL(Z_STRVAL_PP(arg), 15);
if (Z_STRLEN_P(arg) > 15) {
TRACE_APPEND_STRL(Z_STRVAL_P(arg), 15);
TRACE_APPEND_STR("...', ");
l_added = 15 + 6 + 1; /* +1 because of while (--l_added) */
} else {
l_added = Z_STRLEN_PP(arg);
TRACE_APPEND_STRL(Z_STRVAL_PP(arg), l_added);
l_added = Z_STRLEN_P(arg);
TRACE_APPEND_STRL(Z_STRVAL_P(arg), l_added);
TRACE_APPEND_STR("', ");
l_added += 3 + 1;
}
while (--l_added) {
unsigned char chr = (*str)[*len - l_added];
unsigned char chr = str->val[str->len - l_added];
if (chr < 32 || chr == '\\' || chr > 126) {
(*str)[*len - l_added] = '\\';
str->val[str->len - l_added] = '\\';
switch (chr) {
case '\n':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'n';
str->val[str->len - l_added] = 'n';
break;
case '\r':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'r';
str->val[str->len - l_added] = 'r';
break;
case '\t':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 't';
str->val[str->len - l_added] = 't';
break;
case '\f':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'f';
str->val[str->len - l_added] = 'f';
break;
case '\v':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'v';
str->val[str->len - l_added] = 'v';
break;
#ifndef PHP_WIN32
case '\e':
@@ -430,51 +428,55 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
case VK_ESCAPE:
#endif
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'e';
str->val[str->len - l_added] = 'e';
break;
case '\\':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = '\\';
str->val[str->len - l_added] = '\\';
break;
default:
TRACE_ARG_APPEND(3);
(*str)[*len - l_added + 1] = 'x';
str->val[str->len - l_added - 2] = 'x';
if ((chr >> 4) < 10) {
(*str)[*len - l_added + 2] = (chr >> 4) + '0';
str->val[str->len - l_added - 1] = (chr >> 4) + '0';
} else {
(*str)[*len - l_added + 2] = (chr >> 4) + 'A' - 10;
str->val[str->len - l_added - 1] = (chr >> 4) + 'A' - 10;
}
if (chr % 16 < 10) {
(*str)[*len - l_added + 3] = chr % 16 + '0';
str->val[str->len - l_added] = chr % 16 + '0';
} else {
(*str)[*len - l_added + 3] = chr % 16 + 'A' - 10;
str->val[str->len - l_added] = chr % 16 + 'A' - 10;
}
*len += 3;
}
}
}
break;
}
case IS_BOOL:
if (Z_LVAL_PP(arg)) {
TRACE_APPEND_STR("true, ");
} else {
TRACE_APPEND_STR("false, ");
}
case IS_FALSE:
TRACE_APPEND_STR("false, ");
break;
case IS_RESOURCE:
TRACE_APPEND_STR("Resource id #");
/* break; */
case IS_LONG: {
long lval = Z_LVAL_PP(arg);
case IS_TRUE:
TRACE_APPEND_STR("true, ");
break;
case IS_RESOURCE: {
zend_long lval = Z_RES_HANDLE_P(arg);
char s_tmp[MAX_LENGTH_OF_LONG + 1];
int l_tmp = zend_sprintf(s_tmp, "%ld", lval); /* SAFE */
int l_tmp = zend_sprintf(s_tmp, ZEND_LONG_FMT, lval); /* SAFE */
TRACE_APPEND_STR("Resource id #");
TRACE_APPEND_STRL(s_tmp, l_tmp);
TRACE_APPEND_STR(", ");
break;
}
case IS_LONG: {
zend_long lval = Z_LVAL_P(arg);
char s_tmp[MAX_LENGTH_OF_LONG + 1];
int l_tmp = zend_sprintf(s_tmp, ZEND_LONG_FMT, lval); /* SAFE */
TRACE_APPEND_STRL(s_tmp, l_tmp);
TRACE_APPEND_STR(", ");
break;
}
case IS_DOUBLE: {
double dval = Z_DVAL_PP(arg);
double dval = Z_DVAL_P(arg);
char *s_tmp;
int l_tmp;
@@ -490,58 +492,52 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
TRACE_APPEND_STR("Array, ");
break;
case IS_OBJECT: {
const char *class_name;
zend_uint class_name_len;
int dup;
zend_string *class_name;
TRACE_APPEND_STR("Object(");
dup = zend_get_object_classname(*arg, &class_name, &class_name_len TSRMLS_CC);
TRACE_APPEND_STRL(class_name, class_name_len);
if(!dup) {
efree((char*)class_name);
}
class_name = zend_get_object_classname(Z_OBJ_P(arg) TSRMLS_CC);
TRACE_APPEND_STRL(class_name->val, class_name->len);
TRACE_APPEND_STR("), ");
break;
}
default:
break;
}
return ZEND_HASH_APPLY_KEEP;
*str_ptr = str;
}
/* }}} */
static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
static void _build_trace_string(zval *frame, zend_ulong index, zend_string **str_ptr, int *num TSRMLS_DC) /* {{{ */
{
char *s_tmp, **str;
int *len, *num;
char *s_tmp;
int len;
long line;
HashTable *ht = Z_ARRVAL_PP(frame);
zval **file, **tmp;
HashTable *ht;
zval *file, *tmp;
zend_string *str = *str_ptr;
if (Z_TYPE_PP(frame) != IS_ARRAY) {
zend_error(E_WARNING, "Expected array for frame %lu", hash_key->h);
return ZEND_HASH_APPLY_KEEP;
if (Z_TYPE_P(frame) != IS_ARRAY) {
zend_error(E_WARNING, "Expected array for frame %pu", index);
return;
}
str = va_arg(args, char**);
len = va_arg(args, int*);
num = va_arg(args, int*);
ht = Z_ARRVAL_P(frame);
s_tmp = emalloc(1 + MAX_LENGTH_OF_LONG + 1 + 1);
sprintf(s_tmp, "#%d ", (*num)++);
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
len = sprintf(s_tmp, "#%d ", (*num)++);
TRACE_APPEND_STRL(s_tmp, len);
efree(s_tmp);
if (zend_hash_find(ht, "file", sizeof("file"), (void**)&file) == SUCCESS) {
if (Z_TYPE_PP(file) != IS_STRING) {
file = zend_hash_str_find(ht, "file", sizeof("file")-1);
if (file) {
if (Z_TYPE_P(file) != IS_STRING) {
zend_error(E_WARNING, "Function name is no string");
TRACE_APPEND_STR("[unknown function]");
} else{
if (zend_hash_find(ht, "line", sizeof("line"), (void**)&tmp) == SUCCESS) {
if (Z_TYPE_PP(tmp) == IS_LONG) {
line = Z_LVAL_PP(tmp);
tmp = zend_hash_str_find(ht, "line", sizeof("line")-1);
if (tmp) {
if (Z_TYPE_P(tmp) == IS_LONG) {
line = Z_LVAL_P(tmp);
} else {
zend_error(E_WARNING, "Line is no long");
line = 0;
@@ -549,9 +545,9 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg
} else {
line = 0;
}
s_tmp = emalloc(Z_STRLEN_PP(file) + MAX_LENGTH_OF_LONG + 4 + 1);
sprintf(s_tmp, "%s(%ld): ", Z_STRVAL_PP(file), line);
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
s_tmp = emalloc(Z_STRLEN_P(file) + MAX_LENGTH_OF_LONG + 4 + 1);
len = sprintf(s_tmp, "%s(%ld): ", Z_STRVAL_P(file), line);
TRACE_APPEND_STRL(s_tmp, len);
efree(s_tmp);
}
} else {
@@ -561,19 +557,25 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg
TRACE_APPEND_KEY("type");
TRACE_APPEND_KEY("function");
TRACE_APPEND_CHR('(');
if (zend_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) {
if (Z_TYPE_PP(tmp) == IS_ARRAY) {
int last_len = *len;
zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp) TSRMLS_CC, (apply_func_args_t)_build_trace_args, 2, str, len);
if (last_len != *len) {
*len -= 2; /* remove last ', ' */
tmp = zend_hash_str_find(ht, "args", sizeof("args")-1);
if (tmp) {
if (Z_TYPE_P(tmp) == IS_ARRAY) {
int last_len = str->len;
zval *arg;
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(tmp), arg) {
_build_trace_args(arg, &str TSRMLS_CC);
} ZEND_HASH_FOREACH_END();
if (last_len != str->len) {
str->len -= 2; /* remove last ', ' */
}
} else {
zend_error(E_WARNING, "args element is no array");
}
}
TRACE_APPEND_STR(")\n");
return ZEND_HASH_APPLY_KEEP;
*str_ptr = str;
}
/* }}} */
@@ -581,25 +583,27 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg
Obtain the backtrace for the exception as a string (instead of an array) */
ZEND_METHOD(exception, getTraceAsString)
{
zval *trace;
char *res, **str, *s_tmp;
int res_len = 0, *len = &res_len, num = 0;
zval *trace, *frame;
zend_ulong index;
zend_string *str, *key;
int num = 0, len;
char s_tmp[MAX_LENGTH_OF_LONG + 7 + 1 + 1];
DEFAULT_0_PARAMS;
res = estrdup("");
str = &res;
str = zend_string_alloc(0, 0);
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
zend_hash_apply_with_arguments(Z_ARRVAL_P(trace) TSRMLS_CC, (apply_func_args_t)_build_trace_string, 3, str, len, &num);
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(trace), index, key, frame) {
_build_trace_string(frame, index, &str, &num TSRMLS_CC);
} ZEND_HASH_FOREACH_END();
s_tmp = emalloc(1 + MAX_LENGTH_OF_LONG + 7 + 1);
sprintf(s_tmp, "#%d {main}", num);
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
efree(s_tmp);
len = sprintf(s_tmp, "#%d {main}", num);
TRACE_APPEND_STRL(s_tmp, len);
res[res_len] = '\0';
RETURN_STRINGL(res, res_len, 0);
str->val[str->len] = '\0';
RETURN_NEW_STR(str);
}
/* }}} */
@@ -613,7 +617,7 @@ ZEND_METHOD(exception, getPrevious)
previous = zend_read_property(default_exception_ce, getThis(), "previous", sizeof("previous")-1, 1 TSRMLS_CC);
RETURN_ZVAL(previous, 1, 0);
}
} /* }}} */
int zend_spprintf(char **message, int max_len, const char *format, ...) /* {{{ */
{
@@ -627,22 +631,33 @@ int zend_spprintf(char **message, int max_len, const char *format, ...) /* {{{ *
}
/* }}} */
zend_string *zend_strpprintf(int max_len, const char *format, ...) /* {{{ */
{
va_list arg;
zend_string *str;
va_start(arg, format);
str = zend_vstrpprintf(max_len, format, arg);
va_end(arg);
return str;
}
/* }}} */
/* {{{ proto string Exception::__toString()
Obtain the string representation of the Exception object */
ZEND_METHOD(exception, __toString)
{
zval message, file, line, *trace, *exception;
char *str, *prev_str;
int len = 0;
zval message, file, line, trace, *exception;
zend_string *str, *prev_str;
zend_fcall_info fci;
zval fname;
DEFAULT_0_PARAMS;
str = estrndup("", 0);
str = STR_EMPTY_ALLOC();
exception = getThis();
ZVAL_STRINGL(&fname, "gettraceasstring", sizeof("gettraceasstring")-1, 1);
ZVAL_STRINGL(&fname, "gettraceasstring", sizeof("gettraceasstring")-1);
while (exception && Z_TYPE_P(exception) == IS_OBJECT) {
prev_str = str;
@@ -650,57 +665,55 @@ ZEND_METHOD(exception, __toString)
_default_exception_get_entry(exception, "file", sizeof("file")-1, &file TSRMLS_CC);
_default_exception_get_entry(exception, "line", sizeof("line")-1, &line TSRMLS_CC);
convert_to_string(&message);
convert_to_string(&file);
convert_to_long(&line);
convert_to_string_ex(&message);
convert_to_string_ex(&file);
convert_to_long_ex(&line);
fci.size = sizeof(fci);
fci.function_table = &Z_OBJCE_P(exception)->function_table;
fci.function_name = &fname;
ZVAL_COPY_VALUE(&fci.function_name, &fname);
fci.symbol_table = NULL;
fci.object_ptr = exception;
fci.retval_ptr_ptr = &trace;
fci.object = Z_OBJ_P(exception);
fci.retval = &trace;
fci.param_count = 0;
fci.params = NULL;
fci.no_separation = 1;
zend_call_function(&fci, NULL TSRMLS_CC);
if (Z_TYPE_P(trace) != IS_STRING) {
if (Z_TYPE(trace) != IS_STRING) {
zval_ptr_dtor(&trace);
trace = NULL;
ZVAL_UNDEF(&trace);
}
if (Z_STRLEN(message) > 0) {
len = zend_spprintf(&str, 0, "exception '%s' with message '%s' in %s:%ld\nStack trace:\n%s%s%s",
Z_OBJCE_P(exception)->name, Z_STRVAL(message), Z_STRVAL(file), Z_LVAL(line),
(trace && Z_STRLEN_P(trace)) ? Z_STRVAL_P(trace) : "#0 {main}\n",
len ? "\n\nNext " : "", prev_str);
str = zend_strpprintf(0, "exception '%s' with message '%s' in %s:%ld\nStack trace:\n%s%s%s",
Z_OBJCE_P(exception)->name->val, Z_STRVAL(message), Z_STRVAL(file), Z_LVAL(line),
(Z_TYPE(trace) == IS_STRING && Z_STRLEN(trace)) ? Z_STRVAL(trace) : "#0 {main}\n",
prev_str->len ? "\n\nNext " : "", prev_str->val);
} else {
len = zend_spprintf(&str, 0, "exception '%s' in %s:%ld\nStack trace:\n%s%s%s",
Z_OBJCE_P(exception)->name, Z_STRVAL(file), Z_LVAL(line),
(trace && Z_STRLEN_P(trace)) ? Z_STRVAL_P(trace) : "#0 {main}\n",
len ? "\n\nNext " : "", prev_str);
str = zend_strpprintf(0, "exception '%s' in %s:%ld\nStack trace:\n%s%s%s",
Z_OBJCE_P(exception)->name->val, Z_STRVAL(file), Z_LVAL(line),
(Z_TYPE(trace) == IS_STRING && Z_STRLEN(trace)) ? Z_STRVAL(trace) : "#0 {main}\n",
prev_str->len ? "\n\nNext " : "", prev_str->val);
}
efree(prev_str);
zend_string_release(prev_str);
zval_dtor(&message);
zval_dtor(&file);
zval_dtor(&line);
exception = zend_read_property(default_exception_ce, exception, "previous", sizeof("previous")-1, 0 TSRMLS_CC);
if (trace) {
zval_ptr_dtor(&trace);
}
zval_ptr_dtor(&trace);
}
zval_dtor(&fname);
/* We store the result in the private property string so we can access
* the result in uncaught exception handlers without memleaks. */
zend_update_property_string(default_exception_ce, getThis(), "string", sizeof("string")-1, str TSRMLS_CC);
zend_update_property_str(default_exception_ce, getThis(), "string", sizeof("string")-1, str TSRMLS_CC);
RETURN_STRINGL(str, len, 0);
RETURN_STR(str);
}
/* }}} */
@@ -769,7 +782,7 @@ void zend_register_default_exception(TSRMLS_D) /* {{{ */
zend_declare_property_null(default_exception_ce, "previous", sizeof("previous")-1, ZEND_ACC_PRIVATE TSRMLS_CC);
INIT_CLASS_ENTRY(ce, "ErrorException", error_exception_functions);
error_exception_ce = zend_register_internal_class_ex(&ce, default_exception_ce, NULL TSRMLS_CC);
error_exception_ce = zend_register_internal_class_ex(&ce, default_exception_ce TSRMLS_CC);
error_exception_ce->create_object = zend_error_exception_new;
zend_declare_property_long(error_exception_ce, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED TSRMLS_CC);
}
@@ -787,11 +800,10 @@ ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D) /* {{{ */
}
/* }}} */
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC) /* {{{ */
ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC) /* {{{ */
{
zval *ex;
zval ex;
MAKE_STD_ZVAL(ex);
if (exception_ce) {
if (!instanceof_function(exception_ce, default_exception_ce TSRMLS_CC)) {
zend_error(E_NOTICE, "Exceptions must be derived from the Exception base class");
@@ -800,41 +812,43 @@ ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char
} else {
exception_ce = default_exception_ce;
}
object_init_ex(ex, exception_ce);
object_init_ex(&ex, exception_ce);
if (message) {
zend_update_property_string(default_exception_ce, ex, "message", sizeof("message")-1, message TSRMLS_CC);
zend_update_property_string(default_exception_ce, &ex, "message", sizeof("message")-1, message TSRMLS_CC);
}
if (code) {
zend_update_property_long(default_exception_ce, ex, "code", sizeof("code")-1, code TSRMLS_CC);
zend_update_property_long(default_exception_ce, &ex, "code", sizeof("code")-1, code TSRMLS_CC);
}
zend_throw_exception_internal(ex TSRMLS_CC);
return ex;
zend_throw_exception_internal(&ex TSRMLS_CC);
return Z_OBJ(ex);
}
/* }}} */
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *format, ...) /* {{{ */
ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *format, ...) /* {{{ */
{
va_list arg;
char *message;
zval *zexception;
zend_object *obj;
va_start(arg, format);
zend_vspprintf(&message, 0, format, arg);
va_end(arg);
zexception = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
obj = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
efree(message);
return zexception;
return obj;
}
/* }}} */
ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, long code, int severity TSRMLS_DC) /* {{{ */
ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, long code, int severity TSRMLS_DC) /* {{{ */
{
zval *ex = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
zend_update_property_long(default_exception_ce, ex, "severity", sizeof("severity")-1, severity TSRMLS_CC);
return ex;
zval ex;
zend_object *obj = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
ZVAL_OBJ(&ex, obj);
zend_update_property_long(default_exception_ce, &ex, "severity", sizeof("severity")-1, severity TSRMLS_CC);
return obj;
}
/* }}} */
@@ -849,51 +863,58 @@ static void zend_error_va(int type, const char *file, uint lineno, const char *f
/* }}} */
/* This function doesn't return if it uses E_ERROR */
ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {{{ */
ZEND_API void zend_exception_error(zend_object *ex, int severity TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce_exception = Z_OBJCE_P(exception);
zval exception;
zend_class_entry *ce_exception;
ZVAL_OBJ(&exception, ex);
ce_exception = Z_OBJCE(exception);
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
zval *str, *file, *line;
zval tmp, *str, *file, *line;
EG(exception) = NULL;
zend_call_method_with_0_params(&exception, ce_exception, NULL, "__tostring", &str);
zend_call_method_with_0_params(&exception, ce_exception, NULL, "__tostring", &tmp);
if (!EG(exception)) {
if (Z_TYPE_P(str) != IS_STRING) {
zend_error(E_WARNING, "%s::__toString() must return a string", ce_exception->name);
if (Z_TYPE(tmp) != IS_STRING) {
zend_error(E_WARNING, "%s::__toString() must return a string", ce_exception->name->val);
} else {
zend_update_property_string(default_exception_ce, exception, "string", sizeof("string")-1, EG(exception) ? ce_exception->name : Z_STRVAL_P(str) TSRMLS_CC);
zend_update_property_string(default_exception_ce, &exception, "string", sizeof("string")-1, EG(exception) ? ce_exception->name->val : Z_STRVAL(tmp) TSRMLS_CC);
}
}
zval_ptr_dtor(&str);
zval_ptr_dtor(&tmp);
if (EG(exception)) {
zval zv;
ZVAL_OBJ(&zv, EG(exception));
/* do the best we can to inform about the inner exception */
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
file = zend_read_property(default_exception_ce, EG(exception), "file", sizeof("file")-1, 1 TSRMLS_CC);
line = zend_read_property(default_exception_ce, EG(exception), "line", sizeof("line")-1, 1 TSRMLS_CC);
file = zend_read_property(default_exception_ce, &zv, "file", sizeof("file")-1, 1 TSRMLS_CC);
line = zend_read_property(default_exception_ce, &zv, "line", sizeof("line")-1, 1 TSRMLS_CC);
convert_to_string(file);
convert_to_string_ex(file);
file = (Z_STRLEN_P(file) > 0) ? file : NULL;
line = (Z_TYPE_P(line) == IS_LONG) ? line : NULL;
} else {
file = NULL;
line = NULL;
}
zend_error_va(E_WARNING, file ? Z_STRVAL_P(file) : NULL, line ? Z_LVAL_P(line) : 0, "Uncaught %s in exception handling during call to %s::__tostring()", Z_OBJCE_P(EG(exception))->name, ce_exception->name);
zend_error_va(E_WARNING, file ? Z_STRVAL_P(file) : NULL, line ? Z_LVAL_P(line) : 0, "Uncaught %s in exception handling during call to %s::__tostring()", Z_OBJCE(zv)->name->val, ce_exception->name->val);
}
str = zend_read_property(default_exception_ce, exception, "string", sizeof("string")-1, 1 TSRMLS_CC);
file = zend_read_property(default_exception_ce, exception, "file", sizeof("file")-1, 1 TSRMLS_CC);
line = zend_read_property(default_exception_ce, exception, "line", sizeof("line")-1, 1 TSRMLS_CC);
str = zend_read_property(default_exception_ce, &exception, "string", sizeof("string")-1, 1 TSRMLS_CC);
file = zend_read_property(default_exception_ce, &exception, "file", sizeof("file")-1, 1 TSRMLS_CC);
line = zend_read_property(default_exception_ce, &exception, "line", sizeof("line")-1, 1 TSRMLS_CC);
convert_to_string(str);
convert_to_string(file);
convert_to_long(line);
convert_to_string_ex(str);
convert_to_string_ex(file);
convert_to_long_ex(line);
zend_error_va(severity, (Z_STRLEN_P(file) > 0) ? Z_STRVAL_P(file) : NULL, Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
} else {
zend_error(severity, "Uncaught exception '%s'", ce_exception->name);
zend_error(severity, "Uncaught exception '%s'", ce_exception->name->val);
}
}
/* }}} */
+6 -5
View File
@@ -26,7 +26,7 @@
BEGIN_EXTERN_C()
ZEND_API void zend_exception_set_previous(zval *exception, zval *add_previous TSRMLS_DC);
ZEND_API void zend_exception_set_previous(zend_object *exception, zend_object *add_previous TSRMLS_DC);
ZEND_API void zend_exception_save(TSRMLS_D);
ZEND_API void zend_exception_restore(TSRMLS_D);
@@ -40,20 +40,21 @@ ZEND_API void zend_register_default_classes(TSRMLS_D);
/* exception_ce NULL or zend_exception_get_default() or a derived class
* message NULL or the message of the exception */
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC);
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *format, ...);
ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC);
ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *format, ...);
ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC);
ZEND_API void zend_clear_exception(TSRMLS_D);
ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, long code, int severity TSRMLS_DC);
ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, long code, int severity TSRMLS_DC);
extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
/* show an exception using zend_error(severity,...), severity should be E_ERROR */
ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC);
ZEND_API void zend_exception_error(zend_object *exception, int severity TSRMLS_DC);
/* do not export, in php it's available thru spprintf directly */
int zend_spprintf(char **message, int max_len, const char *format, ...);
zend_string *zend_strpprintf(int max_len, const char *format, ...);
END_EXTERN_C()
+1234 -1175
View File
File diff suppressed because it is too large. Load diff
+145 -212
View File
@@ -27,93 +27,72 @@
#include "zend_operators.h"
#include "zend_variables.h"
typedef union _temp_variable {
zval tmp_var;
struct {
zval **ptr_ptr;
zval *ptr;
zend_bool fcall_returned_reference;
} var;
struct {
zval **ptr_ptr; /* shared with var.ptr_ptr */
zval *str;
zend_uint offset;
} str_offset;
struct {
zval **ptr_ptr; /* shared with var.ptr_ptr */
zval *ptr; /* shared with var.ptr */
HashPointer fe_pos;
} fe;
zend_class_entry *class_entry;
} temp_variable;
BEGIN_EXTERN_C()
struct _zend_fcall_info;
ZEND_API extern void (*zend_execute_ex)(zend_execute_data *execute_data TSRMLS_DC);
ZEND_API extern void (*zend_execute_internal)(zend_execute_data *execute_data_ptr, struct _zend_fcall_info *fci, int return_value_used TSRMLS_DC);
ZEND_API extern void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value TSRMLS_DC);
void init_executor(TSRMLS_D);
void shutdown_executor(TSRMLS_D);
void shutdown_destructors(TSRMLS_D);
ZEND_API zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_array, zend_bool nested TSRMLS_DC);
ZEND_API void zend_execute(zend_op_array *op_array TSRMLS_DC);
ZEND_API void zend_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value, vm_frame_kind frame_kind TSRMLS_DC);
ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data *call, zend_op_array *op_array, zval *return_value TSRMLS_DC);
ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value TSRMLS_DC);
ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC);
ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, struct _zend_fcall_info *fci, int return_value_used TSRMLS_DC);
ZEND_API int zend_is_true(zval *op);
ZEND_API int zend_lookup_class(const char *name, int name_length, zend_class_entry ***ce TSRMLS_DC);
ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC);
ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value TSRMLS_DC);
ZEND_API int zend_is_true(zval *op TSRMLS_DC);
ZEND_API zend_class_entry *zend_lookup_class(zend_string *name TSRMLS_DC);
ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *key, int use_autoload TSRMLS_DC);
ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC);
ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *string_name TSRMLS_DC);
ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC);
ZEND_API int zend_eval_stringl_ex(char *str, int str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC);
ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, ulong fetch_type, const char **class_name, zend_class_entry **pce TSRMLS_DC);
ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend_uint arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind TSRMLS_DC);
ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, zend_ulong fetch_type, char **class_name, zend_class_entry **pce TSRMLS_DC);
ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg TSRMLS_DC);
static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC)
{
if (!Z_DELREF_P(zval_ptr)) {
ZEND_ASSERT(zval_ptr != &EG(uninitialized_zval));
GC_REMOVE_ZVAL_FROM_BUFFER(zval_ptr);
zval_dtor(zval_ptr);
efree_rel(zval_ptr);
} else {
if (Z_REFCOUNT_P(zval_ptr) == 1) {
Z_UNSET_ISREF_P(zval_ptr);
if (Z_REFCOUNTED_P(zval_ptr)) {
if (!Z_DELREF_P(zval_ptr)) {
ZEND_ASSERT(zval_ptr != &EG(uninitialized_zval));
_zval_dtor_func_for_ptr(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_CC);
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(zval_ptr);
}
GC_ZVAL_CHECK_POSSIBLE_ROOT(zval_ptr);
}
}
static zend_always_inline void i_zval_ptr_dtor_nogc(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC)
{
if (!Z_DELREF_P(zval_ptr)) {
ZEND_ASSERT(zval_ptr != &EG(uninitialized_zval));
GC_REMOVE_ZVAL_FROM_BUFFER(zval_ptr);
zval_dtor(zval_ptr);
efree_rel(zval_ptr);
} else {
if (Z_REFCOUNT_P(zval_ptr) == 1) {
Z_UNSET_ISREF_P(zval_ptr);
if (Z_REFCOUNTED_P(zval_ptr)) {
if (!Z_DELREF_P(zval_ptr)) {
ZEND_ASSERT(zval_ptr != &EG(uninitialized_zval));
_zval_dtor_func_for_ptr(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_CC);
}
}
}
static zend_always_inline int i_zend_is_true(zval *op)
static zend_always_inline int i_zend_is_true(zval *op TSRMLS_DC)
{
int result;
again:
switch (Z_TYPE_P(op)) {
case IS_UNDEF:
case IS_NULL:
case IS_FALSE:
result = 0;
break;
case IS_TRUE:
result = 1;
break;
case IS_LONG:
case IS_BOOL:
case IS_RESOURCE:
result = (Z_LVAL_P(op)?1:0);
break;
case IS_RESOURCE:
result = (Z_RES_HANDLE_P(op)?1:0);
break;
case IS_DOUBLE:
result = (Z_DVAL_P(op) ? 1 : 0);
break;
@@ -129,28 +108,32 @@ static zend_always_inline int i_zend_is_true(zval *op)
result = (zend_hash_num_elements(Z_ARRVAL_P(op))?1:0);
break;
case IS_OBJECT:
if(IS_ZEND_STD_OBJECT(*op)) {
TSRMLS_FETCH();
if (IS_ZEND_STD_OBJECT(*op)) {
if (Z_OBJ_HT_P(op)->cast_object) {
zval tmp;
if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_BOOL TSRMLS_CC) == SUCCESS) {
result = Z_LVAL(tmp);
if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, _IS_BOOL TSRMLS_CC) == SUCCESS) {
result = Z_TYPE(tmp) == IS_TRUE;
break;
}
zend_error(E_RECOVERABLE_ERROR, "Object of class %s could not be converted to boolean", Z_OBJ_P(op)->ce->name->val);
} else if (Z_OBJ_HT_P(op)->get) {
zval *tmp = Z_OBJ_HT_P(op)->get(op TSRMLS_CC);
if(Z_TYPE_P(tmp) != IS_OBJECT) {
zval rv;
zval *tmp = Z_OBJ_HT_P(op)->get(op, &rv TSRMLS_CC);
if (Z_TYPE_P(tmp) != IS_OBJECT) {
/* for safety - avoid loop */
convert_to_boolean(tmp);
result = Z_LVAL_P(tmp);
zval_ptr_dtor(&tmp);
result = Z_TYPE_P(tmp) == IS_TRUE;
zval_ptr_dtor(tmp);
break;
}
}
}
result = 1;
break;
case IS_REFERENCE:
op = Z_REFVAL_P(op);
goto again;
break;
default:
result = 0;
break;
@@ -158,36 +141,40 @@ static zend_always_inline int i_zend_is_true(zval *op)
return result;
}
ZEND_API int zval_update_constant(zval **pp, zend_bool inline_change TSRMLS_DC);
ZEND_API int zval_update_constant_inline_change(zval **pp, zend_class_entry *scope TSRMLS_DC);
ZEND_API int zval_update_constant_no_inline_change(zval **pp, zend_class_entry *scope TSRMLS_DC);
ZEND_API int zval_update_constant_ex(zval **pp, zend_bool inline_change, zend_class_entry *scope TSRMLS_DC);
ZEND_API int zval_update_constant(zval *pp, zend_bool inline_change TSRMLS_DC);
ZEND_API int zval_update_constant_inline_change(zval *pp, zend_class_entry *scope TSRMLS_DC);
ZEND_API int zval_update_constant_no_inline_change(zval *pp, zend_class_entry *scope TSRMLS_DC);
ZEND_API int zval_update_constant_ex(zval *pp, zend_bool inline_change, zend_class_entry *scope TSRMLS_DC);
/* dedicated Zend executor functions - do not use! */
#define ZEND_VM_STACK_PAGE_SIZE ((16 * 1024) - 16)
#define ZEND_VM_STACK_PAGE_SIZE (16 * 1024) /* should be a power of 2 */
struct _zend_vm_stack {
void **top;
void **end;
zval *top;
zval *end;
zend_vm_stack prev;
};
#define ZEND_VM_STACK_ELEMETS(stack) \
((void**)(((char*)(stack)) + ZEND_MM_ALIGNED_SIZE(sizeof(struct _zend_vm_stack))))
#define ZEND_VM_STACK_HEADER_SLOT \
((ZEND_MM_ALIGNED_SIZE(sizeof(struct _zend_vm_stack)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval)) - 1) / ZEND_MM_ALIGNED_SIZE(sizeof(zval)))
#define ZEND_VM_STACK_GROW_IF_NEEDED(count) \
do { \
if (UNEXPECTED((count) > \
EG(argument_stack)->end - EG(argument_stack)->top)) { \
zend_vm_stack_extend((count) TSRMLS_CC); \
} \
#define ZEND_VM_STACK_ELEMETS(stack) \
(((zval*)(stack)) + ZEND_VM_STACK_HEADER_SLOT)
#define ZEND_VM_STACK_GROW_IF_NEEDED(count) \
do { \
if (UNEXPECTED(((count) * ZEND_MM_ALIGNED_SIZE(sizeof(zval))) > \
(size_t)(((char*)EG(argument_stack)->end) - \
((char*)EG(argument_stack)->top)))) { \
zend_vm_stack_extend((count) TSRMLS_CC); \
} \
} while (0)
static zend_always_inline zend_vm_stack zend_vm_stack_new_page(int count) {
zend_vm_stack page = (zend_vm_stack)emalloc(ZEND_MM_ALIGNED_SIZE(sizeof(*page)) + sizeof(void*) * count);
zend_vm_stack page = (zend_vm_stack)emalloc(count * ZEND_MM_ALIGNED_SIZE(sizeof(zval)));
page->top = ZEND_VM_STACK_ELEMETS(page);
page->end = page->top + count;
page->end = (zval*)page + count;
page->prev = NULL;
return page;
}
@@ -195,6 +182,7 @@ static zend_always_inline zend_vm_stack zend_vm_stack_new_page(int count) {
static zend_always_inline void zend_vm_stack_init(TSRMLS_D)
{
EG(argument_stack) = zend_vm_stack_new_page(ZEND_VM_STACK_PAGE_SIZE);
EG(argument_stack)->top++;
}
static zend_always_inline void zend_vm_stack_destroy(TSRMLS_D)
@@ -210,141 +198,77 @@ static zend_always_inline void zend_vm_stack_destroy(TSRMLS_D)
static zend_always_inline void zend_vm_stack_extend(int count TSRMLS_DC)
{
zend_vm_stack p = zend_vm_stack_new_page(count >= ZEND_VM_STACK_PAGE_SIZE ? count : ZEND_VM_STACK_PAGE_SIZE);
int size = count * ZEND_MM_ALIGNED_SIZE(sizeof(zval));
zend_vm_stack p = zend_vm_stack_new_page(
(size >= (ZEND_VM_STACK_PAGE_SIZE - ZEND_VM_STACK_HEADER_SLOT) * ZEND_MM_ALIGNED_SIZE(sizeof(zval))) ?
(size + ((ZEND_VM_STACK_HEADER_SLOT + ZEND_VM_STACK_PAGE_SIZE) * ZEND_MM_ALIGNED_SIZE(sizeof(zval))) - 1) &
~((ZEND_VM_STACK_PAGE_SIZE * ZEND_MM_ALIGNED_SIZE(sizeof(zval))) - 1) :
ZEND_VM_STACK_PAGE_SIZE);
p->prev = EG(argument_stack);
EG(argument_stack) = p;
}
static zend_always_inline void **zend_vm_stack_top(TSRMLS_D)
static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(zend_function *func, uint32_t num_args, zend_uchar flags, zend_class_entry *called_scope, zend_object *object, zend_execute_data *prev TSRMLS_DC)
{
return EG(argument_stack)->top;
}
static zend_always_inline void zend_vm_stack_push(void *ptr TSRMLS_DC)
{
*(EG(argument_stack)->top++) = ptr;
}
static zend_always_inline void *zend_vm_stack_pop(TSRMLS_D)
{
void *el = *(--EG(argument_stack)->top);
return el;
}
static zend_always_inline void *zend_vm_stack_alloc(size_t size TSRMLS_DC)
{
void *ret;
size = (size + (sizeof(void*) - 1)) / sizeof(void*);
/* the following comparison must be optimized out at compile time */
if (ZEND_MM_ALIGNMENT > sizeof(void*)) {
int extra = (ZEND_MM_ALIGNMENT - ((zend_uintptr_t)EG(argument_stack)->top & (ZEND_MM_ALIGNMENT - 1))) / sizeof(void*);
if (UNEXPECTED(size + extra + ZEND_MM_ALIGNED_SIZE(sizeof(void*)) / sizeof(void*) >
(zend_uintptr_t)(EG(argument_stack)->end - EG(argument_stack)->top))) {
zend_vm_stack_extend(size TSRMLS_CC);
} else {
void **old_top = EG(argument_stack)->top;
EG(argument_stack)->top += extra;
/* store old top on the stack */
*EG(argument_stack)->top = (void*)old_top;
EG(argument_stack)->top += ZEND_MM_ALIGNED_SIZE(sizeof(void*)) / sizeof(void*);
}
} else {
ZEND_VM_STACK_GROW_IF_NEEDED((int)size);
int used_stack = ZEND_CALL_FRAME_SLOT + num_args;
zend_execute_data *call;
if (ZEND_USER_CODE(func->type)) {
used_stack += func->op_array.last_var + func->op_array.T - MIN(func->op_array.num_args, num_args);
}
ret = (void*)EG(argument_stack)->top;
EG(argument_stack)->top += size;
return ret;
ZEND_VM_STACK_GROW_IF_NEEDED(used_stack);
call = (zend_execute_data*)EG(argument_stack)->top;
EG(argument_stack)->top += used_stack;
call->func = func;
call->num_args = 0;
call->flags = flags;
call->called_scope = called_scope;
call->object = object;
call->prev_nested_call = prev;
return call;
}
static zend_always_inline void** zend_vm_stack_frame_base(zend_execute_data *ex)
static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *call TSRMLS_DC)
{
return (void**)((char*)ex->call_slots +
ZEND_MM_ALIGNED_SIZE(sizeof(call_slot)) * ex->op_array->nested_calls);
uint32_t first_extra_arg = call->func->op_array.num_args - ((call->func->common.fn_flags & ZEND_ACC_VARIADIC) != 0);
if (UNEXPECTED(call->num_args > first_extra_arg)) {
zval *end = EX_VAR_NUM_2(call, call->func->op_array.last_var + call->func->op_array.T);
zval *p = end + (call->num_args - first_extra_arg);
do {
p--;
i_zval_ptr_dtor_nogc(p ZEND_FILE_LINE_CC TSRMLS_CC);
} while (p != end);
}
}
static zend_always_inline void zend_vm_stack_free_int(void *ptr TSRMLS_DC)
static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call TSRMLS_DC)
{
if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (void**)ptr)) {
uint32_t num_args = call->num_args;
if (num_args > 0) {
zval *end = ZEND_CALL_ARG(call, 1);
zval *p = end + num_args;
do {
p--;
i_zval_ptr_dtor_nogc(p ZEND_FILE_LINE_CC TSRMLS_CC);
} while (p != end);
}
}
static zend_always_inline void zend_vm_stack_free_call_frame(zend_execute_data *call TSRMLS_DC)
{
if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (zval*)call)) {
zend_vm_stack p = EG(argument_stack);
EG(argument_stack) = p->prev;
efree(p);
} else {
EG(argument_stack)->top = (void**)ptr;
EG(argument_stack)->top = (zval*)call;
}
}
static zend_always_inline void zend_vm_stack_free(void *ptr TSRMLS_DC)
{
if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (void**)ptr)) {
zend_vm_stack p = EG(argument_stack);
EG(argument_stack) = p->prev;
efree(p);
} else {
/* the following comparison must be optimized out at compile time */
if (ZEND_MM_ALIGNMENT > sizeof(void*)) {
ptr = (void*)(((char*)ptr) - ZEND_MM_ALIGNED_SIZE(sizeof(void*)));
EG(argument_stack)->top = *(void***)ptr;
} else {
EG(argument_stack)->top = (void**)ptr;
}
}
}
static zend_always_inline void zend_vm_stack_clear_multiple(int nested TSRMLS_DC)
{
void **p = EG(argument_stack)->top - 1;
void **end = p - (int)(zend_uintptr_t)*p;
while (p != end) {
zval *q = (zval *) *(--p);
*p = NULL;
i_zval_ptr_dtor(q ZEND_FILE_LINE_CC TSRMLS_CC);
}
if (nested) {
EG(argument_stack)->top = p;
} else {
zend_vm_stack_free_int(p TSRMLS_CC);
}
}
static zend_always_inline int zend_vm_stack_get_args_count_ex(zend_execute_data *ex)
{
if (ex) {
void **p = ex->function_state.arguments;
return (int)(zend_uintptr_t) *p;
} else {
return 0;
}
}
static zend_always_inline zval** zend_vm_stack_get_arg_ex(zend_execute_data *ex, int requested_arg)
{
void **p = ex->function_state.arguments;
int arg_count = (int)(zend_uintptr_t) *p;
if (UNEXPECTED(requested_arg > arg_count)) {
return NULL;
}
return (zval**)p - arg_count + requested_arg - 1;
}
static zend_always_inline int zend_vm_stack_get_args_count(TSRMLS_D)
{
return zend_vm_stack_get_args_count_ex(EG(current_execute_data)->prev_execute_data);
}
static zend_always_inline zval** zend_vm_stack_get_arg(int requested_arg TSRMLS_DC)
{
return zend_vm_stack_get_arg_ex(EG(current_execute_data)->prev_execute_data, requested_arg);
}
void execute_new_code(TSRMLS_D);
@@ -355,14 +279,14 @@ ZEND_API const char *zend_get_executed_filename(TSRMLS_D);
ZEND_API uint zend_get_executed_lineno(TSRMLS_D);
ZEND_API zend_bool zend_is_executing(TSRMLS_D);
ZEND_API void zend_set_timeout(long seconds, int reset_signals);
ZEND_API void zend_set_timeout(zend_long seconds, int reset_signals);
ZEND_API void zend_unset_timeout(TSRMLS_D);
ZEND_API void zend_timeout(int dummy);
ZEND_API zend_class_entry *zend_fetch_class(const char *class_name, uint class_name_len, int fetch_type TSRMLS_DC);
ZEND_API zend_class_entry *zend_fetch_class_by_name(const char *class_name, uint class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC);
ZEND_API zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type TSRMLS_DC);
ZEND_API zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *key, int fetch_type TSRMLS_DC);
void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC);
ZEND_API void zend_fetch_dimension_by_zval(zval **result, zval *container, zval *dim TSRMLS_DC);
ZEND_API void zend_fetch_dimension_by_zval(zval *result, zval *container, zval *dim TSRMLS_DC);
#ifdef ZEND_WIN32
void zend_init_timeout_thread(void);
@@ -371,17 +295,12 @@ void zend_shutdown_timeout_thread(void);
#define WM_UNREGISTER_ZEND_TIMEOUT (WM_USER+2)
#endif
#define zendi_zval_copy_ctor(p) zval_copy_ctor(&(p))
#define zendi_zval_dtor(p) zval_dtor(&(p))
#define active_opline (*EG(opline_ptr))
/* The following tries to resolve the classname of a zval of type object.
* Since it is slow it should be only used in error messages.
*/
#define Z_OBJ_CLASS_NAME_P(zval) ((zval) && Z_TYPE_P(zval) == IS_OBJECT && Z_OBJ_HT_P(zval)->get_class_entry != NULL && Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC) ? Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC)->name : "")
#define Z_OBJ_CLASS_NAME_P(obj) (((obj) && (obj)->handlers->get_class_entry != NULL && (obj)->handlers->get_class_entry) ? (obj)->handlers->get_class_entry(obj TSRMLS_CC)->name->val : "")
ZEND_API zval** zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, zend_uint var);
ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var);
#define ZEND_USER_OPCODE_CONTINUE 0 /* execute next opcode */
#define ZEND_USER_OPCODE_RETURN 1 /* exit from executor (return from function) */
@@ -396,33 +315,47 @@ ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(zend_uchar opcode);
/* former zend_execute_locks.h */
typedef struct _zend_free_op {
zval* var;
zval *var;
/* int is_var; */
} zend_free_op;
ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC);
ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC);
ZEND_API int zend_do_fcall(ZEND_OPCODE_HANDLER_ARGS);
void zend_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC);
void zend_clean_and_cache_symbol_table(zend_array *symbol_table TSRMLS_DC);
void zend_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC);
#define CACHED_PTR(num) \
EG(active_op_array)->run_time_cache[(num)]
EX(run_time_cache)[(num)]
#define CACHE_PTR(num, ptr) do { \
EG(active_op_array)->run_time_cache[(num)] = (ptr); \
EX(run_time_cache)[(num)] = (ptr); \
} while (0)
#define CACHED_POLYMORPHIC_PTR(num, ce) \
((EG(active_op_array)->run_time_cache[(num)] == (ce)) ? \
EG(active_op_array)->run_time_cache[(num) + 1] : \
((EX(run_time_cache)[(num)] == (ce)) ? \
EX(run_time_cache)[(num) + 1] : \
NULL)
#define CACHE_POLYMORPHIC_PTR(num, ce, ptr) do { \
EG(active_op_array)->run_time_cache[(num)] = (ce); \
EG(active_op_array)->run_time_cache[(num) + 1] = (ptr); \
EX(run_time_cache)[(num)] = (ce); \
EX(run_time_cache)[(num) + 1] = (ptr); \
} while (0)
#define CACHED_PTR_EX(slot) \
(slot)[0]
#define CACHE_PTR_EX(slot, ptr) do { \
(slot)[0] = (ptr); \
} while (0)
#define CACHED_POLYMORPHIC_PTR_EX(slot, ce) \
(((slot)[0] == (ce)) ? (slot)[1] : NULL)
#define CACHE_POLYMORPHIC_PTR_EX(slot, ce, ptr) do { \
(slot)[0] = (ce); \
(slot)[1] = (ptr); \
} while (0)
END_EXTERN_C()
+599 -534
View File
File diff suppressed because it is too large. Load diff
+5 -7
View File
@@ -24,7 +24,7 @@
ZEND_API zend_llist zend_extensions;
static int last_resource_number;
int zend_load_extension(const char *path)
int zend_load_extension(const char *path TSRMLS_DC)
{
#if ZEND_EXTENSIONS_SUPPORT
DL_HANDLE handle;
@@ -107,7 +107,7 @@ int zend_load_extension(const char *path)
return FAILURE;
}
return zend_register_extension(new_extension, handle);
return zend_register_extension(new_extension, handle TSRMLS_CC);
#else
fprintf(stderr, "Extensions are not supported on this platform.\n");
/* See http://support.microsoft.com/kb/190351 */
@@ -119,7 +119,7 @@ int zend_load_extension(const char *path)
}
int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle TSRMLS_DC)
{
#if ZEND_EXTENSIONS_SUPPORT
zend_extension extension;
@@ -127,7 +127,7 @@ int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
extension = *new_extension;
extension.handle = handle;
zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension);
zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension TSRMLS_CC);
zend_llist_add_element(&zend_extensions, &extension);
@@ -208,10 +208,8 @@ static void zend_extension_message_dispatcher(const zend_extension *extension, i
}
ZEND_API void zend_extension_dispatch_message(int message, void *arg)
ZEND_API void zend_extension_dispatch_message(int message, void *arg TSRMLS_DC)
{
TSRMLS_FETCH();
zend_llist_apply_with_arguments(&zend_extensions, (llist_apply_with_args_func_t) zend_extension_message_dispatcher TSRMLS_CC, 2, message, arg);
}
+4 -4
View File
@@ -28,7 +28,7 @@
/* The first number is the engine version and the rest is the date.
* This way engine 2/3 API no. is always greater than engine 1 API no..
*/
#define ZEND_EXTENSION_API_NO 220131226
#define ZEND_EXTENSION_API_NO 220140815
typedef struct _zend_extension_version_info {
int zend_extension_api_no;
@@ -94,7 +94,7 @@ struct _zend_extension {
BEGIN_EXTERN_C()
ZEND_API int zend_get_resource_handle(zend_extension *extension);
ZEND_API void zend_extension_dispatch_message(int message, void *arg);
ZEND_API void zend_extension_dispatch_message(int message, void *arg TSRMLS_DC);
END_EXTERN_C()
#define ZEND_EXTMSG_NEW_EXTENSION 1
@@ -117,8 +117,8 @@ int zend_startup_extensions(void);
void zend_shutdown_extensions(TSRMLS_D);
BEGIN_EXTERN_C()
ZEND_API int zend_load_extension(const char *path);
ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle);
ZEND_API int zend_load_extension(const char *path TSRMLS_DC);
ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle TSRMLS_DC);
ZEND_API zend_extension *zend_get_extension(const char *extension_name);
END_EXTERN_C()
+531 -561
View File
File diff suppressed because it is too large. Load diff
+42 -131
View File
@@ -40,62 +40,46 @@
# define GC_BENCH_PEAK(peak, counter)
#endif
#define GC_COLOR 0x03
#define GC_COLOR 0xc000
#define GC_BLACK 0x00
#define GC_WHITE 0x01
#define GC_GREY 0x02
#define GC_PURPLE 0x03
#define GC_BLACK 0x0000
#define GC_WHITE 0x8000
#define GC_GREY 0x4000
#define GC_PURPLE 0xc000
#define GC_ADDRESS(v) \
((gc_root_buffer*)(((zend_uintptr_t)(v)) & ~GC_COLOR))
((v) & ~GC_COLOR)
#define GC_SET_ADDRESS(v, a) \
(v) = ((gc_root_buffer*)((((zend_uintptr_t)(v)) & GC_COLOR) | ((zend_uintptr_t)(a))))
do {(v) = ((v) & GC_COLOR) | (a);} while (0)
#define GC_GET_COLOR(v) \
(((zend_uintptr_t)(v)) & GC_COLOR)
#define GC_SET_COLOR(v, c) \
(v) = ((gc_root_buffer*)((((zend_uintptr_t)(v)) & ~GC_COLOR) | (c)))
do {(v) = ((v) & ~GC_COLOR) | (c);} while (0)
#define GC_SET_BLACK(v) \
(v) = ((gc_root_buffer*)(((zend_uintptr_t)(v)) & ~GC_COLOR))
do {(v) = (v) & ~GC_COLOR;} while (0)
#define GC_SET_PURPLE(v) \
(v) = ((gc_root_buffer*)(((zend_uintptr_t)(v)) | GC_PURPLE))
do {(v) = (v) | GC_COLOR;} while (0)
#define GC_ZVAL_INIT(z) \
((zval_gc_info*)(z))->u.buffered = NULL
#define GC_ZVAL_ADDRESS(v) \
GC_ADDRESS(((zval_gc_info*)(v))->u.buffered)
GC_ADDRESS(Z_GC_INFO_P(v))
#define GC_ZVAL_SET_ADDRESS(v, a) \
GC_SET_ADDRESS(((zval_gc_info*)(v))->u.buffered, (a))
GC_SET_ADDRESS(Z_GC_INFO_P(v), (a))
#define GC_ZVAL_GET_COLOR(v) \
GC_GET_COLOR(((zval_gc_info*)(v))->u.buffered)
GC_GET_COLOR(Z_GC_INFO_P(v))
#define GC_ZVAL_SET_COLOR(v, c) \
GC_SET_COLOR(((zval_gc_info*)(v))->u.buffered, (c))
GC_SET_COLOR(Z_GC_INFO_P(v), (c))
#define GC_ZVAL_SET_BLACK(v) \
GC_SET_BLACK(((zval_gc_info*)(v))->u.buffered)
GC_SET_BLACK(Z_GC_INFO_P(v))
#define GC_ZVAL_SET_PURPLE(v) \
GC_SET_PURPLE(((zval_gc_info*)(v))->u.buffered)
#define GC_OBJ_INIT(z) \
(z)->buffered = NULL
GC_SET_PURPLE(Z_GC_INFO_P(v))
typedef struct _gc_root_buffer {
struct _gc_root_buffer *prev; /* double-linked list */
struct _gc_root_buffer *next;
zend_object_handle handle; /* must be 0 for zval */
union {
zval *pz;
const zend_object_handlers *handlers;
} u;
zend_refcounted *ref;
struct _gc_root_buffer *next; /* double-linked list */
struct _gc_root_buffer *prev;
uint32_t refcount;
} gc_root_buffer;
typedef struct _zval_gc_info {
zval z;
union {
gc_root_buffer *buffered;
struct _zval_gc_info *next;
} u;
} zval_gc_info;
typedef struct _zend_gc_globals {
zend_bool gc_enabled;
zend_bool gc_active;
@@ -106,24 +90,19 @@ typedef struct _zend_gc_globals {
gc_root_buffer *first_unused; /* pointer to first unused buffer */
gc_root_buffer *last_unused; /* pointer to last unused buffer */
zval_gc_info *zval_to_free; /* temporary list of zvals to free */
zval_gc_info *free_list;
zval_gc_info *next_to_free;
gc_root_buffer to_free; /* list to free */
gc_root_buffer *next_to_free;
zend_uint gc_runs;
zend_uint collected;
uint32_t gc_runs;
uint32_t collected;
#if GC_BENCH
zend_uint root_buf_length;
zend_uint root_buf_peak;
zend_uint zval_possible_root;
zend_uint zobj_possible_root;
zend_uint zval_buffered;
zend_uint zobj_buffered;
zend_uint zval_remove_from_buffer;
zend_uint zobj_remove_from_buffer;
zend_uint zval_marked_grey;
zend_uint zobj_marked_grey;
uint32_t root_buf_length;
uint32_t root_buf_peak;
uint32_t zval_possible_root;
uint32_t zval_buffered;
uint32_t zval_remove_from_buffer;
uint32_t zval_marked_grey;
#endif
} zend_gc_globals;
@@ -140,9 +119,8 @@ extern ZEND_API zend_gc_globals gc_globals;
BEGIN_EXTERN_C()
ZEND_API int gc_collect_cycles(TSRMLS_D);
ZEND_API void gc_zval_possible_root(zval *zv TSRMLS_DC);
ZEND_API void gc_zobj_possible_root(zval *zv TSRMLS_DC);
ZEND_API void gc_remove_zval_from_buffer(zval *zv TSRMLS_DC);
ZEND_API void gc_possible_root(zend_refcounted *ref TSRMLS_DC);
ZEND_API void gc_remove_from_buffer(zend_refcounted *ref TSRMLS_DC);
ZEND_API void gc_globals_ctor(TSRMLS_D);
ZEND_API void gc_globals_dtor(TSRMLS_D);
ZEND_API void gc_init(TSRMLS_D);
@@ -150,90 +128,23 @@ ZEND_API void gc_reset(TSRMLS_D);
END_EXTERN_C()
#define GC_ZVAL_CHECK_POSSIBLE_ROOT(z) \
gc_zval_check_possible_root((z) TSRMLS_CC)
gc_check_possible_root((z) TSRMLS_CC)
#define GC_REMOVE_FROM_BUFFER(current) \
gc_remove_from_buffer((current) TSRMLS_CC)
#define GC_REMOVE_ZVAL_FROM_BUFFER(z) \
if (GC_ADDRESS(((zval_gc_info*)z)->u.buffered)) { \
gc_remove_zval_from_buffer(z TSRMLS_CC); \
}
#define GC_ZOBJ_CHECK_POSSIBLE_ROOT(zobject) \
do { \
if (EXPECTED(EG(objects_store).object_buckets != NULL) && \
EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zobject)].valid) { \
gc_zobj_possible_root(zobject TSRMLS_CC); \
} \
#define GC_REMOVE_FROM_BUFFER(p) do { \
zend_refcounted *_p = (zend_refcounted*)(p); \
if (GC_ADDRESS(GC_INFO(_p))) { \
gc_remove_from_buffer(_p TSRMLS_CC); \
} \
} while (0)
#define GC_REMOVE_ZOBJ_FROM_BUFFER(obj) \
do { \
if (GC_ADDRESS((obj)->buffered) && !GC_G(gc_active)) { \
GC_BENCH_INC(zobj_remove_from_buffer); \
GC_REMOVE_FROM_BUFFER(GC_ADDRESS((obj)->buffered)); \
(obj)->buffered = NULL; \
} \
} while (0)
static zend_always_inline void gc_zval_check_possible_root(zval *z TSRMLS_DC)
static zend_always_inline void gc_check_possible_root(zval *z TSRMLS_DC)
{
if (z->type == IS_ARRAY || z->type == IS_OBJECT) {
gc_zval_possible_root(z TSRMLS_CC);
ZVAL_DEREF(z);
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
gc_possible_root(Z_COUNTED_P(z) TSRMLS_CC);
}
}
static zend_always_inline void gc_remove_from_buffer(gc_root_buffer *root TSRMLS_DC)
{
root->next->prev = root->prev;
root->prev->next = root->next;
root->prev = GC_G(unused);
GC_G(unused) = root;
GC_BENCH_DEC(root_buf_length);
}
#define ALLOC_PERMANENT_ZVAL(z) \
do { \
(z) = (zval*)malloc(sizeof(zval_gc_info)); \
GC_ZVAL_INIT(z); \
} while (0)
/* The following macros override macros from zend_alloc.h */
#undef ALLOC_ZVAL
#define ALLOC_ZVAL(z) \
do { \
(z) = (zval*)emalloc(sizeof(zval_gc_info)); \
GC_ZVAL_INIT(z); \
} while (0)
#undef FREE_ZVAL
#define FREE_ZVAL(z) \
do { \
GC_REMOVE_ZVAL_FROM_BUFFER(z); \
efree(z); \
} while (0)
#undef ALLOC_ZVAL_REL
#define ALLOC_ZVAL_REL(z) \
do { \
(z) = (zval*)emalloc_rel(sizeof(zval_gc_info)); \
GC_ZVAL_INIT(z); \
} while (0)
#undef FREE_ZVAL_REL
#define FREE_ZVAL_REL(z) \
do { \
GC_REMOVE_ZVAL_FROM_BUFFER(z); \
efree_rel(z); \
} while (0)
#define FREE_ZVAL_EX(z) \
efree(z)
#define FREE_ZVAL_REL_EX(z) \
efree_rel(z)
#endif /* ZEND_GC_H */
/*
+117 -178
View File
@@ -27,15 +27,15 @@
ZEND_API zend_class_entry *zend_ce_generator;
static zend_object_handlers zend_generator_handlers;
static zend_object_value zend_generator_create(zend_class_entry *class_type TSRMLS_DC);
static zend_object *zend_generator_create(zend_class_entry *class_type TSRMLS_DC);
static void zend_generator_cleanup_unfinished_execution(zend_generator *generator TSRMLS_DC) /* {{{ */
{
zend_execute_data *execute_data = generator->execute_data;
zend_op_array *op_array = execute_data->op_array;
zend_op_array *op_array = &execute_data->func->op_array;
if (generator->send_target) {
Z_DELREF_PP(generator->send_target);
if (Z_REFCOUNTED_P(generator->send_target)) Z_DELREF_P(generator->send_target);
generator->send_target = NULL;
}
@@ -44,7 +44,7 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato
{
/* -1 required because we want the last run opcode, not the
* next to-be-run one. */
zend_uint op_num = execute_data->opline - op_array->opcodes - 1;
uint32_t op_num = execute_data->opline - op_array->opcodes - 1;
int i;
for (i = 0; i < op_array->last_brk_cont; ++i) {
@@ -60,14 +60,14 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato
switch (brk_opline->opcode) {
case ZEND_SWITCH_FREE:
{
temp_variable *var = EX_TMP_VAR(execute_data, brk_opline->op1.var);
zval_ptr_dtor(&var->var.ptr);
zval *var = EX_VAR_2(execute_data, brk_opline->op1.var);
zval_ptr_dtor(var);
}
break;
case ZEND_FREE:
{
temp_variable *var = EX_TMP_VAR(execute_data, brk_opline->op1.var);
zval_dtor(&var->tmp_var);
zval *var = EX_VAR_2(execute_data, brk_opline->op1.var);
zval_dtor(var);
}
break;
}
@@ -75,42 +75,32 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato
}
}
/* Clear any backed up stack arguments */
{
void **ptr = generator->stack->top - 1;
void **end = zend_vm_stack_frame_base(execute_data);
for (; ptr >= end; --ptr) {
zval_ptr_dtor((zval **) ptr);
}
}
/* If yield was used as a function argument there may be active
* method calls those objects need to be freed */
while (execute_data->call >= execute_data->call_slots) {
while (execute_data->call) {
if (execute_data->call->object) {
zval_ptr_dtor(&execute_data->call->object);
OBJ_RELEASE(execute_data->call->object);
}
execute_data->call--;
execute_data->call = execute_data->call->prev_nested_call;
}
}
/* }}} */
ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution TSRMLS_DC) /* {{{ */
{
if (generator->value) {
if (Z_TYPE(generator->value) != IS_UNDEF) {
zval_ptr_dtor(&generator->value);
generator->value = NULL;
ZVAL_UNDEF(&generator->value);
}
if (generator->key) {
if (Z_TYPE(generator->key) != IS_UNDEF) {
zval_ptr_dtor(&generator->key);
generator->key = NULL;
ZVAL_UNDEF(&generator->key);
}
if (generator->execute_data) {
zend_execute_data *execute_data = generator->execute_data;
zend_op_array *op_array = execute_data->op_array;
zend_op_array *op_array = &execute_data->func->op_array;
if (!execute_data->symbol_table) {
zend_free_compiled_variables(execute_data TSRMLS_CC);
@@ -118,8 +108,8 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
zend_clean_and_cache_symbol_table(execute_data->symbol_table TSRMLS_CC);
}
if (execute_data->current_this) {
zval_ptr_dtor(&execute_data->current_this);
if (execute_data->object) {
OBJ_RELEASE(execute_data->object);
}
/* A fatal error / die occurred during the generator execution. Trying to clean
@@ -129,23 +119,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
return;
}
/* We have added an additional stack frame in prev_execute_data, so we
* have to free it. It also contains the arguments passed to the
* generator (for func_get_args) so those have to be freed too. */
{
zend_execute_data *prev_execute_data = execute_data->prev_execute_data;
void **arguments = prev_execute_data->function_state.arguments;
if (arguments) {
int arguments_count = (int) (zend_uintptr_t) *arguments;
zval **arguments_start = (zval **) (arguments - arguments_count);
int i;
for (i = 0; i < arguments_count; ++i) {
zval_ptr_dtor(arguments_start + i);
}
}
}
zend_vm_stack_free_extra_args(generator->execute_data TSRMLS_CC);
/* Some cleanups are only necessary if the generator was closued
* before it could finish execution (reach a return statement). */
@@ -165,24 +139,25 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
}
/* }}} */
static void zend_generator_dtor_storage(zend_generator *generator, zend_object_handle handle TSRMLS_DC) /* {{{ */
static void zend_generator_dtor_storage(zend_object *object TSRMLS_DC) /* {{{ */
{
zend_generator *generator = (zend_generator*) object;
zend_execute_data *ex = generator->execute_data;
zend_uint op_num, finally_op_num;
uint32_t op_num, finally_op_num;
int i;
if (!ex || !ex->op_array->has_finally_block) {
if (!ex || !ex->func->op_array.has_finally_block) {
return;
}
/* -1 required because we want the last run opcode, not the
* next to-be-run one. */
op_num = ex->opline - ex->op_array->opcodes - 1;
op_num = ex->opline - ex->func->op_array.opcodes - 1;
/* Find next finally block */
finally_op_num = 0;
for (i = 0; i < ex->op_array->last_try_catch; i++) {
zend_try_catch_element *try_catch = &ex->op_array->try_catch_array[i];
for (i = 0; i < ex->func->op_array.last_try_catch; i++) {
zend_try_catch_element *try_catch = &ex->func->op_array.try_catch_array[i];
if (op_num < try_catch->try_op) {
break;
@@ -196,7 +171,7 @@ static void zend_generator_dtor_storage(zend_generator *generator, zend_object_h
/* If a finally block was found we jump directly to it and
* resume the generator. */
if (finally_op_num) {
ex->opline = &ex->op_array->opcodes[finally_op_num];
ex->opline = &ex->func->op_array.opcodes[finally_op_num];
ex->fast_ret = NULL;
generator->flags |= ZEND_GENERATOR_FORCED_CLOSE;
zend_generator_resume(generator TSRMLS_CC);
@@ -204,19 +179,23 @@ static void zend_generator_dtor_storage(zend_generator *generator, zend_object_h
}
/* }}} */
static void zend_generator_free_storage(zend_generator *generator TSRMLS_DC) /* {{{ */
static void zend_generator_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
{
zend_generator *generator = (zend_generator*) object;
zend_generator_close(generator, 0 TSRMLS_CC);
zend_object_std_dtor(&generator->std TSRMLS_CC);
efree(generator);
if (generator->iterator) {
zend_iterator_dtor(generator->iterator TSRMLS_CC);
}
}
/* }}} */
static zend_object_value zend_generator_create(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
static zend_object *zend_generator_create(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
{
zend_generator *generator;
zend_object_value object;
generator = emalloc(sizeof(zend_generator));
memset(generator, 0, sizeof(zend_generator));
@@ -225,37 +204,28 @@ static zend_object_value zend_generator_create(zend_class_entry *class_type TSRM
generator->largest_used_integer_key = -1;
zend_object_std_init(&generator->std, class_type TSRMLS_CC);
generator->std.handlers = &zend_generator_handlers;
object.handle = zend_objects_store_put(generator,
(zend_objects_store_dtor_t) zend_generator_dtor_storage,
(zend_objects_free_object_storage_t) zend_generator_free_storage,
NULL TSRMLS_CC
);
object.handlers = &zend_generator_handlers;
return object;
return (zend_object*)generator;
}
/* }}} */
static void copy_closure_static_var(zval **var TSRMLS_DC, int num_args, va_list args, zend_hash_key *key) /* {{{ */
static int copy_closure_static_var(zval *var TSRMLS_DC, int num_args, va_list args, zend_hash_key *key) /* {{{ */
{
HashTable *target = va_arg(args, HashTable *);
SEPARATE_ZVAL_TO_MAKE_IS_REF(var);
Z_ADDREF_PP(var);
zend_hash_quick_update(target, key->arKey, key->nKeyLength, key->h, var, sizeof(zval *), NULL);
ZVAL_MAKE_REF(var);
Z_ADDREF_P(var);
zend_hash_update(target, key->key, var);
return 0;
}
/* }}} */
/* Requires globals EG(scope), EG(current_scope), EG(This),
* EG(active_symbol_table) and EG(current_execute_data). */
ZEND_API zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC) /* {{{ */
/* Requires globals EG(scope), EG(This) and EG(current_execute_data). */
ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array *op_array, zval *return_value TSRMLS_DC) /* {{{ */
{
zval *return_value;
zend_generator *generator;
zend_execute_data *current_execute_data;
zend_op **opline_ptr;
HashTable *current_symbol_table;
zend_execute_data *execute_data;
zend_vm_stack current_stack = EG(argument_stack);
@@ -275,8 +245,8 @@ ZEND_API zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC) /*
);
zend_hash_apply_with_arguments(
op_array->static_variables TSRMLS_CC,
(apply_func_args_t) copy_closure_static_var,
1, op_array_copy->static_variables
copy_closure_static_var, 1,
op_array_copy->static_variables
);
}
@@ -284,41 +254,30 @@ ZEND_API zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC) /*
}
/* Create new execution context. We have to back up and restore
* EG(current_execute_data), EG(opline_ptr) and EG(active_symbol_table)
* here because the function modifies or uses them */
* EG(current_execute_data) here. */
current_execute_data = EG(current_execute_data);
opline_ptr = EG(opline_ptr);
current_symbol_table = EG(active_symbol_table);
EG(active_symbol_table) = NULL;
execute_data = zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC);
EG(active_symbol_table) = current_symbol_table;
execute_data = zend_create_generator_execute_data(call, op_array, return_value TSRMLS_CC);
EG(current_execute_data) = current_execute_data;
EG(opline_ptr) = opline_ptr;
ALLOC_INIT_ZVAL(return_value);
object_init_ex(return_value, zend_ce_generator);
if (EG(This)) {
Z_ADDREF_P(EG(This));
if (Z_OBJ(EG(This))) {
Z_ADDREF(EG(This));
}
/* Back up executor globals. */
execute_data->current_scope = EG(scope);
execute_data->current_called_scope = EG(called_scope);
execute_data->symbol_table = EG(active_symbol_table);
execute_data->current_this = EG(This);
/* Save execution context in generator object. */
generator = (zend_generator *) zend_object_store_get_object(return_value TSRMLS_CC);
generator = (zend_generator *) Z_OBJ_P(return_value);
execute_data->prev_execute_data = NULL;
generator->execute_data = execute_data;
generator->stack = EG(argument_stack);
EG(argument_stack) = current_stack;
return return_value;
/* EX(return_value) keeps pointer to zend_object (not a real zval) */
execute_data->return_value = (zval*)generator;
}
/* }}} */
static zend_function *zend_generator_get_constructor(zval *object TSRMLS_DC) /* {{{ */
static zend_function *zend_generator_get_constructor(zend_object *object TSRMLS_DC) /* {{{ */
{
zend_error(E_RECOVERABLE_ERROR, "The \"Generator\" class is reserved for internal use and cannot be manually instantiated");
@@ -342,52 +301,39 @@ ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{
{
/* Backup executor globals */
zval **original_return_value_ptr_ptr = EG(return_value_ptr_ptr);
zend_execute_data *original_execute_data = EG(current_execute_data);
zend_op **original_opline_ptr = EG(opline_ptr);
zend_op_array *original_active_op_array = EG(active_op_array);
HashTable *original_active_symbol_table = EG(active_symbol_table);
zval *original_This = EG(This);
zend_object *original_This;
zend_class_entry *original_scope = EG(scope);
zend_class_entry *original_called_scope = EG(called_scope);
zend_vm_stack original_stack = EG(argument_stack);
/* We (mis)use the return_value_ptr_ptr to provide the generator object
* to the executor, so YIELD will be able to set the yielded value */
EG(return_value_ptr_ptr) = (zval **) generator;
original_This = Z_OBJ(EG(This));
/* Set executor globals */
EG(current_execute_data) = generator->execute_data;
EG(opline_ptr) = &generator->execute_data->opline;
EG(active_op_array) = generator->execute_data->op_array;
EG(active_symbol_table) = generator->execute_data->symbol_table;
EG(This) = generator->execute_data->current_this;
EG(scope) = generator->execute_data->current_scope;
EG(called_scope) = generator->execute_data->current_called_scope;
Z_OBJ(EG(This)) = generator->execute_data->object;
EG(scope) = generator->execute_data->scope;
EG(argument_stack) = generator->stack;
/* We want the backtrace to look as if the generator function was
* called from whatever method we are current running (e.g. next()).
* The first prev_execute_data contains an additional stack frame,
* which makes the generator function show up in the backtrace and
* makes the arguments available to func_get_args(). So we have to
* set the prev_execute_data of that prev_execute_data :) */
generator->execute_data->prev_execute_data->prev_execute_data = original_execute_data;
* So we have to link generator call frame with caller call frames */
generator->execute_data->prev_execute_data = original_execute_data;
/* Resume execution */
generator->flags |= ZEND_GENERATOR_CURRENTLY_RUNNING;
zend_execute_ex(generator->execute_data TSRMLS_CC);
generator->flags &= ~ZEND_GENERATOR_CURRENTLY_RUNNING;
/* Unlink generator call_frame from the caller */
if (generator->execute_data) {
generator->execute_data->prev_execute_data = NULL;
}
/* Restore executor globals */
EG(return_value_ptr_ptr) = original_return_value_ptr_ptr;
EG(current_execute_data) = original_execute_data;
EG(opline_ptr) = original_opline_ptr;
EG(active_op_array) = original_active_op_array;
EG(active_symbol_table) = original_active_symbol_table;
EG(This) = original_This;
Z_OBJ(EG(This)) = original_This;
EG(scope) = original_scope;
EG(called_scope) = original_called_scope;
EG(argument_stack) = original_stack;
/* If an exception was thrown in the generator we have to internally
@@ -401,7 +347,7 @@ ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{
static void zend_generator_ensure_initialized(zend_generator *generator TSRMLS_DC) /* {{{ */
{
if (generator->execute_data && !generator->value) {
if (generator->execute_data && Z_TYPE(generator->value) == IS_UNDEF) {
zend_generator_resume(generator TSRMLS_CC);
generator->flags |= ZEND_GENERATOR_AT_FIRST_YIELD;
}
@@ -428,7 +374,7 @@ ZEND_METHOD(Generator, rewind)
return;
}
generator = (zend_generator *) zend_object_store_get_object(getThis() TSRMLS_CC);
generator = (zend_generator *) Z_OBJ_P(getThis());
zend_generator_rewind(generator TSRMLS_CC);
}
@@ -444,11 +390,11 @@ ZEND_METHOD(Generator, valid)
return;
}
generator = (zend_generator *) zend_object_store_get_object(getThis() TSRMLS_CC);
generator = (zend_generator *) Z_OBJ_P(getThis());
zend_generator_ensure_initialized(generator TSRMLS_CC);
RETURN_BOOL(generator->value != NULL);
RETURN_BOOL(Z_TYPE(generator->value) != IS_UNDEF);
}
/* }}} */
@@ -462,12 +408,12 @@ ZEND_METHOD(Generator, current)
return;
}
generator = (zend_generator *) zend_object_store_get_object(getThis() TSRMLS_CC);
generator = (zend_generator *) Z_OBJ_P(getThis());
zend_generator_ensure_initialized(generator TSRMLS_CC);
if (generator->value) {
RETURN_ZVAL_FAST(generator->value);
if (Z_TYPE(generator->value) != IS_UNDEF) {
RETURN_ZVAL_FAST(&generator->value);
}
}
/* }}} */
@@ -482,12 +428,12 @@ ZEND_METHOD(Generator, key)
return;
}
generator = (zend_generator *) zend_object_store_get_object(getThis() TSRMLS_CC);
generator = (zend_generator *) Z_OBJ_P(getThis());
zend_generator_ensure_initialized(generator TSRMLS_CC);
if (generator->key) {
RETURN_ZVAL_FAST(generator->key);
if (Z_TYPE(generator->key) != IS_UNDEF) {
RETURN_ZVAL_FAST(&generator->key);
}
}
/* }}} */
@@ -502,7 +448,7 @@ ZEND_METHOD(Generator, next)
return;
}
generator = (zend_generator *) zend_object_store_get_object(getThis() TSRMLS_CC);
generator = (zend_generator *) Z_OBJ_P(getThis());
zend_generator_ensure_initialized(generator TSRMLS_CC);
@@ -521,7 +467,7 @@ ZEND_METHOD(Generator, send)
return;
}
generator = (zend_generator *) zend_object_store_get_object(getThis() TSRMLS_CC);
generator = (zend_generator *) Z_OBJ_P(getThis());
zend_generator_ensure_initialized(generator TSRMLS_CC);
@@ -532,15 +478,14 @@ ZEND_METHOD(Generator, send)
/* Put sent value in the target VAR slot, if it is used */
if (generator->send_target) {
Z_DELREF_PP(generator->send_target);
Z_ADDREF_P(value);
*generator->send_target = value;
if (Z_REFCOUNTED_P(generator->send_target)) Z_DELREF_P(generator->send_target);
ZVAL_COPY(generator->send_target, value);
}
zend_generator_resume(generator TSRMLS_CC);
if (generator->value) {
RETURN_ZVAL_FAST(generator->value);
if (Z_TYPE(generator->value) != IS_UNDEF) {
RETURN_ZVAL_FAST(&generator->value);
}
}
/* }}} */
@@ -549,17 +494,16 @@ ZEND_METHOD(Generator, send)
* Throws an exception into the generator */
ZEND_METHOD(Generator, throw)
{
zval *exception, *exception_copy;
zval *exception, exception_copy;
zend_generator *generator;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &exception) == FAILURE) {
return;
}
ALLOC_ZVAL(exception_copy);
MAKE_COPY_ZVAL(&exception, exception_copy);
ZVAL_DUP(&exception_copy, exception);
generator = (zend_generator *) zend_object_store_get_object(getThis() TSRMLS_CC);
generator = (zend_generator *) Z_OBJ_P(getThis());
zend_generator_ensure_initialized(generator TSRMLS_CC);
@@ -568,19 +512,19 @@ ZEND_METHOD(Generator, throw)
zend_execute_data *current_execute_data = EG(current_execute_data);
EG(current_execute_data) = generator->execute_data;
zend_throw_exception_object(exception_copy TSRMLS_CC);
zend_throw_exception_object(&exception_copy TSRMLS_CC);
EG(current_execute_data) = current_execute_data;
zend_generator_resume(generator TSRMLS_CC);
if (generator->value) {
RETURN_ZVAL_FAST(generator->value);
if (Z_TYPE(generator->value) != IS_UNDEF) {
RETURN_ZVAL_FAST(&generator->value);
}
} else {
/* If the generator is already closed throw the exception in the
* current context */
zend_throw_exception_object(exception_copy TSRMLS_CC);
zend_throw_exception_object(&exception_copy TSRMLS_CC);
}
}
/* }}} */
@@ -605,44 +549,41 @@ ZEND_METHOD(Generator, __wakeup)
static void zend_generator_iterator_dtor(zend_object_iterator *iterator TSRMLS_DC) /* {{{ */
{
zval *object = ((zend_generator_iterator *) iterator)->object;
zval_ptr_dtor(&object);
zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
generator->iterator = NULL;
zval_ptr_dtor(&iterator->data);
zend_iterator_dtor(iterator TSRMLS_CC);
}
/* }}} */
static int zend_generator_iterator_valid(zend_object_iterator *iterator TSRMLS_DC) /* {{{ */
{
zend_generator *generator = (zend_generator *) iterator->data;
zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
zend_generator_ensure_initialized(generator TSRMLS_CC);
return generator->value != NULL ? SUCCESS : FAILURE;
return Z_TYPE(generator->value) != IS_UNDEF ? SUCCESS : FAILURE;
}
/* }}} */
static void zend_generator_iterator_get_data(zend_object_iterator *iterator, zval ***data TSRMLS_DC) /* {{{ */
static zval *zend_generator_iterator_get_data(zend_object_iterator *iterator TSRMLS_DC) /* {{{ */
{
zend_generator *generator = (zend_generator *) iterator->data;
zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
zend_generator_ensure_initialized(generator TSRMLS_CC);
if (generator->value) {
*data = &generator->value;
} else {
*data = NULL;
}
return &generator->value;
}
/* }}} */
static void zend_generator_iterator_get_key(zend_object_iterator *iterator, zval *key TSRMLS_DC) /* {{{ */
{
zend_generator *generator = (zend_generator *) iterator->data;
zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
zend_generator_ensure_initialized(generator TSRMLS_CC);
if (generator->key) {
ZVAL_ZVAL(key, generator->key, 1, 0);
if (Z_TYPE(generator->key) != IS_UNDEF) {
ZVAL_ZVAL(key, &generator->key, 1, 0);
} else {
ZVAL_NULL(key);
}
@@ -651,7 +592,7 @@ static void zend_generator_iterator_get_key(zend_object_iterator *iterator, zval
static void zend_generator_iterator_move_forward(zend_object_iterator *iterator TSRMLS_DC) /* {{{ */
{
zend_generator *generator = (zend_generator *) iterator->data;
zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
zend_generator_ensure_initialized(generator TSRMLS_CC);
@@ -661,7 +602,7 @@ static void zend_generator_iterator_move_forward(zend_object_iterator *iterator
static void zend_generator_iterator_rewind(zend_object_iterator *iterator TSRMLS_DC) /* {{{ */
{
zend_generator *generator = (zend_generator *) iterator->data;
zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data);
zend_generator_rewind(generator TSRMLS_CC);
}
@@ -678,31 +619,27 @@ static zend_object_iterator_funcs zend_generator_iterator_functions = {
zend_object_iterator *zend_generator_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
{
zend_generator_iterator *iterator;
zend_generator *generator;
generator = (zend_generator *) zend_object_store_get_object(object TSRMLS_CC);
zend_object_iterator *iterator;
zend_generator *generator = (zend_generator*)Z_OBJ_P(object);
if (!generator->execute_data) {
zend_throw_exception(NULL, "Cannot traverse an already closed generator", 0 TSRMLS_CC);
return NULL;
}
if (by_ref && !(generator->execute_data->op_array->fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
if (by_ref && !(generator->execute_data->func->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
zend_throw_exception(NULL, "You can only iterate a generator by-reference if it declared that it yields by-reference", 0 TSRMLS_CC);
return NULL;
}
iterator = &generator->iterator;
iterator->intern.funcs = &zend_generator_iterator_functions;
iterator->intern.data = (void *) generator;
iterator = generator->iterator = emalloc(sizeof(zend_object_iterator));
zend_iterator_init(iterator TSRMLS_CC);
/* We have to keep a reference to the generator object zval around,
* otherwise the generator may be destroyed during iteration. */
Z_ADDREF_P(object);
iterator->object = object;
iterator->funcs = &zend_generator_iterator_functions;
ZVAL_COPY(&iterator->data, object);
return (zend_object_iterator *) iterator;
return iterator;
}
/* }}} */
@@ -746,8 +683,10 @@ void zend_register_generator_ce(TSRMLS_D) /* {{{ */
zend_ce_generator->iterator_funcs.funcs = &zend_generator_iterator_functions;
memcpy(&zend_generator_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
zend_generator_handlers.get_constructor = zend_generator_get_constructor;
zend_generator_handlers.free_obj = zend_generator_free_storage;
zend_generator_handlers.dtor_obj = zend_generator_dtor_storage;
zend_generator_handlers.clone_obj = NULL;
zend_generator_handlers.get_constructor = zend_generator_get_constructor;
}
/* }}} */
+6 -14
View File
@@ -25,18 +25,10 @@ BEGIN_EXTERN_C()
extern ZEND_API zend_class_entry *zend_ce_generator;
typedef struct _zend_generator_iterator {
zend_object_iterator intern;
/* The generator object zval has to be stored, because the iterator is
* holding a ref to it, which has to be dtored. */
zval *object;
} zend_generator_iterator;
typedef struct _zend_generator {
zend_object std;
zend_generator_iterator iterator;
zend_object_iterator *iterator;
/* The suspended execution context. */
zend_execute_data *execute_data;
@@ -45,13 +37,13 @@ typedef struct _zend_generator {
zend_vm_stack stack;
/* Current value */
zval *value;
zval value;
/* Current key */
zval *key;
zval key;
/* Variable to put sent value into */
zval **send_target;
zval *send_target;
/* Largest used integer key for auto-incrementing keys */
long largest_used_integer_key;
zend_long largest_used_integer_key;
/* ZEND_GENERATOR_* flags */
zend_uchar flags;
@@ -62,7 +54,7 @@ static const zend_uchar ZEND_GENERATOR_FORCED_CLOSE = 0x2;
static const zend_uchar ZEND_GENERATOR_AT_FIRST_YIELD = 0x4;
void zend_register_generator_ce(TSRMLS_D);
ZEND_API zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC);
ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array *op_array, zval *return_value TSRMLS_DC);
ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution TSRMLS_DC);
ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC);
+30 -42
View File
@@ -36,6 +36,7 @@
#include "zend_modules.h"
#include "zend_float.h"
#include "zend_multibyte.h"
#include "zend_arena.h"
/* Define ZTS if you want a thread-safe Zend */
/*#undef ZTS*/
@@ -85,7 +86,7 @@ struct _zend_compiler_globals {
zend_stack function_call_stack;
char *compiled_filename;
zend_string *compiled_filename;
int zend_lineno;
@@ -111,25 +112,24 @@ struct _zend_compiler_globals {
zend_llist open_files;
long catch_begin;
zend_long catch_begin;
struct _zend_ini_parser_param *ini_parser_param;
int interactive;
zend_uint start_lineno;
uint32_t start_lineno;
zend_bool increment_lineno;
znode implementing_class;
zend_uint access_type;
uint32_t access_type;
char *doc_comment;
zend_uint doc_comment_len;
zend_string *doc_comment;
zend_uint compiler_options; /* set of ZEND_COMPILE_* constants */
uint32_t compiler_options; /* set of ZEND_COMPILE_* constants */
zval *current_namespace;
zval current_namespace;
HashTable *current_import;
HashTable *current_import_function;
HashTable *current_import_const;
@@ -141,14 +141,10 @@ struct _zend_compiler_globals {
zend_compiler_context context;
zend_stack context_stack;
/* interned strings */
char *interned_strings_start;
char *interned_strings_end;
char *interned_strings_top;
char *interned_strings_snapshot_top;
#ifndef ZTS
char *interned_empty_string;
#endif
zend_arena *arena;
zend_string *empty_string;
zend_string *one_char_string[256];
HashTable interned_strings;
@@ -159,30 +155,22 @@ struct _zend_compiler_globals {
zend_bool encoding_declared;
#ifdef ZTS
zval ***static_members_table;
zval **static_members_table;
int last_static_member;
#endif
};
struct _zend_executor_globals {
zval **return_value_ptr_ptr;
zval uninitialized_zval;
zval *uninitialized_zval_ptr;
zval error_zval;
zval *error_zval_ptr;
/* symbol table cache */
HashTable *symtable_cache[SYMTABLE_CACHE_SIZE];
HashTable **symtable_cache_limit;
HashTable **symtable_cache_ptr;
zend_array *symtable_cache[SYMTABLE_CACHE_SIZE];
zend_array **symtable_cache_limit;
zend_array **symtable_cache_ptr;
zend_op **opline_ptr;
HashTable *active_symbol_table;
HashTable symbol_table; /* main symbol table */
zend_array symbol_table; /* main symbol table */
HashTable included_files; /* files already included */
@@ -192,22 +180,18 @@ struct _zend_executor_globals {
int orig_error_reporting;
int exit_status;
zend_op_array *active_op_array;
HashTable *function_table; /* function symbol table */
HashTable *class_table; /* class table */
HashTable *zend_constants; /* constants table */
zend_class_entry *scope;
zend_class_entry *called_scope; /* Scope of the calling class */
zval *This;
zval This;
long precision;
zend_long precision;
int ticks_count;
zend_bool in_execution;
HashTable *in_autoload;
zend_function *autoload_func;
zend_bool full_tables_cleanup;
@@ -226,17 +210,17 @@ struct _zend_executor_globals {
zend_vm_stack argument_stack;
int user_error_handler_error_reporting;
zval *user_error_handler;
zval *user_exception_handler;
zval user_error_handler;
zval user_exception_handler;
zend_stack user_error_handlers_error_reporting;
zend_ptr_stack user_error_handlers;
zend_ptr_stack user_exception_handlers;
zend_stack user_error_handlers;
zend_stack user_exception_handlers;
zend_error_handling_t error_handling;
zend_class_entry *exception_class;
/* timeout support */
int timeout_seconds;
zend_long timeout_seconds;
int lambda_count;
@@ -245,7 +229,7 @@ struct _zend_executor_globals {
zend_ini_entry *error_reporting_ini_entry;
zend_objects_store objects_store;
zval *exception, *prev_exception;
zend_object *exception, *prev_exception;
zend_op *opline_before_exception;
zend_op exception_op[3];
@@ -255,7 +239,8 @@ struct _zend_executor_globals {
zend_property_info std_property_info;
zend_bool active;
zend_bool active;
zend_bool valid_symbol_table;
zend_op *start_op;
@@ -313,6 +298,9 @@ struct _zend_php_scanner_globals {
zend_encoding_filter input_filter;
zend_encoding_filter output_filter;
const zend_encoding *script_encoding;
/* initial string length after scanning to first variable */
int scanned_string_len;
};
#endif /* ZEND_GLOBALS_H */
+1264 -951
View File
File diff suppressed because it is too large. Load diff
+624 -245
View File
@@ -30,109 +30,103 @@
#define HASH_KEY_NON_EXISTENT 3
#define HASH_KEY_NON_EXISTANT HASH_KEY_NON_EXISTENT /* Keeping old define (with typo) for backward compatibility */
#define HASH_UPDATE (1<<0)
#define HASH_ADD (1<<1)
#define HASH_NEXT_INSERT (1<<2)
#define HASH_UPDATE (1<<0)
#define HASH_ADD (1<<1)
#define HASH_NEXT_INSERT (1<<2)
#define HASH_UPDATE_INDIRECT (1<<3)
#define HASH_ADD_NEW (1<<4)
#define HASH_DEL_KEY 0
#define HASH_DEL_INDEX 1
#define HASH_DEL_KEY_QUICK 2
#define INVALID_IDX ((uint)-1)
#define HASH_UPDATE_KEY_IF_NONE 0
#define HASH_UPDATE_KEY_IF_BEFORE 1
#define HASH_UPDATE_KEY_IF_AFTER 2
#define HASH_UPDATE_KEY_ANYWAY 3
typedef ulong (*hash_func_t)(const char *arKey, uint nKeyLength);
typedef int (*compare_func_t)(const void *, const void * TSRMLS_DC);
typedef void (*sort_func_t)(void *, size_t, register size_t, compare_func_t TSRMLS_DC);
typedef void (*dtor_func_t)(void *pDest);
typedef void (*copy_ctor_func_t)(void *pElement);
typedef void (*copy_ctor_param_func_t)(void *pElement, void *pParam);
struct _hashtable;
typedef struct bucket {
ulong h; /* Used for numeric indexing */
uint nKeyLength;
void *pData;
void *pDataPtr;
struct bucket *pListNext;
struct bucket *pListLast;
struct bucket *pNext;
struct bucket *pLast;
const char *arKey;
} Bucket;
typedef struct _hashtable {
uint nTableSize;
uint nTableMask;
uint nNumOfElements;
ulong nNextFreeElement;
Bucket *pInternalPointer; /* Used for element traversal */
Bucket *pListHead;
Bucket *pListTail;
Bucket **arBuckets;
dtor_func_t pDestructor;
zend_bool persistent;
unsigned char nApplyCount;
zend_bool bApplyProtection;
#if ZEND_DEBUG
int inconsistent;
#endif
} HashTable;
#define HASH_FLAG_PERSISTENT (1<<0)
#define HASH_FLAG_APPLY_PROTECTION (1<<1)
#define HASH_FLAG_PACKED (1<<2)
#define HASH_MASK_CONSISTENCY 0x60
typedef struct _zend_hash_key {
const char *arKey;
uint nKeyLength;
ulong h;
zend_ulong h;
zend_string *key;
} zend_hash_key;
typedef zend_bool (*merge_checker_func_t)(HashTable *target_ht, zval *source_data, zend_hash_key *hash_key, void *pParam);
typedef zend_bool (*merge_checker_func_t)(HashTable *target_ht, void *source_data, zend_hash_key *hash_key, void *pParam);
typedef Bucket* HashPosition;
typedef uint HashPosition;
BEGIN_EXTERN_C()
/* startup/shutdown */
ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC);
ZEND_API int _zend_hash_init_ex(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC);
ZEND_API void _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC);
ZEND_API void _zend_hash_init_ex(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC);
ZEND_API void zend_hash_destroy(HashTable *ht);
ZEND_API void zend_hash_clean(HashTable *ht);
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) _zend_hash_init((ht), (nSize), (pDestructor), (persistent) ZEND_FILE_LINE_CC)
#define zend_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) _zend_hash_init_ex((ht), (nSize), (pDestructor), (persistent), (bApplyProtection) ZEND_FILE_LINE_CC)
ZEND_API void zend_hash_real_init(HashTable *ht, int packed);
ZEND_API void zend_hash_packed_to_hash(HashTable *ht);
ZEND_API void zend_hash_to_packed(HashTable *ht);
/* additions/updates/changes */
ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
#define zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \
_zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
#define zend_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \
_zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC)
ZEND_API zval *_zend_hash_add_or_update(HashTable *ht, zend_string *key, zval *pData, int flag ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_update(HashTable *ht, zend_string *key,zval *pData ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_update_ind(HashTable *ht, zend_string *key,zval *pData ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_add(HashTable *ht, zend_string *key,zval *pData ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_add_new(HashTable *ht, zend_string *key,zval *pData ZEND_FILE_LINE_DC);
ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
#define zend_hash_quick_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \
_zend_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
#define zend_hash_quick_add(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \
_zend_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC)
#define zend_hash_update(ht, key, pData) \
_zend_hash_update(ht, key, pData ZEND_FILE_LINE_CC)
#define zend_hash_update_ind(ht, key, pData) \
_zend_hash_update_ind(ht, key, pData ZEND_FILE_LINE_CC)
#define zend_hash_add(ht, key, pData) \
_zend_hash_add(ht, key, pData ZEND_FILE_LINE_CC)
#define zend_hash_add_new(ht, key, pData) \
_zend_hash_add_new(ht, key, pData ZEND_FILE_LINE_CC)
ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
#define zend_hash_index_update(ht, h, pData, nDataSize, pDest) \
_zend_hash_index_update_or_next_insert(ht, h, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
#define zend_hash_next_index_insert(ht, pData, nDataSize, pDest) \
_zend_hash_index_update_or_next_insert(ht, 0, pData, nDataSize, pDest, HASH_NEXT_INSERT ZEND_FILE_LINE_CC)
ZEND_API zval *_zend_hash_str_add_or_update(HashTable *ht, const char *key, int len, zval *pData, int flag ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_str_update(HashTable *ht, const char *key, int len, zval *pData ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_str_update_ind(HashTable *ht, const char *key, int len, zval *pData ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_str_add(HashTable *ht, const char *key, int len, zval *pData ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_str_add_new(HashTable *ht, const char *key, int len, zval *pData ZEND_FILE_LINE_DC);
ZEND_API int zend_hash_add_empty_element(HashTable *ht, const char *arKey, uint nKeyLength);
#define zend_hash_str_update(ht, key, len, pData) \
_zend_hash_str_update(ht, key, len, pData ZEND_FILE_LINE_CC)
#define zend_hash_str_update_ind(ht, key, len, pData) \
_zend_hash_str_update_ind(ht, key, len, pData ZEND_FILE_LINE_CC)
#define zend_hash_str_add(ht, key, len, pData) \
_zend_hash_str_add(ht, key, len, pData ZEND_FILE_LINE_CC)
#define zend_hash_str_add_new(ht, key, len, pData) \
_zend_hash_str_add_new(ht, key, len, pData ZEND_FILE_LINE_CC)
ZEND_API zval *_zend_hash_index_update_or_next_insert(HashTable *ht, zend_ulong h, zval *pData, int flag ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_index_add(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_index_add_new(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_index_update(HashTable *ht, zend_ulong h, zval *pData ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_next_index_insert(HashTable *ht, zval *pData ZEND_FILE_LINE_DC);
ZEND_API zval *_zend_hash_next_index_insert_new(HashTable *ht, zval *pData ZEND_FILE_LINE_DC);
#define zend_hash_index_add(ht, h, pData) \
_zend_hash_index_add(ht, h, pData ZEND_FILE_LINE_CC)
#define zend_hash_index_add_new(ht, h, pData) \
_zend_hash_index_add_new(ht, h, pData ZEND_FILE_LINE_CC)
#define zend_hash_index_update(ht, h, pData) \
_zend_hash_index_update(ht, h, pData ZEND_FILE_LINE_CC)
#define zend_hash_next_index_insert(ht, pData) \
_zend_hash_next_index_insert(ht, pData ZEND_FILE_LINE_CC)
#define zend_hash_next_index_insert_new(ht, pData) \
_zend_hash_next_index_insert_new(ht, pData ZEND_FILE_LINE_CC)
ZEND_API zval *zend_hash_index_add_empty_element(HashTable *ht, zend_ulong h);
ZEND_API zval *zend_hash_add_empty_element(HashTable *ht, zend_string *key);
ZEND_API zval *zend_hash_str_add_empty_element(HashTable *ht, const char *key, int len);
#define ZEND_HASH_APPLY_KEEP 0
#define ZEND_HASH_APPLY_REMOVE 1<<0
#define ZEND_HASH_APPLY_STOP 1<<1
typedef int (*apply_func_t)(void *pDest TSRMLS_DC);
typedef int (*apply_func_arg_t)(void *pDest, void *argument TSRMLS_DC);
typedef int (*apply_func_args_t)(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key);
typedef int (*apply_func_t)(zval *pDest TSRMLS_DC);
typedef int (*apply_func_arg_t)(zval *pDest, void *argument TSRMLS_DC);
typedef int (*apply_func_args_t)(zval *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key);
ZEND_API void zend_hash_graceful_destroy(HashTable *ht);
ZEND_API void zend_hash_graceful_reverse_destroy(HashTable *ht);
@@ -150,153 +144,82 @@ ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSR
/* Deletes */
ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, int flag);
#define zend_hash_del(ht, arKey, nKeyLength) \
zend_hash_del_key_or_index(ht, arKey, nKeyLength, 0, HASH_DEL_KEY)
#define zend_hash_quick_del(ht, arKey, nKeyLength, h) \
zend_hash_del_key_or_index(ht, arKey, nKeyLength, h, HASH_DEL_KEY_QUICK)
#define zend_hash_index_del(ht, h) \
zend_hash_del_key_or_index(ht, NULL, 0, h, HASH_DEL_INDEX)
#define zend_get_hash_value \
zend_hash_func
ZEND_API int zend_hash_del(HashTable *ht, zend_string *key);
ZEND_API int zend_hash_del_ind(HashTable *ht, zend_string *key);
ZEND_API int zend_hash_str_del(HashTable *ht, const char *key, int len);
ZEND_API int zend_hash_str_del_ind(HashTable *ht, const char *key, int len);
ZEND_API int zend_hash_index_del(HashTable *ht, zend_ulong h);
/* Data retreival */
ZEND_API int zend_hash_find(const HashTable *ht, const char *arKey, uint nKeyLength, void **pData);
ZEND_API int zend_hash_quick_find(const HashTable *ht, const char *arKey, uint nKeyLength, ulong h, void **pData);
ZEND_API int zend_hash_index_find(const HashTable *ht, ulong h, void **pData);
ZEND_API zval *zend_hash_find(const HashTable *ht, zend_string *key);
ZEND_API zval *zend_hash_str_find(const HashTable *ht, const char *key, int len);
ZEND_API zval *zend_hash_index_find(const HashTable *ht, zend_ulong h);
/* Misc */
ZEND_API int zend_hash_exists(const HashTable *ht, const char *arKey, uint nKeyLength);
ZEND_API int zend_hash_quick_exists(const HashTable *ht, const char *arKey, uint nKeyLength, ulong h);
ZEND_API int zend_hash_index_exists(const HashTable *ht, ulong h);
ZEND_API ulong zend_hash_next_free_element(const HashTable *ht);
ZEND_API int zend_hash_exists(const HashTable *ht, zend_string *key);
ZEND_API int zend_hash_str_exists(const HashTable *ht, const char *str, int len);
ZEND_API int zend_hash_index_exists(const HashTable *ht, zend_ulong h);
/* traversing */
#define zend_hash_has_more_elements_ex(ht, pos) \
(zend_hash_get_current_key_type_ex(ht, pos) == HASH_KEY_NON_EXISTENT ? FAILURE : SUCCESS)
ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index, uint *str_length, ulong *num_index, zend_bool duplicate, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str_index, zend_ulong *num_index, zend_bool duplicate, HashPosition *pos);
ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosition *pos);
ZEND_API zval *zend_hash_get_current_data_ex(HashTable *ht, HashPosition *pos);
ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos);
ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const char *str_index, uint str_length, ulong num_index, int mode, HashPosition *pos);
typedef struct _HashPointer {
HashPosition pos;
ulong h;
HashTable *ht;
zend_ulong h;
} HashPointer;
ZEND_API int zend_hash_get_pointer(const HashTable *ht, HashPointer *ptr);
ZEND_API int zend_hash_set_pointer(HashTable *ht, const HashPointer *ptr);
#define zend_hash_has_more_elements(ht) \
zend_hash_has_more_elements_ex(ht, NULL)
zend_hash_has_more_elements_ex(ht, &(ht)->nInternalPointer)
#define zend_hash_move_forward(ht) \
zend_hash_move_forward_ex(ht, NULL)
zend_hash_move_forward_ex(ht, &(ht)->nInternalPointer)
#define zend_hash_move_backwards(ht) \
zend_hash_move_backwards_ex(ht, NULL)
zend_hash_move_backwards_ex(ht, &(ht)->nInternalPointer)
#define zend_hash_get_current_key(ht, str_index, num_index, duplicate) \
zend_hash_get_current_key_ex(ht, str_index, NULL, num_index, duplicate, NULL)
zend_hash_get_current_key_ex(ht, str_index, num_index, duplicate, &(ht)->nInternalPointer)
#define zend_hash_get_current_key_zval(ht, key) \
zend_hash_get_current_key_zval_ex(ht, key, NULL)
zend_hash_get_current_key_zval_ex(ht, key, &(ht)->nInternalPointer)
#define zend_hash_get_current_key_type(ht) \
zend_hash_get_current_key_type_ex(ht, NULL)
#define zend_hash_get_current_data(ht, pData) \
zend_hash_get_current_data_ex(ht, pData, NULL)
zend_hash_get_current_key_type_ex(ht, &(ht)->nInternalPointer)
#define zend_hash_get_current_data(ht) \
zend_hash_get_current_data_ex(ht, &(ht)->nInternalPointer)
#define zend_hash_internal_pointer_reset(ht) \
zend_hash_internal_pointer_reset_ex(ht, NULL)
zend_hash_internal_pointer_reset_ex(ht, &(ht)->nInternalPointer)
#define zend_hash_internal_pointer_end(ht) \
zend_hash_internal_pointer_end_ex(ht, NULL)
#define zend_hash_update_current_key(ht, key_type, str_index, str_length, num_index) \
zend_hash_update_current_key_ex(ht, key_type, str_index, str_length, num_index, HASH_UPDATE_KEY_ANYWAY, NULL)
zend_hash_internal_pointer_end_ex(ht, &(ht)->nInternalPointer)
/* Copying, merging and sorting */
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size);
ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite ZEND_FILE_LINE_DC);
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, uint size, merge_checker_func_t pMergeSource, void *pParam);
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor);
ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, int overwrite ZEND_FILE_LINE_DC);
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, merge_checker_func_t pMergeSource, void *pParam);
ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber TSRMLS_DC);
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC);
ZEND_API int zend_hash_minmax(const HashTable *ht, compare_func_t compar, int flag, void **pData TSRMLS_DC);
ZEND_API zval *zend_hash_minmax(const HashTable *ht, compare_func_t compar, int flag TSRMLS_DC);
#define zend_hash_merge(target, source, pCopyConstructor, tmp, size, overwrite) \
_zend_hash_merge(target, source, pCopyConstructor, tmp, size, overwrite ZEND_FILE_LINE_CC)
#define zend_hash_merge(target, source, pCopyConstructor, overwrite) \
_zend_hash_merge(target, source, pCopyConstructor, overwrite ZEND_FILE_LINE_CC)
ZEND_API int zend_hash_num_elements(const HashTable *ht);
#define zend_hash_num_elements(ht) \
(ht)->nNumOfElements
#define zend_hash_next_free_element(ht) \
(ht)->nNextFreeElement
ZEND_API int zend_hash_rehash(HashTable *ht);
ZEND_API void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys);
ZEND_API void _zend_hash_splice(HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor, uint offset, uint length, void **list, uint list_count, HashTable *removed ZEND_FILE_LINE_DC);
#define zend_hash_splice(ht, nDataSize, pCopyConstructor, offset, length, list, list_count, removed) \
_zend_hash_splice(ht, nDataSize, pCopyConstructor, offset, length, list, list_count, removed ZEND_FILE_LINE_CC)
/*
* DJBX33A (Daniel J. Bernstein, Times 33 with Addition)
*
* This is Daniel J. Bernstein's popular `times 33' hash function as
* posted by him years ago on comp.lang.c. It basically uses a function
* like ``hash(i) = hash(i-1) * 33 + str[i]''. This is one of the best
* known hash functions for strings. Because it is both computed very
* fast and distributes very well.
*
* The magic of number 33, i.e. why it works better than many other
* constants, prime or not, has never been adequately explained by
* anyone. So I try an explanation: if one experimentally tests all
* multipliers between 1 and 256 (as RSE did now) one detects that even
* numbers are not useable at all. The remaining 128 odd numbers
* (except for the number 1) work more or less all equally well. They
* all distribute in an acceptable way and this way fill a hash table
* with an average percent of approx. 86%.
*
* If one compares the Chi^2 values of the variants, the number 33 not
* even has the best value. But the number 33 and a few other equally
* good numbers like 17, 31, 63, 127 and 129 have nevertheless a great
* advantage to the remaining numbers in the large set of possible
* multipliers: their multiply operation can be replaced by a faster
* operation based on just one shift plus either a single addition
* or subtraction operation. And because a hash function has to both
* distribute good _and_ has to be very fast to compute, those few
* numbers should be preferred and seems to be the reason why Daniel J.
* Bernstein also preferred it.
*
*
* -- Ralf S. Engelschall <rse@engelschall.com>
*/
static inline ulong zend_inline_hash_func(const char *arKey, uint nKeyLength)
{
register ulong hash = 5381;
/* variant with the hash unrolled eight times */
for (; nKeyLength >= 8; nKeyLength -= 8) {
hash = ((hash << 5) + hash) + *arKey++;
hash = ((hash << 5) + hash) + *arKey++;
hash = ((hash << 5) + hash) + *arKey++;
hash = ((hash << 5) + hash) + *arKey++;
hash = ((hash << 5) + hash) + *arKey++;
hash = ((hash << 5) + hash) + *arKey++;
hash = ((hash << 5) + hash) + *arKey++;
hash = ((hash << 5) + hash) + *arKey++;
}
switch (nKeyLength) {
case 7: hash = ((hash << 5) + hash) + *arKey++; /* fallthrough... */
case 6: hash = ((hash << 5) + hash) + *arKey++; /* fallthrough... */
case 5: hash = ((hash << 5) + hash) + *arKey++; /* fallthrough... */
case 4: hash = ((hash << 5) + hash) + *arKey++; /* fallthrough... */
case 3: hash = ((hash << 5) + hash) + *arKey++; /* fallthrough... */
case 2: hash = ((hash << 5) + hash) + *arKey++; /* fallthrough... */
case 1: hash = ((hash << 5) + hash) + *arKey++; break;
case 0: break;
EMPTY_SWITCH_DEFAULT_CASE()
}
return hash;
}
ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength);
ZEND_API void zend_array_dup(HashTable *target, HashTable *source);
#if ZEND_DEBUG
/* debug */
@@ -307,87 +230,543 @@ void zend_hash_display(const HashTable *ht);
END_EXTERN_C()
#define ZEND_INIT_SYMTABLE(ht) \
ZEND_INIT_SYMTABLE_EX(ht, 2, 0)
ZEND_INIT_SYMTABLE_EX(ht, 8, 0)
#define ZEND_INIT_SYMTABLE_EX(ht, n, persistent) \
zend_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent)
#define ZEND_HANDLE_NUMERIC_EX(key, length, idx, func) do { \
register const char *tmp = key; \
\
if (*tmp == '-') { \
tmp++; \
} \
if (*tmp >= '0' && *tmp <= '9') { /* possibly a numeric index */ \
const char *end = key + length - 1; \
\
if ((*end != '\0') /* not a null terminated string */ \
|| (*tmp == '0' && length > 2) /* numbers with leading zeros */ \
|| (end - tmp > MAX_LENGTH_OF_LONG - 1) /* number too long */ \
|| (SIZEOF_LONG == 4 && \
end - tmp == MAX_LENGTH_OF_LONG - 1 && \
*tmp > '2')) { /* overflow */ \
break; \
} \
idx = (*tmp - '0'); \
while (++tmp != end && *tmp >= '0' && *tmp <= '9') { \
idx = (idx * 10) + (*tmp - '0'); \
} \
if (tmp == end) { \
if (*key == '-') { \
if (idx-1 > LONG_MAX) { /* overflow */ \
break; \
} \
idx = 0 - idx; \
} else if (idx > LONG_MAX) { /* overflow */ \
break; \
} \
func; \
} \
} \
} while (0)
#define ZEND_HANDLE_NUMERIC(key, length, func) do { \
ulong idx; \
\
ZEND_HANDLE_NUMERIC_EX(key, length, idx, return func); \
} while (0)
static inline int zend_symtable_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest) \
static inline int _zend_handle_numeric_str(const char *key, size_t length, zend_ulong *idx)
{
ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_update(ht, idx, pData, nDataSize, pDest));
return zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest);
register const char *tmp = key;
const char *end;
if (*tmp > '9') {
return 0;
} else if (*tmp < '0') {
if (*tmp != '-') {
return 0;
}
tmp++;
if (*tmp > '9' || *tmp < '0') {
return 0;
}
}
/* possibly a numeric index */
end = key + length;
if ((*end != '\0') /* not a null terminated string */
|| (*tmp == '0' && length > 1) /* numbers with leading zeros */
|| (end - tmp > MAX_LENGTH_OF_LONG - 1) /* number too long */
|| (SIZEOF_ZEND_LONG == 4 &&
end - tmp == MAX_LENGTH_OF_LONG - 1 &&
*tmp > '2')) { /* overflow */
return 0;
}
*idx = (*tmp - '0');
while (1) {
++tmp;
if (tmp == end) {
if (*key == '-') {
if (*idx-1 > ZEND_LONG_MAX) { /* overflow */
return 0;
}
*idx = 0 - *idx;
} else if (*idx > ZEND_LONG_MAX) { /* overflow */
return 0;
}
return 1;
}
if (*tmp <= '9' && *tmp >= '0') {
*idx = (*idx * 10) + (*tmp - '0');
} else {
return 0;
}
}
}
#define ZEND_HANDLE_NUMERIC_STR(key, length, idx) \
_zend_handle_numeric_str(key, length, &idx)
#define ZEND_HANDLE_NUMERIC(key, idx) \
_zend_handle_numeric_str((key)->val, (key)->len, &idx)
static inline zval *zend_hash_find_ind(const HashTable *ht, zend_string *key)
{
zval *zv;
zv = zend_hash_find(ht, key);
return (zv && Z_TYPE_P(zv) == IS_INDIRECT) ? Z_INDIRECT_P(zv) : zv;
}
static inline int zend_symtable_del(HashTable *ht, const char *arKey, uint nKeyLength)
static inline int zend_hash_exists_ind(const HashTable *ht, zend_string *key)
{
ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_del(ht, idx));
return zend_hash_del(ht, arKey, nKeyLength);
zval *zv;
zv = zend_hash_find(ht, key);
return zv && (Z_TYPE_P(zv) != IS_INDIRECT ||
Z_TYPE_P(Z_INDIRECT_P(zv)) != IS_UNDEF);
}
static inline int zend_symtable_find(HashTable *ht, const char *arKey, uint nKeyLength, void **pData)
static inline zval *zend_hash_str_find_ind(const HashTable *ht, const char *str, int len)
{
ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_find(ht, idx, pData));
return zend_hash_find(ht, arKey, nKeyLength, pData);
zval *zv;
zv = zend_hash_str_find(ht, str, len);
return (zv && Z_TYPE_P(zv) == IS_INDIRECT) ? Z_INDIRECT_P(zv) : zv;
}
static inline int zend_symtable_exists(HashTable *ht, const char *arKey, uint nKeyLength)
static inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *pData)
{
ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_exists(ht, idx));
return zend_hash_exists(ht, arKey, nKeyLength);
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC(key, idx)) {
return zend_hash_index_update(ht, idx, pData);
} else {
return zend_hash_update(ht, key, pData);
}
}
static inline int zend_symtable_update_current_key_ex(HashTable *ht, const char *arKey, uint nKeyLength, int mode, HashPosition *pos)
{
ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_update_current_key_ex(ht, HASH_KEY_IS_LONG, NULL, 0, idx, mode, pos));
return zend_hash_update_current_key_ex(ht, HASH_KEY_IS_STRING, arKey, nKeyLength, 0, mode, pos);
}
#define zend_symtable_update_current_key(ht,arKey,nKeyLength,mode) \
zend_symtable_update_current_key_ex(ht, arKey, nKeyLength, mode, NULL)
static inline zval *zend_symtable_update_ind(HashTable *ht, zend_string *key, zval *pData)
{
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC(key, idx)) {
return zend_hash_index_update(ht, idx, pData);
} else {
return zend_hash_update_ind(ht, key, pData);
}
}
static inline int zend_symtable_del(HashTable *ht, zend_string *key)
{
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC(key, idx)) {
return zend_hash_index_del(ht, idx);
} else {
return zend_hash_del(ht, key);
}
}
static inline int zend_symtable_del_ind(HashTable *ht, zend_string *key)
{
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC(key, idx)) {
return zend_hash_index_del(ht, idx);
} else {
return zend_hash_del_ind(ht, key);
}
}
static inline zval *zend_symtable_find(const HashTable *ht, zend_string *key)
{
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC(key, idx)) {
return zend_hash_index_find(ht, idx);
} else {
return zend_hash_find(ht, key);
}
}
static inline zval *zend_symtable_find_ind(const HashTable *ht, zend_string *key)
{
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC(key, idx)) {
return zend_hash_index_find(ht, idx);
} else {
return zend_hash_find_ind(ht, key);
}
}
static inline int zend_symtable_exists(HashTable *ht, zend_string *key)
{
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC(key, idx)) {
return zend_hash_index_exists(ht, idx);
} else {
return zend_hash_exists(ht, key);
}
}
static inline zval *zend_symtable_str_update(HashTable *ht, const char *str, int len, zval *pData)
{
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) {
return zend_hash_index_update(ht, idx, pData);
} else {
return zend_hash_str_update(ht, str, len, pData);
}
}
static inline zval *zend_symtable_str_update_ind(HashTable *ht, const char *str, int len, zval *pData)
{
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) {
return zend_hash_index_update(ht, idx, pData);
} else {
return zend_hash_str_update_ind(ht, str, len, pData);
}
}
static inline int zend_symtable_str_del(HashTable *ht, const char *str, int len)
{
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) {
return zend_hash_index_del(ht, idx);
} else {
return zend_hash_str_del(ht, str, len);
}
}
static inline int zend_symtable_str_del_ind(HashTable *ht, const char *str, int len)
{
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) {
return zend_hash_index_del(ht, idx);
} else {
return zend_hash_str_del_ind(ht, str, len);
}
}
static inline zval *zend_symtable_str_find(HashTable *ht, const char *str, int len)
{
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) {
return zend_hash_index_find(ht, idx);
} else {
return zend_hash_str_find(ht, str, len);
}
}
static inline int zend_symtable_str_exists(HashTable *ht, const char *str, int len)
{
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) {
return zend_hash_index_exists(ht, idx);
} else {
return zend_hash_str_exists(ht, str, len);
}
}
static inline void *zend_hash_add_ptr(HashTable *ht, zend_string *key, void *pData)
{
zval tmp, *zv;
ZVAL_PTR(&tmp, pData);
zv = zend_hash_add(ht, key, &tmp);
return zv ? Z_PTR_P(zv) : NULL;
}
static inline void *zend_hash_add_new_ptr(HashTable *ht, zend_string *key, void *pData)
{
zval tmp, *zv;
ZVAL_PTR(&tmp, pData);
zv = zend_hash_add_new(ht, key, &tmp);
return zv ? Z_PTR_P(zv) : NULL;
}
static inline void *zend_hash_str_add_ptr(HashTable *ht, const char *str, int len, void *pData)
{
zval tmp, *zv;
ZVAL_PTR(&tmp, pData);
zv = zend_hash_str_add(ht, str, len, &tmp);
return zv ? Z_PTR_P(zv) : NULL;
}
static inline void *zend_hash_update_ptr(HashTable *ht, zend_string *key, void *pData)
{
zval tmp, *zv;
ZVAL_PTR(&tmp, pData);
zv = zend_hash_update(ht, key, &tmp);
return zv ? Z_PTR_P(zv) : NULL;
}
static inline void *zend_hash_str_update_ptr(HashTable *ht, const char *str, int len, void *pData)
{
zval tmp, *zv;
ZVAL_PTR(&tmp, pData);
zv = zend_hash_str_update(ht, str, len, &tmp);
return zv ? Z_PTR_P(zv) : NULL;
}
static inline void *zend_hash_add_mem(HashTable *ht, zend_string *key, void *pData, size_t size)
{
zval tmp, *zv;
ZVAL_PTR(&tmp, NULL);
if ((zv = zend_hash_add(ht, key, &tmp))) {
Z_PTR_P(zv) = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
memcpy(Z_PTR_P(zv), pData, size);
return Z_PTR_P(zv);
}
return NULL;
}
static inline void *zend_hash_str_add_mem(HashTable *ht, const char *str, int len, void *pData, size_t size)
{
zval tmp, *zv;
ZVAL_PTR(&tmp, NULL);
if ((zv = zend_hash_str_add(ht, str, len, &tmp))) {
Z_PTR_P(zv) = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
memcpy(Z_PTR_P(zv), pData, size);
return Z_PTR_P(zv);
}
return NULL;
}
static inline void *zend_hash_update_mem(HashTable *ht, zend_string *key, void *pData, size_t size)
{
void *p;
p = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
memcpy(p, pData, size);
return zend_hash_update_ptr(ht, key, p);
}
static inline void *zend_hash_str_update_mem(HashTable *ht, const char *str, int len, void *pData, size_t size)
{
void *p;
p = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
memcpy(p, pData, size);
return zend_hash_str_update_ptr(ht, str, len, p);
}
static inline void *zend_hash_index_update_ptr(HashTable *ht, zend_ulong h, void *pData)
{
zval tmp, *zv;
ZVAL_PTR(&tmp, pData);
zv = zend_hash_index_update(ht, h, &tmp);
return zv ? Z_PTR_P(zv) : NULL;
}
static inline void *zend_hash_next_index_insert_ptr(HashTable *ht, void *pData)
{
zval tmp, *zv;
ZVAL_PTR(&tmp, pData);
zv = zend_hash_next_index_insert(ht, &tmp);
return zv ? Z_PTR_P(zv) : NULL;
}
static inline void *zend_hash_index_update_mem(HashTable *ht, zend_ulong h, void *pData, size_t size)
{
void *p;
p = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
memcpy(p, pData, size);
return zend_hash_index_update_ptr(ht, h, p);
}
static inline void *zend_hash_next_index_insert_mem(HashTable *ht, void *pData, size_t size)
{
zval tmp, *zv;
ZVAL_PTR(&tmp, NULL);
if ((zv = zend_hash_next_index_insert(ht, &tmp))) {
Z_PTR_P(zv) = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
memcpy(Z_PTR_P(zv), pData, size);
return Z_PTR_P(zv);
}
return NULL;
}
static inline void *zend_hash_find_ptr(const HashTable *ht, zend_string *key)
{
zval *zv;
zv = zend_hash_find(ht, key);
return zv ? Z_PTR_P(zv) : NULL;
}
static inline void *zend_hash_str_find_ptr(const HashTable *ht, const char *str, int len)
{
zval *zv;
zv = zend_hash_str_find(ht, str, len);
return zv ? Z_PTR_P(zv) : NULL;
}
static inline void *zend_hash_index_find_ptr(const HashTable *ht, zend_ulong h)
{
zval *zv;
zv = zend_hash_index_find(ht, h);
return zv ? Z_PTR_P(zv) : NULL;
}
static inline void *zend_symtable_str_find_ptr(HashTable *ht, const char *str, int len)
{
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) {
return zend_hash_index_find_ptr(ht, idx);
} else {
return zend_hash_str_find_ptr(ht, str, len);
}
}
static inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht, HashPosition *pos)
{
zval *zv;
zv = zend_hash_get_current_data_ex(ht, pos);
return zv ? Z_PTR_P(zv) : NULL;
}
#define zend_hash_get_current_data_ptr(ht) \
zend_hash_get_current_data_ptr_ex(ht, &(ht)->nInternalPointer)
#define ZEND_HASH_FOREACH(_ht, indirect) do { \
uint _idx; \
for (_idx = 0; _idx < (_ht)->nNumUsed; _idx++) { \
Bucket *_p = (_ht)->arData + _idx; \
zval *_z = &_p->val; \
if (indirect && Z_TYPE_P(_z) == IS_INDIRECT) { \
_z = Z_INDIRECT_P(_z); \
} \
if (Z_TYPE_P(_z) == IS_UNDEF) continue;
#define ZEND_HASH_REVERSE_FOREACH(_ht, indirect) do { \
uint _idx; \
for (_idx = (_ht)->nNumUsed; _idx > 0; _idx--) { \
Bucket *_p = (_ht)->arData + _idx - 1; \
zval *_z = &_p->val; \
if (indirect && Z_TYPE_P(_z) == IS_INDIRECT) { \
_z = Z_INDIRECT_P(_z); \
} \
if (Z_TYPE_P(_z) == IS_UNDEF) continue;
#define ZEND_HASH_FOREACH_END() \
} \
} while (0)
#define ZEND_HASH_FOREACH_BUCKET(ht, _bucket) \
ZEND_HASH_FOREACH(ht, 0); \
_bucket = _p;
#define ZEND_HASH_FOREACH_VAL(ht, _val) \
ZEND_HASH_FOREACH(ht, 0); \
_val = _z;
#define ZEND_HASH_FOREACH_VAL_IND(ht, _val) \
ZEND_HASH_FOREACH(ht, 1); \
_val = _z;
#define ZEND_HASH_FOREACH_PTR(ht, _ptr) \
ZEND_HASH_FOREACH(ht, 0); \
_ptr = Z_PTR_P(_z);
#define ZEND_HASH_FOREACH_NUM_KEY(ht, _h) \
ZEND_HASH_FOREACH(ht, 0); \
_h = _p->h;
#define ZEND_HASH_FOREACH_STR_KEY(ht, _key) \
ZEND_HASH_FOREACH(ht, 0); \
_key = _p->key;
#define ZEND_HASH_FOREACH_KEY(ht, _h, _key) \
ZEND_HASH_FOREACH(ht, 0); \
_h = _p->h; \
_key = _p->key;
#define ZEND_HASH_FOREACH_STR_KEY_VAL(ht, _key, _val) \
ZEND_HASH_FOREACH(ht, 0); \
_key = _p->key; \
_val = _z;
#define ZEND_HASH_FOREACH_KEY_VAL(ht, _h, _key, _val) \
ZEND_HASH_FOREACH(ht, 0); \
_h = _p->h; \
_key = _p->key; \
_val = _z;
#define ZEND_HASH_FOREACH_STR_KEY_VAL_IND(ht, _key, _val) \
ZEND_HASH_FOREACH(ht, 1); \
_key = _p->key; \
_val = _z;
#define ZEND_HASH_FOREACH_KEY_VAL_IND(ht, _h, _key, _val) \
ZEND_HASH_FOREACH(ht, 1); \
_h = _p->h; \
_key = _p->key; \
_val = _z;
#define ZEND_HASH_FOREACH_STR_KEY_PTR(ht, _key, _ptr) \
ZEND_HASH_FOREACH(ht, 0); \
_key = _p->key; \
_ptr = Z_PTR_P(_z);
#define ZEND_HASH_FOREACH_KEY_PTR(ht, _h, _key, _ptr) \
ZEND_HASH_FOREACH(ht, 0); \
_h = _p->h; \
_key = _p->key; \
_ptr = Z_PTR_P(_z);
#define ZEND_HASH_REVERSE_FOREACH_VAL(ht, _val) \
ZEND_HASH_REVERSE_FOREACH(ht, 0); \
_val = _z;
#define ZEND_HASH_REVERSE_FOREACH_PTR(ht, _ptr) \
ZEND_HASH_REVERSE_FOREACH(ht, 0); \
_ptr = Z_PTR_P(_z);
#define ZEND_HASH_REVERSE_FOREACH_VAL_IND(ht, _val) \
ZEND_HASH_REVERSE_FOREACH(ht, 1); \
_val = _z;
#define ZEND_HASH_REVERSE_FOREACH_KEY_VAL(ht, _h, _key, _val) \
ZEND_HASH_REVERSE_FOREACH(ht, 0); \
_h = _p->h; \
_key = _p->key; \
_val = _z;
#define ZEND_HASH_REVERSE_FOREACH_KEY_VAL_IND(ht, _h, _key, _val) \
ZEND_HASH_REVERSE_FOREACH(ht, 1); \
_h = _p->h; \
_key = _p->key; \
_val = _z;
#define ZEND_HASH_APPLY_PROTECTION(ht) \
((ht)->u.flags & HASH_FLAG_APPLY_PROTECTION)
#define ZEND_HASH_APPLY_SHIFT 8
#define ZEND_HASH_GET_APPLY_COUNT(ht) ((ht)->u.flags >> ZEND_HASH_APPLY_SHIFT)
#define ZEND_HASH_INC_APPLY_COUNT(ht) ((ht)->u.flags += (1 << ZEND_HASH_APPLY_SHIFT))
#define ZEND_HASH_DEC_APPLY_COUNT(ht) ((ht)->u.flags -= (1 << ZEND_HASH_APPLY_SHIFT))
#endif /* ZEND_HASH_H */
+13 -12
View File
@@ -92,7 +92,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
zend_printf("<code>");
zend_printf("<span style=\"color: %s\">\n", last_color);
/* highlight stuff coming back from zendlex() */
token.type = 0;
ZVAL_UNDEF(&token);
while ((token_type=lex_scan(&token TSRMLS_CC))) {
switch (token_type) {
case T_INLINE_HTML:
@@ -116,11 +116,11 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
break;
case T_WHITESPACE:
zend_html_puts((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng) TSRMLS_CC); /* no color needed */
token.type = 0;
ZVAL_UNDEF(&token);
continue;
break;
default:
if (token.type == 0) {
if (Z_TYPE(token) == IS_UNDEF) {
next_color = syntax_highlighter_ini->highlight_keyword;
} else {
next_color = syntax_highlighter_ini->highlight_default;
@@ -140,7 +140,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
zend_html_puts((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng) TSRMLS_CC);
if (token.type == IS_STRING) {
if (Z_TYPE(token) == IS_STRING) {
switch (token_type) {
case T_OPEN_TAG:
case T_OPEN_TAG_WITH_ECHO:
@@ -150,11 +150,11 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
case T_DOC_COMMENT:
break;
default:
str_efree(token.value.str.val);
zend_string_release(Z_STR(token));
break;
}
}
token.type = 0;
ZVAL_UNDEF(&token);
}
if (last_color != syntax_highlighter_ini->highlight_html) {
@@ -170,7 +170,7 @@ ZEND_API void zend_strip(TSRMLS_D)
int token_type;
int prev_space = 0;
token.type = 0;
ZVAL_UNDEF(&token);
while ((token_type=lex_scan(&token TSRMLS_CC))) {
switch (token_type) {
case T_WHITESPACE:
@@ -181,7 +181,7 @@ ZEND_API void zend_strip(TSRMLS_D)
/* lack of break; is intentional */
case T_COMMENT:
case T_DOC_COMMENT:
token.type = 0;
ZVAL_UNDEF(&token);
continue;
case T_END_HEREDOC:
@@ -192,7 +192,7 @@ ZEND_API void zend_strip(TSRMLS_D)
}
zend_write("\n", sizeof("\n") - 1);
prev_space = 1;
token.type = 0;
ZVAL_UNDEF(&token);
continue;
default:
@@ -200,7 +200,7 @@ ZEND_API void zend_strip(TSRMLS_D)
break;
}
if (token.type == IS_STRING) {
if (Z_TYPE(token) == IS_STRING) {
switch (token_type) {
case T_OPEN_TAG:
case T_OPEN_TAG_WITH_ECHO:
@@ -211,11 +211,12 @@ ZEND_API void zend_strip(TSRMLS_D)
break;
default:
STR_FREE(token.value.str.val);
zend_string_release(Z_STR(token));
break;
}
}
prev_space = token.type = 0;
prev_space = 0;
ZVAL_UNDEF(&token);
}
}
+7 -8
View File
@@ -47,7 +47,7 @@ static void handle_whitespace(int *emit_whitespace)
}
ZEND_API void zend_indent()
ZEND_API void zend_indent(TSRMLS_D)
{
zval token;
int token_type;
@@ -55,19 +55,18 @@ ZEND_API void zend_indent()
int nest_level=0;
int emit_whitespace[256];
int i;
TSRMLS_FETCH();
memset(emit_whitespace, 0, sizeof(int)*256);
/* highlight stuff coming back from zendlex() */
token.type = 0;
ZVAL_UNDEF(&token);
while ((token_type=lex_scan(&token TSRMLS_CC))) {
switch (token_type) {
case T_INLINE_HTML:
zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
break;
case T_WHITESPACE: {
token.type = 0;
ZVAL_UNDEF(&token);
/* eat whitespace, emit newlines */
for (i=0; i<LANG_SCNG(yy_leng); i++) {
emit_whitespace[(unsigned char) LANG_SCNG(yy_text)[i]]++;
@@ -79,7 +78,7 @@ ZEND_API void zend_indent()
in_string = !in_string;
/* break missing intentionally */
default:
if (token.type==0) {
if (Z_TYPE(token) == IS_UNDEF) {
/* keyword */
switch (token_type) {
case ',':
@@ -132,18 +131,18 @@ dflt_printout:
}
break;
}
if (token.type == IS_STRING) {
if (Z_TYPE(token) == IS_STRING) {
switch (token_type) {
case T_OPEN_TAG:
case T_CLOSE_TAG:
case T_WHITESPACE:
break;
default:
str_efree(token.value.str.val);
zend_string_release(Z_STR(token));
break;
}
}
token.type = 0;
ZVAL_UNDEF(&token);
}
}
+1 -1
View File
@@ -23,7 +23,7 @@
#define ZEND_INDENT_H
BEGIN_EXTERN_C()
ZEND_API void zend_indent(void);
ZEND_API void zend_indent(TSRMLS_D);
END_EXTERN_C()
#endif /* ZEND_INDENT_H */
+54 -44
View File
@@ -34,9 +34,11 @@ static HashTable *registered_zend_ini_directives;
/*
* hash_apply functions
*/
static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number TSRMLS_DC) /* {{{ */
static int zend_remove_ini_entries(zval *el, void *arg TSRMLS_DC) /* {{{ */
{
if (ini_entry->module_number == *module_number) {
zend_ini_entry *ini_entry = (zend_ini_entry *)Z_PTR_P(el);
int module_number = *(int *)arg;
if (ini_entry->module_number == module_number) {
return 1;
} else {
return 0;
@@ -76,13 +78,20 @@ static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS
}
/* }}} */
static int zend_restore_ini_entry_wrapper(zend_ini_entry **ini_entry TSRMLS_DC) /* {{{ */
static int zend_restore_ini_entry_wrapper(zval *el TSRMLS_DC) /* {{{ */
{
zend_restore_ini_entry_cb(*ini_entry, ZEND_INI_STAGE_DEACTIVATE TSRMLS_CC);
zend_ini_entry *ini_entry = (zend_ini_entry *)Z_PTR_P(el);
zend_restore_ini_entry_cb(ini_entry, ZEND_INI_STAGE_DEACTIVATE TSRMLS_CC);
return 1;
}
/* }}} */
static void _free_ptr(zval *zv) /* {{{ */
{
free(Z_PTR_P(zv));
}
/* }}} */
/*
* Startup / shutdown
*/
@@ -93,9 +102,7 @@ ZEND_API int zend_ini_startup(TSRMLS_D) /* {{{ */
EG(ini_directives) = registered_zend_ini_directives;
EG(modified_ini_directives) = NULL;
EG(error_reporting_ini_entry) = NULL;
if (zend_hash_init_ex(registered_zend_ini_directives, 100, NULL, NULL, 1, 0) == FAILURE) {
return FAILURE;
}
zend_hash_init_ex(registered_zend_ini_directives, 128, NULL, _free_ptr, 1, 0);
return SUCCESS;
}
/* }}} */
@@ -119,7 +126,7 @@ ZEND_API int zend_ini_global_shutdown(TSRMLS_D) /* {{{ */
ZEND_API int zend_ini_deactivate(TSRMLS_D) /* {{{ */
{
if (EG(modified_ini_directives)) {
zend_hash_apply(EG(modified_ini_directives), (apply_func_t) zend_restore_ini_entry_wrapper TSRMLS_CC);
zend_hash_apply(EG(modified_ini_directives), zend_restore_ini_entry_wrapper TSRMLS_CC);
zend_hash_destroy(EG(modified_ini_directives));
FREE_HASHTABLE(EG(modified_ini_directives));
EG(modified_ini_directives) = NULL;
@@ -131,15 +138,11 @@ ZEND_API int zend_ini_deactivate(TSRMLS_D) /* {{{ */
#ifdef ZTS
ZEND_API int zend_copy_ini_directives(TSRMLS_D) /* {{{ */
{
zend_ini_entry ini_entry;
EG(modified_ini_directives) = NULL;
EG(error_reporting_ini_entry) = NULL;
EG(ini_directives) = (HashTable *) malloc(sizeof(HashTable));
if (zend_hash_init_ex(EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0) == FAILURE) {
return FAILURE;
}
zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL, &ini_entry, sizeof(zend_ini_entry));
zend_hash_init_ex(EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0);
zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL);
return SUCCESS;
}
/* }}} */
@@ -150,17 +153,17 @@ static int ini_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
const Bucket *f;
const Bucket *s;
f = *((const Bucket **) a);
s = *((const Bucket **) b);
f = (const Bucket *) a;
s = (const Bucket *) b;
if (f->nKeyLength == 0 && s->nKeyLength == 0) { /* both numeric */
return ZEND_NORMALIZE_BOOL(f->nKeyLength - s->nKeyLength);
} else if (f->nKeyLength == 0) { /* f is numeric, s is not */
if (!f->key && !s->key) { /* both numeric */
return ZEND_NORMALIZE_BOOL(f->h - s->h);
} else if (!f->key) { /* f is numeric, s is not */
return -1;
} else if (s->nKeyLength == 0) { /* s is numeric, f is not */
} else if (!s->key) { /* s is numeric, f is not */
return 1;
} else { /* both strings */
return zend_binary_strcasecmp(f->arKey, f->nKeyLength, s->arKey, s->nKeyLength);
return zend_binary_strcasecmp(f->key->val, f->key->len, s->key->val, s->key->len);
}
}
/* }}} */
@@ -198,7 +201,7 @@ ZEND_API int zend_register_ini_entries(const zend_ini_entry *ini_entry, int modu
while (p->name) {
config_directive_success = 0;
if (zend_hash_add(directives, p->name, p->name_length, (void*)p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry) == FAILURE) {
if ((hashed_ini_entry = zend_hash_str_add_mem(directives, p->name, p->name_length, (void*)p, sizeof(zend_ini_entry))) == NULL) {
zend_unregister_ini_entries(module_number TSRMLS_CC);
return FAILURE;
}
@@ -223,13 +226,16 @@ ZEND_API int zend_register_ini_entries(const zend_ini_entry *ini_entry, int modu
ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC) /* {{{ */
{
zend_hash_apply_with_argument(registered_zend_ini_directives, (apply_func_arg_t) zend_remove_ini_entries, (void *) &module_number TSRMLS_CC);
zend_hash_apply_with_argument(registered_zend_ini_directives, zend_remove_ini_entries, (void *) &module_number TSRMLS_CC);
}
/* }}} */
#ifdef ZTS
static int zend_ini_refresh_cache(zend_ini_entry *p, int stage TSRMLS_DC) /* {{{ */
static int zend_ini_refresh_cache(zval *el, void *arg TSRMLS_DC) /* {{{ */
{
zend_ini_entry *p = (zend_ini_entry *)Z_PTR_P(el);
int stage = (int)(zend_intptr_t)arg;
if (p->on_modify) {
p->on_modify(p, p->value, p->value_length, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage TSRMLS_CC);
}
@@ -239,27 +245,27 @@ static int zend_ini_refresh_cache(zend_ini_entry *p, int stage TSRMLS_DC) /* {{{
ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC) /* {{{ */
{
zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) zend_ini_refresh_cache, (void *)(zend_intptr_t) stage TSRMLS_CC);
zend_hash_apply_with_argument(EG(ini_directives), zend_ini_refresh_cache, (void *)(zend_intptr_t) stage TSRMLS_CC);
}
/* }}} */
#endif
ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage) /* {{{ */
ZEND_API int zend_alter_ini_entry(zend_string *name, char *new_value, uint new_value_length, int modify_type, int stage) /* {{{ */
{
TSRMLS_FETCH();
return zend_alter_ini_entry_ex(name, name_length, new_value, new_value_length, modify_type, stage, 0 TSRMLS_CC);
return zend_alter_ini_entry_ex(name, new_value, new_value_length, modify_type, stage, 0 TSRMLS_CC);
}
/* }}} */
ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage, int force_change TSRMLS_DC) /* {{{ */
ZEND_API int zend_alter_ini_entry_ex(zend_string *name, char *new_value, uint new_value_length, int modify_type, int stage, int force_change TSRMLS_DC) /* {{{ */
{
zend_ini_entry *ini_entry;
char *duplicate;
zend_bool modifiable;
zend_bool modified;
if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == FAILURE) {
if ((ini_entry = zend_hash_find_ptr(EG(ini_directives), name)) == NULL) {
return FAILURE;
}
@@ -285,7 +291,7 @@ ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_val
ini_entry->orig_value_length = ini_entry->value_length;
ini_entry->orig_modifiable = modifiable;
ini_entry->modified = 1;
zend_hash_add(EG(modified_ini_directives), name, name_length, &ini_entry, sizeof(zend_ini_entry*), NULL);
zend_hash_add_ptr(EG(modified_ini_directives), name, ini_entry);
}
duplicate = estrndup(new_value, new_value_length);
@@ -306,19 +312,19 @@ ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_val
}
/* }}} */
ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage) /* {{{ */
ZEND_API int zend_restore_ini_entry(zend_string *name, int stage) /* {{{ */
{
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == FAILURE ||
if ((ini_entry = zend_hash_find_ptr(EG(ini_directives), name)) == NULL ||
(stage == ZEND_INI_STAGE_RUNTIME && (ini_entry->modifiable & ZEND_INI_USER) == 0)) {
return FAILURE;
}
if (EG(modified_ini_directives)) {
if (zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC) == 0) {
zend_hash_del(EG(modified_ini_directives), name, name_length);
zend_hash_del(EG(modified_ini_directives), name);
} else {
return FAILURE;
}
@@ -332,7 +338,8 @@ ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*di
{
zend_ini_entry *ini_entry;
if (zend_hash_find(registered_zend_ini_directives, name, name_length, (void **) &ini_entry) == FAILURE) {
ini_entry = zend_hash_str_find_ptr(registered_zend_ini_directives, name, name_length);
if (ini_entry == NULL) {
return FAILURE;
}
@@ -345,16 +352,17 @@ ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*di
* Data retrieval
*/
ZEND_API long zend_ini_long(char *name, uint name_length, int orig) /* {{{ */
ZEND_API zend_long zend_ini_long(char *name, uint name_length, int orig) /* {{{ */
{
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) {
ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name, name_length);
if (ini_entry) {
if (orig && ini_entry->modified) {
return (ini_entry->orig_value ? strtol(ini_entry->orig_value, NULL, 0) : 0);
return (ini_entry->orig_value ? ZEND_STRTOL(ini_entry->orig_value, NULL, 0) : 0);
} else {
return (ini_entry->value ? strtol(ini_entry->value, NULL, 0) : 0);
return (ini_entry->value ? ZEND_STRTOL(ini_entry->value, NULL, 0) : 0);
}
}
@@ -367,7 +375,8 @@ ZEND_API double zend_ini_double(char *name, uint name_length, int orig) /* {{{ *
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) {
ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name, name_length);
if (ini_entry) {
if (orig && ini_entry->modified) {
return (double) (ini_entry->orig_value ? zend_strtod(ini_entry->orig_value, NULL) : 0.0);
} else {
@@ -384,7 +393,8 @@ ZEND_API char *zend_ini_string_ex(char *name, uint name_length, int orig, zend_b
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) {
ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name, name_length);
if (ini_entry) {
if (exists) {
*exists = 1;
}
@@ -577,7 +587,7 @@ ZEND_API ZEND_INI_MH(OnUpdateBool) /* {{{ */
ZEND_API ZEND_INI_MH(OnUpdateLong) /* {{{ */
{
long *p;
zend_long *p;
#ifndef ZTS
char *base = (char *) mh_arg2;
#else
@@ -586,7 +596,7 @@ ZEND_API ZEND_INI_MH(OnUpdateLong) /* {{{ */
base = (char *) ts_resource(*((int *) mh_arg2));
#endif
p = (long *) (base+(size_t) mh_arg1);
p = (zend_long *) (base+(size_t) mh_arg1);
*p = zend_atol(new_value, new_value_length);
return SUCCESS;
@@ -595,7 +605,7 @@ ZEND_API ZEND_INI_MH(OnUpdateLong) /* {{{ */
ZEND_API ZEND_INI_MH(OnUpdateLongGEZero) /* {{{ */
{
long *p, tmp;
zend_long *p, tmp;
#ifndef ZTS
char *base = (char *) mh_arg2;
#else
@@ -609,7 +619,7 @@ ZEND_API ZEND_INI_MH(OnUpdateLongGEZero) /* {{{ */
return FAILURE;
}
p = (long *) (base+(size_t) mh_arg1);
p = (zend_long *) (base+(size_t) mh_arg1);
*p = tmp;
return SUCCESS;
+15 -45
View File
@@ -27,53 +27,23 @@
#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
#ifndef XtOffsetOf
# if defined(CRAY) || (defined(__ARMCC_VERSION) && !defined(LINUX))
# ifdef __STDC__
# define XtOffset(p_type, field) _Offsetof(p_type, field)
# else
# ifdef CRAY2
# define XtOffset(p_type, field) \
(sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
# else /* !CRAY2 */
# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field))
# endif /* !CRAY2 */
# endif /* __STDC__ */
# else /* ! (CRAY || __arm) */
# define XtOffset(p_type, field) \
((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
# endif /* !CRAY */
# ifdef offsetof
# define XtOffsetOf(s_type, field) offsetof(s_type, field)
# else
# define XtOffsetOf(s_type, field) XtOffset(s_type*, field)
# endif
#endif
#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC)
#define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type)
struct _zend_ini_entry {
int module_number;
int modifiable;
char *name;
char *name; // TODO: convert into zend_string ???
uint name_length;
ZEND_INI_MH((*on_modify));
void *mh_arg1;
void *mh_arg2;
void *mh_arg3;
char *value;
char *value; // TODO: convert into zend_string ???
uint value_length;
char *orig_value;
char *orig_value; // TODO: convert into zend_string ???
uint orig_value_length;
int orig_modifiable;
int modified;
@@ -94,12 +64,12 @@ ZEND_API void zend_ini_sort_entries(TSRMLS_D);
ZEND_API int zend_register_ini_entries(const zend_ini_entry *ini_entry, int module_number TSRMLS_DC);
ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC);
ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC);
ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage);
ZEND_API int zend_alter_ini_entry_ex(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage, int force_change TSRMLS_DC);
ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage);
ZEND_API int zend_alter_ini_entry(zend_string *name, char *new_value, uint new_value_length, int modify_type, int stage);
ZEND_API int zend_alter_ini_entry_ex(zend_string *name, char *new_value, uint new_value_length, int modify_type, int stage, int force_change TSRMLS_DC);
ZEND_API int zend_restore_ini_entry(zend_string *name, int stage);
ZEND_API void display_ini_entries(zend_module_entry *module);
ZEND_API long zend_ini_long(char *name, uint name_length, int orig);
ZEND_API zend_long zend_ini_long(char *name, uint name_length, int orig);
ZEND_API double zend_ini_double(char *name, uint name_length, int orig);
ZEND_API char *zend_ini_string(char *name, uint name_length, int orig);
ZEND_API char *zend_ini_string_ex(char *name, uint name_length, int orig, zend_bool *exists);
@@ -115,7 +85,7 @@ END_EXTERN_C()
#define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
#define ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, displayer) \
{ 0, modifiable, name, sizeof(name), on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, 0, displayer },
{ 0, modifiable, name, sizeof(name)-1, on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, 0, displayer },
#define ZEND_INI_ENTRY3(name, default_value, modifiable, on_modify, arg1, arg2, arg3) \
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, NULL)
@@ -154,21 +124,21 @@ END_EXTERN_C()
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb)
#endif
#define INI_INT(name) zend_ini_long((name), sizeof(name), 0)
#define INI_FLT(name) zend_ini_double((name), sizeof(name), 0)
#define INI_STR(name) zend_ini_string_ex((name), sizeof(name), 0, NULL)
#define INI_INT(name) zend_ini_long((name), sizeof(name)-1, 0)
#define INI_FLT(name) zend_ini_double((name), sizeof(name)-1, 0)
#define INI_STR(name) zend_ini_string_ex((name), sizeof(name)-1, 0, NULL)
#define INI_BOOL(name) ((zend_bool) INI_INT(name))
#define INI_ORIG_INT(name) zend_ini_long((name), sizeof(name), 1)
#define INI_ORIG_FLT(name) zend_ini_double((name), sizeof(name), 1)
#define INI_ORIG_STR(name) zend_ini_string((name), sizeof(name), 1)
#define INI_ORIG_INT(name) zend_ini_long((name), sizeof(name)-1, 1)
#define INI_ORIG_FLT(name) zend_ini_double((name), sizeof(name)-1, 1)
#define INI_ORIG_STR(name) zend_ini_string((name), sizeof(name)-1, 1)
#define INI_ORIG_BOOL(name) ((zend_bool) INI_ORIG_INT(name))
#define REGISTER_INI_ENTRIES() zend_register_ini_entries(ini_entries, module_number TSRMLS_CC)
#define UNREGISTER_INI_ENTRIES() zend_unregister_ini_entries(module_number TSRMLS_CC)
#define DISPLAY_INI_ENTRIES() display_ini_entries(zend_module)
#define REGISTER_INI_DISPLAYER(name, displayer) zend_ini_register_displayer((name), sizeof(name), displayer)
#define REGISTER_INI_DISPLAYER(name, displayer) zend_ini_register_displayer((name), sizeof(name)-1, displayer)
#define REGISTER_INI_BOOLEAN(name) REGISTER_INI_DISPLAYER(name, zend_ini_boolean_displayer_cb)
/* Standard message handlers */
+46 -47
View File
@@ -49,13 +49,14 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
{
int i_result;
int i_op1, i_op2;
int str_len;
char str_result[MAX_LENGTH_OF_LONG];
i_op1 = atoi(Z_STRVAL_P(op1));
free(Z_STRVAL_P(op1));
zend_string_free(Z_STR_P(op1));
if (op2) {
i_op2 = atoi(Z_STRVAL_P(op2));
free(Z_STRVAL_P(op2));
zend_string_free(Z_STR_P(op2));
} else {
i_op2 = 0;
}
@@ -81,11 +82,8 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
break;
}
Z_STRLEN_P(result) = zend_sprintf(str_result, "%d", i_result);
Z_STRVAL_P(result) = (char *) malloc(Z_STRLEN_P(result)+1);
memcpy(Z_STRVAL_P(result), str_result, Z_STRLEN_P(result));
Z_STRVAL_P(result)[Z_STRLEN_P(result)] = 0;
Z_TYPE_P(result) = IS_STRING;
str_len = zend_sprintf(str_result, "%d", i_result);
ZVAL_PSTRINGL(result, str_result, str_len);
}
/* }}} */
@@ -93,10 +91,7 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
*/
static void zend_ini_init_string(zval *result)
{
Z_STRVAL_P(result) = malloc(1);
Z_STRVAL_P(result)[0] = 0;
Z_STRLEN_P(result) = 0;
Z_TYPE_P(result) = IS_STRING;
ZVAL_EMPTY_PSTRING(result);
}
/* }}} */
@@ -104,13 +99,12 @@ static void zend_ini_init_string(zval *result)
*/
static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
{
int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2);
int op1_len = Z_STRLEN_P(op1);
int length = op1_len + Z_STRLEN_P(op2);
Z_STRVAL_P(result) = (char *) realloc(Z_STRVAL_P(op1), length+1);
memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2));
ZVAL_NEW_STR(result, zend_string_realloc(Z_STR_P(op1), length, 1));
memcpy(Z_STRVAL_P(result)+op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2));
Z_STRVAL_P(result)[length] = 0;
Z_STRLEN_P(result) = length;
Z_TYPE_P(result) = IS_STRING;
}
/* }}} */
@@ -118,18 +112,25 @@ static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
*/
static void zend_ini_get_constant(zval *result, zval *name TSRMLS_DC)
{
zval z_constant;
zval *c, tmp;
/* If name contains ':' it is not a constant. Bug #26893. */
if (!memchr(Z_STRVAL_P(name), ':', Z_STRLEN_P(name))
&& zend_get_constant(Z_STRVAL_P(name), Z_STRLEN_P(name), &z_constant TSRMLS_CC)) {
/* z_constant is emalloc()'d */
convert_to_string(&z_constant);
Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(z_constant), Z_STRLEN(z_constant));
Z_STRLEN_P(result) = Z_STRLEN(z_constant);
Z_TYPE_P(result) = Z_TYPE(z_constant);
zval_dtor(&z_constant);
free(Z_STRVAL_P(name));
&& (c = zend_get_constant(Z_STR_P(name) TSRMLS_CC)) != 0) {
if (Z_TYPE_P(c) != IS_STRING) {
ZVAL_COPY_VALUE(&tmp, c);
if (Z_OPT_CONSTANT(tmp)) {
zval_update_constant_ex(&tmp, 1, NULL TSRMLS_CC);
}
zval_opt_copy_ctor(&tmp);
convert_to_string(&tmp);
c = &tmp;
}
ZVAL_PSTRINGL(result, Z_STRVAL_P(c), Z_STRLEN_P(c));
if (c == &tmp) {
zval_dtor(&tmp);
}
zend_string_free(Z_STR_P(name));
} else {
*result = *name;
}
@@ -144,14 +145,12 @@ static void zend_ini_get_var(zval *result, zval *name TSRMLS_DC)
char *envvar;
/* Fetch configuration option value */
if (zend_get_configuration_directive(Z_STRVAL_P(name), Z_STRLEN_P(name)+1, &curval) == SUCCESS) {
Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(curval), Z_STRLEN(curval));
Z_STRLEN_P(result) = Z_STRLEN(curval);
if (zend_get_configuration_directive(Z_STRVAL_P(name), Z_STRLEN_P(name), &curval) == SUCCESS) {
ZVAL_PSTRINGL(result, Z_STRVAL(curval), Z_STRLEN(curval));
/* ..or if not found, try ENV */
} else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRLEN_P(name) TSRMLS_CC)) != NULL ||
(envvar = getenv(Z_STRVAL_P(name))) != NULL) {
Z_STRVAL_P(result) = strdup(envvar);
Z_STRLEN_P(result) = strlen(envvar);
ZVAL_PSTRING(result, envvar);
} else {
zend_ini_init_string(result);
}
@@ -160,7 +159,7 @@ static void zend_ini_get_var(zval *result, zval *name TSRMLS_DC)
/* {{{ ini_error()
*/
static void ini_error(char *msg)
static void ini_error(const char *msg)
{
char *error_buf;
int error_buf_len;
@@ -283,26 +282,26 @@ statement:
printf("SECTION: [%s]\n", Z_STRVAL($2));
#endif
ZEND_INI_PARSER_CB(&$2, NULL, NULL, ZEND_INI_PARSER_SECTION, ZEND_INI_PARSER_ARG TSRMLS_CC);
free(Z_STRVAL($2));
zend_string_release(Z_STR($2));
}
| TC_LABEL '=' string_or_value {
#if DEBUG_CFG_PARSER
printf("NORMAL: '%s' = '%s'\n", Z_STRVAL($1), Z_STRVAL($3));
#endif
ZEND_INI_PARSER_CB(&$1, &$3, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC);
free(Z_STRVAL($1));
free(Z_STRVAL($3));
zend_string_release(Z_STR($1));
zend_string_release(Z_STR($3));
}
| TC_OFFSET option_offset ']' '=' string_or_value {
#if DEBUG_CFG_PARSER
printf("OFFSET: '%s'[%s] = '%s'\n", Z_STRVAL($1), Z_STRVAL($2), Z_STRVAL($5));
#endif
ZEND_INI_PARSER_CB(&$1, &$5, &$2, ZEND_INI_PARSER_POP_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC);
free(Z_STRVAL($1));
free(Z_STRVAL($2));
free(Z_STRVAL($5));
zend_string_release(Z_STR($1));
zend_string_release(Z_STR($2));
zend_string_release(Z_STR($5));
}
| TC_LABEL { ZEND_INI_PARSER_CB(&$1, NULL, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC); free(Z_STRVAL($1)); }
| TC_LABEL { ZEND_INI_PARSER_CB(&$1, NULL, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC); zend_string_release(Z_STR($1)); }
| END_OF_LINE
;
@@ -324,8 +323,8 @@ option_offset:
;
encapsed_list:
encapsed_list cfg_var_ref { zend_ini_add_string(&$$, &$1, &$2); free(Z_STRVAL($2)); }
| encapsed_list TC_QUOTED_STRING { zend_ini_add_string(&$$, &$1, &$2); free(Z_STRVAL($2)); }
encapsed_list cfg_var_ref { zend_ini_add_string(&$$, &$1, &$2); zend_string_free(Z_STR($2)); }
| encapsed_list TC_QUOTED_STRING { zend_ini_add_string(&$$, &$1, &$2); zend_string_free(Z_STR($2)); }
| /* empty */ { zend_ini_init_string(&$$); }
;
@@ -333,18 +332,18 @@ var_string_list_section:
cfg_var_ref { $$ = $1; }
| constant_literal { $$ = $1; }
| '"' encapsed_list '"' { $$ = $2; }
| var_string_list_section cfg_var_ref { zend_ini_add_string(&$$, &$1, &$2); free(Z_STRVAL($2)); }
| var_string_list_section constant_literal { zend_ini_add_string(&$$, &$1, &$2); free(Z_STRVAL($2)); }
| var_string_list_section '"' encapsed_list '"' { zend_ini_add_string(&$$, &$1, &$3); free(Z_STRVAL($3)); }
| var_string_list_section cfg_var_ref { zend_ini_add_string(&$$, &$1, &$2); zend_string_free(Z_STR($2)); }
| var_string_list_section constant_literal { zend_ini_add_string(&$$, &$1, &$2); zend_string_free(Z_STR($2)); }
| var_string_list_section '"' encapsed_list '"' { zend_ini_add_string(&$$, &$1, &$3); zend_string_free(Z_STR($3)); }
;
var_string_list:
cfg_var_ref { $$ = $1; }
| constant_string { $$ = $1; }
| '"' encapsed_list '"' { $$ = $2; }
| var_string_list cfg_var_ref { zend_ini_add_string(&$$, &$1, &$2); free(Z_STRVAL($2)); }
| var_string_list constant_string { zend_ini_add_string(&$$, &$1, &$2); free(Z_STRVAL($2)); }
| var_string_list '"' encapsed_list '"' { zend_ini_add_string(&$$, &$1, &$3); free(Z_STRVAL($3)); }
| var_string_list cfg_var_ref { zend_ini_add_string(&$$, &$1, &$2); zend_string_free(Z_STR($2)); }
| var_string_list constant_string { zend_ini_add_string(&$$, &$1, &$2); zend_string_free(Z_STR($2)); }
| var_string_list '"' encapsed_list '"' { zend_ini_add_string(&$$, &$1, &$3); zend_string_free(Z_STR($3)); }
;
expr:
@@ -358,7 +357,7 @@ expr:
;
cfg_var_ref:
TC_DOLLAR_CURLY TC_VARNAME '}' { zend_ini_get_var(&$$, &$2 TSRMLS_CC); free(Z_STRVAL($2)); }
TC_DOLLAR_CURLY TC_VARNAME '}' { zend_ini_get_var(&$$, &$2 TSRMLS_CC); zend_string_free(Z_STR($2)); }
;
constant_literal:
+4660 -4663
View File
File diff suppressed because it is too large. Load diff
+6 -9
View File
@@ -131,11 +131,9 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
/* Eat trailing whitespace */
#define EAT_TRAILING_WHITESPACE() EAT_TRAILING_WHITESPACE_EX('X')
#define zend_ini_copy_value(retval, str, len) { \
Z_STRVAL_P(retval) = zend_strndup(str, len); \
Z_STRLEN_P(retval) = len; \
Z_TYPE_P(retval) = IS_STRING; \
}
#define zend_ini_copy_value(retval, str, len) \
ZVAL_NEW_STR(retval, zend_string_init(str, len, 1))
#define RETURN_TOKEN(type, str, len) { \
zend_ini_copy_value(ini_lval, str, len); \
@@ -144,7 +142,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
static void _yy_push_state(int new_state TSRMLS_DC)
{
zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION(), sizeof(int));
zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION());
YYSETCONDITION(new_state);
}
@@ -152,8 +150,7 @@ static void _yy_push_state(int new_state TSRMLS_DC)
static void yy_pop_state(TSRMLS_D)
{
int *stack_state;
zend_stack_top(&SCNG(state_stack), (void **) &stack_state);
int *stack_state = zend_stack_top(&SCNG(state_stack));
YYSETCONDITION(*stack_state);
zend_stack_del_top(&SCNG(state_stack));
}
@@ -187,7 +184,7 @@ static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC)
ini_filename = NULL;
}
zend_stack_init(&SCNG(state_stack));
zend_stack_init(&SCNG(state_stack), sizeof(int));
BEGIN(INITIAL);
return SUCCESS;
+13 -13
View File
@@ -1,13 +1,13 @@
/* Generated by re2c 0.13.5 */
#line 3 "Zend/zend_ini_scanner_defs.h"
enum YYCONDTYPE {
yycINITIAL,
yycST_OFFSET,
yycST_SECTION_VALUE,
yycST_VALUE,
yycST_SECTION_RAW,
yycST_DOUBLE_QUOTES,
yycST_VARNAME,
yycST_RAW,
};
/* Generated by re2c 0.13.5 */
#line 3 "Zend/zend_ini_scanner_defs.h"
enum YYCONDTYPE {
yycINITIAL,
yycST_OFFSET,
yycST_SECTION_VALUE,
yycST_VALUE,
yycST_SECTION_RAW,
yycST_DOUBLE_QUOTES,
yycST_VARNAME,
yycST_RAW,
};
+106 -98
View File
@@ -31,24 +31,27 @@ ZEND_API zend_class_entry *zend_ce_serializable;
/* {{{ zend_call_method
Only returns the returned zval if retval_ptr != NULL */
ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC)
ZEND_API zval* zend_call_method(zval *object, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, int function_name_len, zval *retval_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC)
{
int result;
zend_fcall_info fci;
zval z_fname;
zval *retval;
zval retval;
HashTable *function_table;
zval **params[2];
zval params[2];
params[0] = &arg1;
params[1] = &arg2;
if (param_count > 0) {
ZVAL_COPY_VALUE(&params[0], arg1);
}
if (param_count > 1) {
ZVAL_COPY_VALUE(&params[1], arg2);
}
fci.size = sizeof(fci);
/*fci.function_table = NULL; will be read form zend_class_entry of object if needed */
fci.object_ptr = object_pp ? *object_pp : NULL;
fci.function_name = &z_fname;
fci.retval_ptr_ptr = retval_ptr_ptr ? retval_ptr_ptr : &retval;
fci.object = (object && Z_TYPE_P(object) == IS_OBJECT) ? Z_OBJ_P(object) : NULL;
ZVAL_STRINGL(&fci.function_name, function_name, function_name_len);
fci.retval = retval_ptr ? retval_ptr : &retval;
fci.param_count = param_count;
fci.params = params;
fci.no_separation = 1;
@@ -57,15 +60,15 @@ ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend
if (!fn_proxy && !obj_ce) {
/* no interest in caching and no information already present that is
* needed later inside zend_call_function. */
ZVAL_STRINGL(&z_fname, function_name, function_name_len, 0);
fci.function_table = !object_pp ? EG(function_table) : NULL;
fci.function_table = !object ? EG(function_table) : NULL;
result = zend_call_function(&fci, NULL TSRMLS_CC);
zval_ptr_dtor(&fci.function_name);
} else {
zend_fcall_info_cache fcic;
fcic.initialized = 1;
if (!obj_ce) {
obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL;
obj_ce = object ? Z_OBJCE_P(object) : NULL;
}
if (obj_ce) {
function_table = &obj_ce->function_table;
@@ -73,9 +76,9 @@ ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend
function_table = EG(function_table);
}
if (!fn_proxy || !*fn_proxy) {
if (zend_hash_find(function_table, function_name, function_name_len+1, (void **) &fcic.function_handler) == FAILURE) {
if ((fcic.function_handler = zend_hash_find_ptr(function_table, Z_STR(fci.function_name))) == NULL) {
/* error at c-level */
zend_error(E_CORE_ERROR, "Couldn't find implementation for method %s%s%s", obj_ce ? obj_ce->name : "", obj_ce ? "::" : "", function_name);
zend_error(E_CORE_ERROR, "Couldn't find implementation for method %s%s%s", obj_ce ? obj_ce->name->val : "", obj_ce ? "::" : "", function_name);
}
if (fn_proxy) {
*fn_proxy = fcic.function_handler;
@@ -84,46 +87,50 @@ ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend
fcic.function_handler = *fn_proxy;
}
fcic.calling_scope = obj_ce;
if (object_pp) {
fcic.called_scope = Z_OBJCE_PP(object_pp);
if (object) {
fcic.called_scope = Z_OBJCE_P(object);
} else if (obj_ce &&
!(EG(called_scope) &&
instanceof_function(EG(called_scope), obj_ce TSRMLS_CC))) {
!(EG(current_execute_data) &&
EG(current_execute_data)->called_scope &&
instanceof_function(EG(current_execute_data)->called_scope, obj_ce TSRMLS_CC))) {
fcic.called_scope = obj_ce;
} else {
fcic.called_scope = EG(called_scope);
fcic.called_scope = EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL;
}
fcic.object_ptr = object_pp ? *object_pp : NULL;
fcic.object = object ? Z_OBJ_P(object) : NULL;
result = zend_call_function(&fci, &fcic TSRMLS_CC);
zval_ptr_dtor(&fci.function_name);
}
if (result == FAILURE) {
/* error at c-level */
if (!obj_ce) {
obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL;
obj_ce = object ? Z_OBJCE_P(object) : NULL;
}
if (!EG(exception)) {
zend_error(E_CORE_ERROR, "Couldn't execute method %s%s%s", obj_ce ? obj_ce->name : "", obj_ce ? "::" : "", function_name);
zend_error(E_CORE_ERROR, "Couldn't execute method %s%s%s", obj_ce ? obj_ce->name->val : "", obj_ce ? "::" : "", function_name);
}
}
if (!retval_ptr_ptr) {
if (retval) {
zval_ptr_dtor(&retval);
}
/* copy arguments back, they might be changed by references */
if (param_count > 0 && Z_ISREF(params[0]) && !Z_ISREF_P(arg1)) {
ZVAL_COPY_VALUE(arg1, &params[0]);
}
if (param_count > 1 && Z_ISREF(params[1]) && !Z_ISREF_P(arg2)) {
ZVAL_COPY_VALUE(arg2, &params[1]);
}
if (!retval_ptr) {
zval_ptr_dtor(&retval);
return NULL;
}
return *retval_ptr_ptr;
return retval_ptr;
}
/* }}} */
/* iterator interface, c-level functions used by engine */
/* {{{ zend_user_it_new_iterator */
ZEND_API zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRMLS_DC)
ZEND_API void zend_user_it_new_iterator(zend_class_entry *ce, zval *object, zval *retval TSRMLS_DC)
{
zval *retval;
return zend_call_method_with_0_params(&object, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval);
zend_call_method_with_0_params(object, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", retval);
}
/* }}} */
@@ -132,9 +139,9 @@ ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
if (iter->value) {
if (!Z_ISUNDEF(iter->value)) {
zval_ptr_dtor(&iter->value);
iter->value = NULL;
ZVAL_UNDEF(&iter->value);
}
}
/* }}} */
@@ -143,11 +150,10 @@ ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS
static void zend_user_it_dtor(zend_object_iterator *_iter TSRMLS_DC)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = (zval*)iter->it.data;
zval *object = &iter->it.data;
zend_user_it_invalidate_current(_iter TSRMLS_CC);
zval_ptr_dtor(&object);
efree(iter);
zval_ptr_dtor(object);
}
/* }}} */
@@ -156,13 +162,13 @@ ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC)
{
if (_iter) {
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = (zval*)iter->it.data;
zval *more;
zval *object = &iter->it.data;
zval more;
int result;
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_valid, "valid", &more);
if (more) {
result = i_zend_is_true(more);
zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_valid, "valid", &more);
if (Z_TYPE(more) != IS_UNDEF) {
result = i_zend_is_true(&more TSRMLS_CC);
zval_ptr_dtor(&more);
return result ? SUCCESS : FAILURE;
}
@@ -172,15 +178,15 @@ ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC)
/* }}} */
/* {{{ zend_user_it_get_current_data */
ZEND_API void zend_user_it_get_current_data(zend_object_iterator *_iter, zval ***data TSRMLS_DC)
ZEND_API zval *zend_user_it_get_current_data(zend_object_iterator *_iter TSRMLS_DC)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = (zval*)iter->it.data;
zval *object = &iter->it.data;
if (!iter->value) {
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_current, "current", &iter->value);
}
*data = &iter->value;
if (Z_ISUNDEF(iter->value)) {
zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_current, "current", &iter->value);
}
return &iter->value;
}
/* }}} */
@@ -198,30 +204,31 @@ static int zend_user_it_get_current_key_default(zend_object_iterator *_iter, cha
ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *key TSRMLS_DC)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = (zval*)iter->it.data;
zval *retval;
zval *object = &iter->it.data;
zval retval;
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_key, "key", &retval);
zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_key, "key", &retval);
if (retval) {
ZVAL_ZVAL(key, retval, 1, 1);
if (Z_TYPE(retval) != IS_UNDEF) {
ZVAL_ZVAL(key, &retval, 1, 1);
} else {
if (!EG(exception)) {
zend_error(E_WARNING, "Nothing returned from %s::key()", iter->ce->name);
zend_error(E_WARNING, "Nothing returned from %s::key()", iter->ce->name->val);
}
ZVAL_LONG(key, 0);
}
}
/* }}} */
/* {{{ zend_user_it_move_forward */
ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = (zval*)iter->it.data;
zval *object = &iter->it.data;
zend_user_it_invalidate_current(_iter TSRMLS_CC);
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_next, "next", NULL);
zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_next, "next", NULL);
}
/* }}} */
@@ -229,10 +236,10 @@ ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC)
ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = (zval*)iter->it.data;
zval *object = &iter->it.data;
zend_user_it_invalidate_current(_iter TSRMLS_CC);
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_rewind, "rewind", NULL);
zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_rewind, "rewind", NULL);
}
/* }}} */
@@ -257,11 +264,12 @@ static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zva
iterator = emalloc(sizeof(zend_user_iterator));
Z_ADDREF_P(object);
iterator->it.data = (void*)object;
zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC);
ZVAL_COPY(&iterator->it.data, object);
iterator->it.funcs = ce->iterator_funcs.funcs;
iterator->ce = Z_OBJCE_P(object);
iterator->value = NULL;
ZVAL_UNDEF(&iterator->value);
return (zend_object_iterator*)iterator;
}
/* }}} */
@@ -269,22 +277,23 @@ static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zva
/* {{{ zend_user_it_get_new_iterator */
ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
{
zval *iterator = zend_user_it_new_iterator(ce, object TSRMLS_CC);
zval iterator;
zend_object_iterator *new_iterator;
zend_class_entry *ce_it;
zend_class_entry *ce_it = iterator && Z_TYPE_P(iterator) == IS_OBJECT ? Z_OBJCE_P(iterator) : NULL;
zend_user_it_new_iterator(ce, object, &iterator TSRMLS_CC);
ce_it = (Z_TYPE(iterator) == IS_OBJECT &&
Z_OBJ_HT(iterator)->get_class_entry) ? Z_OBJCE(iterator) : NULL;
if (!ce_it || !ce_it->get_iterator || (ce_it->get_iterator == zend_user_it_get_new_iterator && iterator == object)) {
if (!ce_it || !ce_it->get_iterator || (ce_it->get_iterator == zend_user_it_get_new_iterator && Z_OBJ(iterator) == Z_OBJ_P(object))) {
if (!EG(exception)) {
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Objects returned by %s::getIterator() must be traversable or implement interface Iterator", ce ? ce->name : Z_OBJCE_P(object)->name);
}
if (iterator) {
zval_ptr_dtor(&iterator);
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Objects returned by %s::getIterator() must be traversable or implement interface Iterator", ce ? ce->name->val : Z_OBJCE_P(object)->name->val);
}
zval_ptr_dtor(&iterator);
return NULL;
}
new_iterator = ce_it->get_iterator(ce_it, iterator, by_ref TSRMLS_CC);
new_iterator = ce_it->get_iterator(ce_it, &iterator, by_ref TSRMLS_CC);
zval_ptr_dtor(&iterator);
return new_iterator;
}
@@ -294,7 +303,7 @@ ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *c
static int zend_implement_traversable(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC)
{
/* check that class_type is traversable at c-level or implements at least one of 'aggregate' and 'Iterator' */
zend_uint i;
uint32_t i;
if (class_type->get_iterator || (class_type->parent && class_type->parent->get_iterator)) {
return SUCCESS;
@@ -305,10 +314,10 @@ static int zend_implement_traversable(zend_class_entry *interface, zend_class_en
}
}
zend_error(E_CORE_ERROR, "Class %s must implement interface %s as part of either %s or %s",
class_type->name,
zend_ce_traversable->name,
zend_ce_iterator->name,
zend_ce_aggregate->name);
class_type->name->val,
zend_ce_traversable->name->val,
zend_ce_iterator->name->val,
zend_ce_aggregate->name->val);
return FAILURE;
}
/* }}} */
@@ -328,9 +337,9 @@ static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entr
for (i = 0; i < class_type->num_interfaces; i++) {
if (class_type->interfaces[i] == zend_ce_iterator) {
zend_error(E_ERROR, "Class %s cannot implement both %s and %s at the same time",
class_type->name,
interface->name,
zend_ce_iterator->name);
class_type->name->val,
interface->name->val,
zend_ce_iterator->name->val);
return FAILURE;
}
if (class_type->interfaces[i] == zend_ce_traversable) {
@@ -360,9 +369,9 @@ static int zend_implement_iterator(zend_class_entry *interface, zend_class_entry
/* c-level get_iterator cannot be changed */
if (class_type->get_iterator == zend_user_it_get_new_iterator) {
zend_error(E_ERROR, "Class %s cannot implement both %s and %s at the same time",
class_type->name,
interface->name,
zend_ce_aggregate->name);
class_type->name->val,
interface->name->val,
zend_ce_aggregate->name->val);
}
return FAILURE;
}
@@ -397,26 +406,26 @@ static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_en
/* }}}*/
/* {{{ zend_user_serialize */
ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC)
ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC)
{
zend_class_entry * ce = Z_OBJCE_P(object);
zval *retval;
zval retval;
int result;
zend_call_method_with_0_params(&object, ce, &ce->serialize_func, "serialize", &retval);
zend_call_method_with_0_params(object, ce, &ce->serialize_func, "serialize", &retval);
if (!retval || EG(exception)) {
if (Z_TYPE(retval) == IS_UNDEF || EG(exception)) {
result = FAILURE;
} else {
switch(Z_TYPE_P(retval)) {
switch(Z_TYPE(retval)) {
case IS_NULL:
/* we could also make this '*buf_len = 0' but this allows to skip variables */
zval_ptr_dtor(&retval);
return FAILURE;
case IS_STRING:
*buffer = (unsigned char*)estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
*buf_len = Z_STRLEN_P(retval);
*buffer = (unsigned char*)estrndup(Z_STRVAL(retval), Z_STRLEN(retval));
*buf_len = Z_STRLEN(retval);
result = SUCCESS;
break;
default: /* failure */
@@ -427,23 +436,22 @@ ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint
}
if (result == FAILURE && !EG(exception)) {
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "%s::serialize() must return a string or NULL", ce->name);
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "%s::serialize() must return a string or NULL", ce->name->val);
}
return result;
}
/* }}} */
/* {{{ zend_user_unserialize */
ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC)
ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC)
{
zval * zdata;
zval zdata;
object_init_ex(*object, ce);
object_init_ex(object, ce);
MAKE_STD_ZVAL(zdata);
ZVAL_STRINGL(zdata, (char*)buf, buf_len, 1);
ZVAL_STRINGL(&zdata, (char*)buf, buf_len);
zend_call_method_with_1_params(object, ce, &ce->unserialize_func, "unserialize", NULL, zdata);
zend_call_method_with_1_params(object, ce, &ce->unserialize_func, "unserialize", NULL, &zdata);
zval_ptr_dtor(&zdata);
@@ -455,17 +463,17 @@ ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const un
}
/* }}} */
ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */
ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Serialization of '%s' is not allowed", ce->name);
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Serialization of '%s' is not allowed", ce->name->val);
return FAILURE;
}
/* }}} */
ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */
ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */
{
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Unserialization of '%s' is not allowed", ce->name);
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Unserialization of '%s' is not allowed", ce->name->val);
return FAILURE;
}
/* }}} */
+8 -8
View File
@@ -35,10 +35,10 @@ extern ZEND_API zend_class_entry *zend_ce_serializable;
typedef struct _zend_user_iterator {
zend_object_iterator it;
zend_class_entry *ce;
zval *value;
zval value;
} zend_user_iterator;
ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC);
ZEND_API zval* zend_call_method(zval *object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, int function_name_len, zval *retval, int param_count, zval* arg1, zval* arg2 TSRMLS_DC);
#define zend_call_method_with_0_params(obj, obj_ce, fn_proxy, function_name, retval) \
zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 0, NULL, NULL TSRMLS_CC)
@@ -52,20 +52,20 @@ ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend
ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC);
ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC);
ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *key TSRMLS_DC);
ZEND_API void zend_user_it_get_current_data(zend_object_iterator *_iter, zval ***data TSRMLS_DC);
ZEND_API zval *zend_user_it_get_current_data(zend_object_iterator *_iter TSRMLS_DC);
ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC);
ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC);
ZEND_API zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRMLS_DC);
ZEND_API void zend_user_it_new_iterator(zend_class_entry *ce, zval *object, zval *iterator TSRMLS_DC);
ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
ZEND_API void zend_register_interfaces(TSRMLS_D);
ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC);
ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC);
ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC);
ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC);
ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC);
ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC);
ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC);
ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC);
END_EXTERN_C()
+23 -12
View File
@@ -24,8 +24,14 @@
static zend_class_entry zend_iterator_class_entry;
static void iter_wrapper_free(zend_object *object TSRMLS_DC);
static void iter_wrapper_dtor(zend_object *object TSRMLS_DC);
static zend_object_handlers iterator_object_handlers = {
ZEND_OBJECTS_STORE_HANDLERS,
0,
iter_wrapper_free,
iter_wrapper_dtor,
NULL,
NULL, /* prop read */
NULL, /* prop write */
NULL, /* read dim */
@@ -51,26 +57,31 @@ static zend_object_handlers iterator_object_handlers = {
ZEND_API void zend_register_iterator_wrapper(TSRMLS_D)
{
INIT_CLASS_ENTRY(zend_iterator_class_entry, "__iterator_wrapper", NULL);
str_free(zend_iterator_class_entry.name);
zend_iterator_class_entry.name = "__iterator_wrapper";
}
static void iter_wrapper_dtor(void *object, zend_object_handle handle TSRMLS_DC)
static void iter_wrapper_free(zend_object *object TSRMLS_DC)
{
zend_object_iterator *iter = (zend_object_iterator*)object;
iter->funcs->dtor(iter TSRMLS_CC);
}
ZEND_API zval *zend_iterator_wrap(zend_object_iterator *iter TSRMLS_DC)
static void iter_wrapper_dtor(zend_object *object TSRMLS_DC)
{
zval *wrapped;
}
MAKE_STD_ZVAL(wrapped);
Z_TYPE_P(wrapped) = IS_OBJECT;
Z_OBJ_HANDLE_P(wrapped) = zend_objects_store_put(iter, iter_wrapper_dtor, NULL, NULL TSRMLS_CC);
Z_OBJ_HT_P(wrapped) = &iterator_object_handlers;
ZEND_API void zend_iterator_init(zend_object_iterator *iter TSRMLS_DC)
{
zend_object_std_init(&iter->std, &zend_iterator_class_entry TSRMLS_CC);
iter->std.handlers = &iterator_object_handlers;
}
return wrapped;
ZEND_API void zend_iterator_dtor(zend_object_iterator *iter TSRMLS_DC)
{
if (--GC_REFCOUNT(iter) > 0) {
return;
}
zend_objects_store_del(&iter->std TSRMLS_CC);
}
ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap(
@@ -79,7 +90,7 @@ ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap(
switch (Z_TYPE_P(array_ptr)) {
case IS_OBJECT:
if (Z_OBJ_HT_P(array_ptr) == &iterator_object_handlers) {
*iter = (zend_object_iterator *)zend_object_store_get_object(array_ptr TSRMLS_CC);
*iter = (zend_object_iterator *)Z_OBJ_P(array_ptr);
return ZEND_ITER_OBJECT;
}
if (Z_OBJPROP_P(array_ptr)) {
+6 -4
View File
@@ -36,7 +36,7 @@ typedef struct _zend_object_iterator_funcs {
int (*valid)(zend_object_iterator *iter TSRMLS_DC);
/* fetch the item data for the current element */
void (*get_current_data)(zend_object_iterator *iter, zval ***data TSRMLS_DC);
zval *(*get_current_data)(zend_object_iterator *iter TSRMLS_DC);
/* fetch the key for the current element (optional, may be NULL). The key
* should be written into the provided zval* using the ZVAL_* macros. If
@@ -55,9 +55,10 @@ typedef struct _zend_object_iterator_funcs {
} zend_object_iterator_funcs;
struct _zend_object_iterator {
void *data;
zend_object std;
zval data;
zend_object_iterator_funcs *funcs;
ulong index; /* private to fe_reset/fe_fetch opcodes */
zend_ulong index; /* private to fe_reset/fe_fetch opcodes */
};
typedef struct _zend_class_iterator_funcs {
@@ -82,7 +83,8 @@ BEGIN_EXTERN_C()
ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap(zval *array_ptr, zend_object_iterator **iter TSRMLS_DC);
/* given an iterator, wrap it up as a zval for use by the engine opcodes */
ZEND_API zval *zend_iterator_wrap(zend_object_iterator *iter TSRMLS_DC);
ZEND_API void zend_iterator_init(zend_object_iterator *iter TSRMLS_DC);
ZEND_API void zend_iterator_dtor(zend_object_iterator *iter TSRMLS_DC);
ZEND_API void zend_register_iterator_wrapper(TSRMLS_D);
END_EXTERN_C()
+20 -20
View File
@@ -571,8 +571,8 @@ parameter:
optional_class_type:
/* empty */ { $$.op_type = IS_UNUSED; }
| T_ARRAY { $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_ARRAY; }
| T_CALLABLE { $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_CALLABLE; }
| T_ARRAY { $$.op_type = IS_CONST; Z_TYPE_INFO($$.u.constant)=IS_ARRAY; }
| T_CALLABLE { $$.op_type = IS_CONST; Z_TYPE_INFO($$.u.constant)=IS_CALLABLE; }
| fully_qualified_class_name { $$ = $1; }
;
@@ -611,9 +611,9 @@ global_var:
static_var_list:
static_var_list ',' T_VARIABLE { zend_do_fetch_static_variable(&$3, NULL, ZEND_FETCH_STATIC TSRMLS_CC); }
| static_var_list ',' T_VARIABLE '=' static_scalar { zend_do_fetch_static_variable(&$3, &$5, ZEND_FETCH_STATIC TSRMLS_CC); }
| static_var_list ',' T_VARIABLE '=' static_scalar { Z_CONST_FLAGS($5.u.constant) = 0; zend_do_fetch_static_variable(&$3, &$5, ZEND_FETCH_STATIC TSRMLS_CC); }
| T_VARIABLE { zend_do_fetch_static_variable(&$1, NULL, ZEND_FETCH_STATIC TSRMLS_CC); }
| T_VARIABLE '=' static_scalar { zend_do_fetch_static_variable(&$1, &$3, ZEND_FETCH_STATIC TSRMLS_CC); }
| T_VARIABLE '=' static_scalar { Z_CONST_FLAGS($3.u.constant) = 0; zend_do_fetch_static_variable(&$1, &$3, ZEND_FETCH_STATIC TSRMLS_CC); }
;
@@ -667,8 +667,8 @@ trait_precedence:
;
trait_reference_list:
fully_qualified_class_name { zend_resolve_class_name(&$1 TSRMLS_CC); zend_init_list(&$$.u.op.ptr, Z_STRVAL($1.u.constant) TSRMLS_CC); }
| trait_reference_list ',' fully_qualified_class_name { zend_resolve_class_name(&$3 TSRMLS_CC); zend_add_to_list(&$1.u.op.ptr, Z_STRVAL($3.u.constant) TSRMLS_CC); $$ = $1; }
fully_qualified_class_name { zend_resolve_class_name(&$1 TSRMLS_CC); zend_init_list(&$$.u.op.ptr, Z_STR($1.u.constant) TSRMLS_CC); }
| trait_reference_list ',' fully_qualified_class_name { zend_resolve_class_name(&$3 TSRMLS_CC); zend_add_to_list(&$1.u.op.ptr, Z_STR($3.u.constant) TSRMLS_CC); $$ = $1; }
;
trait_method_reference:
@@ -738,7 +738,7 @@ echo_expr_list:
for_expr:
/* empty */ { $$.op_type = IS_CONST; Z_TYPE($$.u.constant) = IS_BOOL; Z_LVAL($$.u.constant) = 1; }
/* empty */ { $$.op_type = IS_CONST; ZVAL_BOOL(&$$.u.constant, 1); }
| non_empty_for_expr { $$ = $1; }
;
@@ -812,8 +812,8 @@ expr_without_variable:
| expr '%' expr { zend_do_binary_op(ZEND_MOD, &$$, &$1, &$3 TSRMLS_CC); }
| expr T_SL expr { zend_do_binary_op(ZEND_SL, &$$, &$1, &$3 TSRMLS_CC); }
| expr T_SR expr { zend_do_binary_op(ZEND_SR, &$$, &$1, &$3 TSRMLS_CC); }
| '+' expr %prec T_INC { ZVAL_LONG(&$1.u.constant, 0); if ($2.op_type == IS_CONST) { add_function(&$2.u.constant, &$1.u.constant, &$2.u.constant TSRMLS_CC); $$ = $2; } else { $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_ADD, &$$, &$1, &$2 TSRMLS_CC); } }
| '-' expr %prec T_INC { ZVAL_LONG(&$1.u.constant, 0); if ($2.op_type == IS_CONST) { sub_function(&$2.u.constant, &$1.u.constant, &$2.u.constant TSRMLS_CC); $$ = $2; } else { $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_SUB, &$$, &$1, &$2 TSRMLS_CC); } }
| '+' expr %prec T_INC { ZVAL_LONG(&$1.u.constant, 0); if ($2.op_type == IS_CONST) { add_function(&$2.u.constant, &$1.u.constant, &$2.u.constant TSRMLS_CC); $$ = $2; } else { $1.op_type = IS_CONST; zend_do_binary_op(ZEND_ADD, &$$, &$1, &$2 TSRMLS_CC); } }
| '-' expr %prec T_INC { ZVAL_LONG(&$1.u.constant, 0); if ($2.op_type == IS_CONST) { sub_function(&$2.u.constant, &$1.u.constant, &$2.u.constant TSRMLS_CC); $$ = $2; } else { $1.op_type = IS_CONST; zend_do_binary_op(ZEND_SUB, &$$, &$1, &$2 TSRMLS_CC); } }
| '!' expr { zend_do_unary_op(ZEND_BOOL_NOT, &$$, &$2 TSRMLS_CC); }
| '~' expr { zend_do_unary_op(ZEND_BW_NOT, &$$, &$2 TSRMLS_CC); }
| expr T_IS_IDENTICAL expr { zend_do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 TSRMLS_CC); }
@@ -839,7 +839,7 @@ expr_without_variable:
| T_STRING_CAST expr { zend_do_cast(&$$, &$2, IS_STRING TSRMLS_CC); }
| T_ARRAY_CAST expr { zend_do_cast(&$$, &$2, IS_ARRAY TSRMLS_CC); }
| T_OBJECT_CAST expr { zend_do_cast(&$$, &$2, IS_OBJECT TSRMLS_CC); }
| T_BOOL_CAST expr { zend_do_cast(&$$, &$2, IS_BOOL TSRMLS_CC); }
| T_BOOL_CAST expr { zend_do_cast(&$$, &$2, _IS_BOOL TSRMLS_CC); }
| T_UNSET_CAST expr { zend_do_cast(&$$, &$2, IS_NULL TSRMLS_CC); }
| T_EXIT exit_expr { zend_do_exit(&$$, &$2 TSRMLS_CC); }
| '@' { zend_do_begin_silence(&$1 TSRMLS_CC); } expr { zend_do_end_silence(&$1 TSRMLS_CC); $$ = $3; }
@@ -912,16 +912,16 @@ function_call:
;
class_name:
T_STATIC { $$.op_type = IS_CONST; ZVAL_STRINGL(&$$.u.constant, "static", sizeof("static")-1, 1);}
T_STATIC { $$.op_type = IS_CONST; ZVAL_STRINGL(&$$.u.constant, "static", sizeof("static")-1);}
| namespace_name { $$ = $1; }
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); }
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); $$ = $2; }
| T_NS_SEPARATOR namespace_name { zval tmp; ZVAL_NEW_STR(&tmp, zend_string_alloc(Z_STRLEN($2.u.constant)+1, 0)); Z_STRVAL(tmp)[0] = '\\'; memcpy(Z_STRVAL(tmp) + 1, Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); if (Z_DELREF($2.u.constant) == 0) {efree(Z_STR($2.u.constant));} Z_STR($2.u.constant) = Z_STR(tmp); $$ = $2; }
;
fully_qualified_class_name:
namespace_name { $$ = $1; }
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); }
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); $$ = $2; }
| T_NS_SEPARATOR namespace_name { zval tmp; ZVAL_NEW_STR(&tmp, zend_string_alloc(Z_STRLEN($2.u.constant)+1, 0)); Z_STRVAL(tmp)[0] = '\\'; memcpy(Z_STRVAL(tmp) + 1, Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); if (Z_DELREF($2.u.constant) == 0) {efree(Z_STR($2.u.constant));} Z_STR($2.u.constant) = Z_STR(tmp); $$ = $2; }
;
@@ -957,7 +957,7 @@ exit_expr:
;
backticks_expr:
/* empty */ { ZVAL_EMPTY_STRING(&$$.u.constant); INIT_PZVAL(&$$.u.constant); $$.op_type = IS_CONST; }
/* empty */ { ZVAL_EMPTY_STRING(&$$.u.constant); $$.op_type = IS_CONST; }
| T_ENCAPSED_AND_WHITESPACE { $$ = $1; }
| encaps_list { $$ = $1; }
;
@@ -981,7 +981,7 @@ common_scalar:
| T_FUNC_C { $$ = $1; }
| T_NS_C { $$ = $1; }
| T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { $$ = $2; }
| T_START_HEREDOC T_END_HEREDOC { ZVAL_EMPTY_STRING(&$$.u.constant); INIT_PZVAL(&$$.u.constant); $$.op_type = IS_CONST; }
| T_START_HEREDOC T_END_HEREDOC { ZVAL_EMPTY_STRING(&$$.u.constant); $$.op_type = IS_CONST; }
;
static_class_constant:
@@ -997,7 +997,7 @@ static_scalar_value:
| static_class_name_scalar { $$.u.ast = zend_ast_create_constant(&$1.u.constant); }
| namespace_name { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_CT, 1 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); $3 = $$; zend_do_fetch_constant(&$$, NULL, &$3, ZEND_CT, 0 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_CT, 0 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
| T_NS_SEPARATOR namespace_name { zval tmp; ZVAL_NEW_STR(&tmp, zend_string_alloc(Z_STRLEN($2.u.constant)+1, 0)); Z_STRVAL(tmp)[0] = '\\'; memcpy(Z_STRVAL(tmp) + 1, Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); if (Z_DELREF($2.u.constant) == 0) {efree(Z_STR($2.u.constant));} Z_STR($2.u.constant) = Z_STR(tmp); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_CT, 0 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; }
| '[' static_array_pair_list ']' { $$ = $2; }
| static_class_constant { $$.u.ast = zend_ast_create_constant(&$1.u.constant); }
@@ -1045,7 +1045,7 @@ general_constant:
class_constant { $$ = $1; }
| namespace_name { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_RT, 1 TSRMLS_CC); }
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); $3 = $$; zend_do_fetch_constant(&$$, NULL, &$3, ZEND_RT, 0 TSRMLS_CC); }
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_RT, 0 TSRMLS_CC); }
| T_NS_SEPARATOR namespace_name { zval tmp; ZVAL_NEW_STR(&tmp, zend_string_alloc(Z_STRLEN($2.u.constant)+1, 0)); Z_STRVAL(tmp)[0] = '\\'; memcpy(Z_STRVAL(tmp) + 1, Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); if (Z_DELREF($2.u.constant) == 0) {efree(Z_STR($2.u.constant));} Z_STR($2.u.constant) = Z_STR(tmp); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_RT, 0 TSRMLS_CC); }
;
scalar:
@@ -1059,7 +1059,7 @@ scalar:
;
static_array_pair_list:
/* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
/* empty */ { $$.op_type = IS_CONST; array_init(&$$.u.constant); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
| non_empty_static_array_pair_list possible_comma { zend_ast_dynamic_shrink(&$1.u.ast); $$ = $1; }
;
@@ -1221,8 +1221,8 @@ assignment_list_element:
array_pair_list:
/* empty */ { zend_do_init_array(&$$, NULL, NULL, 0 TSRMLS_CC); }
| non_empty_array_pair_list possible_comma { $$ = $1; }
/* empty */ { zend_do_init_array(&$$, NULL, NULL, 0 TSRMLS_CC); zend_do_end_array(&$$, &$$ TSRMLS_CC); }
| non_empty_array_pair_list possible_comma { zend_do_end_array(&$$, &$1 TSRMLS_CC); }
;
non_empty_array_pair_list:
+7875 -7857
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -35,7 +35,7 @@ typedef struct _zend_lex_state {
zend_file_handle *in;
uint lineno;
char *filename;
zend_string *filename;
/* original (unfiltered) script */
unsigned char *script_org;
+137 -110
View File
@@ -112,9 +112,9 @@ do { \
} \
}
/* To save initial string length after scanning to first variable, CG(doc_comment_len) can be reused */
#define SET_DOUBLE_QUOTES_SCANNED_LENGTH(len) CG(doc_comment_len) = (len)
#define GET_DOUBLE_QUOTES_SCANNED_LENGTH() CG(doc_comment_len)
/* To save initial string length after scanning to first variable */
#define SET_DOUBLE_QUOTES_SCANNED_LENGTH(len) SCNG(scanned_string_len) = (len)
#define GET_DOUBLE_QUOTES_SCANNED_LENGTH() SCNG(scanned_string_len)
#define IS_LABEL_START(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z') || (c) == '_' || (c) >= 0x7F)
@@ -152,7 +152,7 @@ internal_encoding, zend_multibyte_encoding_utf8 TSRMLS_CC);
static void _yy_push_state(int new_state TSRMLS_DC)
{
zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION(), sizeof(int));
zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION());
YYSETCONDITION(new_state);
}
@@ -160,8 +160,7 @@ static void _yy_push_state(int new_state TSRMLS_DC)
static void yy_pop_state(TSRMLS_D)
{
int *stack_state;
zend_stack_top(&SCNG(state_stack), (void **) &stack_state);
int *stack_state = zend_stack_top(&SCNG(state_stack));
YYSETCONDITION(*stack_state);
zend_stack_del_top(&SCNG(state_stack));
}
@@ -179,8 +178,7 @@ void startup_scanner(TSRMLS_D)
{
CG(parse_error) = 0;
CG(doc_comment) = NULL;
CG(doc_comment_len) = 0;
zend_stack_init(&SCNG(state_stack));
zend_stack_init(&SCNG(state_stack), sizeof(int));
zend_ptr_stack_init(&SCNG(heredoc_label_stack));
}
@@ -207,7 +205,7 @@ ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
lex_state->yy_limit = SCNG(yy_limit);
lex_state->state_stack = SCNG(state_stack);
zend_stack_init(&SCNG(state_stack));
zend_stack_init(&SCNG(state_stack), sizeof(int));
lex_state->heredoc_label_stack = SCNG(heredoc_label_stack);
zend_ptr_stack_init(&SCNG(heredoc_label_stack));
@@ -479,6 +477,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
const char *file_path = NULL;
char *buf;
size_t size, offset = 0;
zend_string *compiled_filename;
/* The shebang line was read, get the current position to obtain the buffer start */
if (CG(start_lineno) == 2 && file_handle->type == ZEND_HANDLE_FP && file_handle->handle.fp) {
@@ -534,7 +533,9 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
file_path = file_handle->filename;
}
zend_set_compiled_filename(file_path TSRMLS_CC);
compiled_filename = zend_string_init(file_path, strlen(file_path), 0);
zend_set_compiled_filename(compiled_filename TSRMLS_CC);
zend_string_release(compiled_filename);
if (CG(start_lineno)) {
CG(zend_lineno) = CG(start_lineno);
@@ -562,7 +563,6 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
zend_bool original_in_compilation = CG(in_compilation);
retval_znode.op_type = IS_CONST;
INIT_PZVAL(&retval_znode.u.constant);
ZVAL_LONG(&retval_znode.u.constant, 1);
zend_save_lexical_state(&original_lex_state TSRMLS_CC);
@@ -581,7 +581,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
CG(in_compilation) = 1;
CG(active_op_array) = op_array;
zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context)));
zend_stack_push(&CG(context_stack), (void *) &CG(context));
zend_init_compiler_context(TSRMLS_C);
compiler_result = zendparse(TSRMLS_C);
zend_do_return(&retval_znode, 0 TSRMLS_CC);
@@ -614,7 +614,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
zend_op_array *retval;
char *opened_path = NULL;
if (filename->type != IS_STRING) {
if (Z_TYPE_P(filename) != IS_STRING) {
tmp = *filename;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
@@ -628,13 +628,11 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
retval = zend_compile_file(&file_handle, type TSRMLS_CC);
if (retval && file_handle.handle.stream.handle) {
int dummy = 1;
if (!file_handle.opened_path) {
file_handle.opened_path = opened_path = estrndup(Z_STRVAL_P(filename), Z_STRLEN_P(filename));
}
zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL);
zend_hash_str_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path));
if (opened_path) {
efree(opened_path);
@@ -651,17 +649,20 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC)
{
char *buf;
size_t size;
size_t size, old_len;
zend_string *new_compiled_filename;
/* enforce ZEND_MMAP_AHEAD trailing NULLs for flex... */
Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), Z_STRLEN_P(str) + ZEND_MMAP_AHEAD);
memset(Z_STRVAL_P(str) + Z_STRLEN_P(str), 0, ZEND_MMAP_AHEAD);
old_len = Z_STRLEN_P(str);
Z_STR_P(str) = zend_string_realloc(Z_STR_P(str), old_len + ZEND_MMAP_AHEAD, 0);
Z_TYPE_INFO_P(str) = IS_STRING_EX;
memset(Z_STRVAL_P(str) + old_len, 0, ZEND_MMAP_AHEAD + 1);
SCNG(yy_in) = NULL;
SCNG(yy_start) = NULL;
buf = Z_STRVAL_P(str);
size = Z_STRLEN_P(str);
size = old_len;
if (CG(multibyte)) {
SCNG(script_org) = (unsigned char*)buf;
@@ -682,7 +683,9 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
yy_scan_buffer(buf, size TSRMLS_CC);
zend_set_compiled_filename(filename TSRMLS_CC);
new_compiled_filename = zend_string_init(filename, strlen(filename), 0);
zend_set_compiled_filename(new_compiled_filename TSRMLS_CC);
zend_string_release(new_compiled_filename);
CG(zend_lineno) = 1;
CG(increment_lineno) = 0;
RESET_DOC_COMMENT();
@@ -729,8 +732,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
CG(in_compilation) = 1;
tmp = *source_string;
zval_copy_ctor(&tmp);
ZVAL_DUP(&tmp, source_string);
convert_to_string(&tmp);
source_string = &tmp;
@@ -745,7 +747,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
CG(interactive) = orig_interactive;
CG(active_op_array) = op_array;
zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context)));
zend_stack_push(&CG(context_stack), (void *) &CG(context));
zend_init_compiler_context(TSRMLS_C);
BEGIN(ST_IN_SCRIPTING);
compiler_result = zendparse(TSRMLS_C);
@@ -844,6 +846,9 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter
zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected "
"encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
}
if (SCNG(script_filtered)) {
efree(SCNG(script_filtered));
}
SCNG(script_filtered) = new_yy_start;
SCNG(script_filtered_size) = length;
}
@@ -857,22 +862,33 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter
}
// TODO: avoid reallocation ???
# define zend_copy_value(zendlval, yytext, yyleng) \
if (SCNG(output_filter)) { \
size_t sz = 0; \
SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \
Z_STRLEN_P(zendlval) = sz; \
char *s = NULL; \
SCNG(output_filter)((unsigned char **)&s, &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \
ZVAL_STRINGL(zendlval, s, sz); \
efree(s); \
} else { \
Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng); \
Z_STRLEN_P(zendlval) = yyleng; \
ZVAL_STRINGL(zendlval, yytext, yyleng); \
}
// TODO: some extensions might need content, but we don't copy it intentional ???
#if 0
# define DUMMY_STRINGL(zendlval, yytext, yyleng) \
ZVAL_STRINGL(zendlval, yytext, yyleng)
#else
# define DUMMY_STRINGL(zendlval, yytext, yyleng) \
ZVAL_EMPTY_STRING(zendlval)
#endif
static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type TSRMLS_DC)
{
register char *s, *t;
char *end;
ZVAL_STRINGL(zendlval, str, len, 1);
ZVAL_STRINGL(zendlval, str, len);
/* convert escape sequences */
s = t = Z_STRVAL_P(zendlval);
@@ -939,7 +955,7 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
hex_buf[1] = *(++s);
Z_STRLEN_P(zendlval)--;
}
*t++ = (char) strtol(hex_buf, NULL, 16);
*t++ = (char) ZEND_STRTOL(hex_buf, NULL, 16);
} else {
*t++ = '\\';
*t++ = *s;
@@ -960,7 +976,7 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
Z_STRLEN_P(zendlval)--;
}
}
*t++ = (char) strtol(octal_buf, NULL, 8);
*t++ = (char) ZEND_STRTOL(octal_buf, NULL, 8);
} else {
*t++ = '\\';
*t++ = *s;
@@ -979,10 +995,13 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
*t = 0;
if (SCNG(output_filter)) {
size_t sz = 0;
unsigned char *str;
// TODO: avoid realocation ???
s = Z_STRVAL_P(zendlval);
SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC);
Z_STRLEN_P(zendlval) = sz;
efree(s);
SCNG(output_filter)(&str, &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC);
zval_ptr_dtor(zendlval);
ZVAL_STRINGL(zendlval, str, sz);
efree(str);
}
}
@@ -1173,7 +1192,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING,ST_LOOKING_FOR_PROPERTY>{WHITESPACE}+ {
ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
DUMMY_STRINGL(zendlval, yytext, yyleng);
HANDLE_NEWLINES(yytext, yyleng);
return T_WHITESPACE;
}
@@ -1185,7 +1204,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_LOOKING_FOR_PROPERTY>{LABEL} {
yy_pop_state(TSRMLS_C);
zend_copy_value(zendlval, yytext, yyleng);
zendlval->type = IS_STRING;
return T_STRING;
}
@@ -1480,7 +1498,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_LOOKING_FOR_VARNAME>{LABEL}[[}] {
yyless(yyleng - 1);
zend_copy_value(zendlval, yytext, yyleng);
zendlval->type = IS_STRING;
yy_pop_state(TSRMLS_C);
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
return T_STRING_VARNAME;
@@ -1504,13 +1521,12 @@ NEWLINE ("\r"|"\n"|"\r\n")
--len;
}
if (len < SIZEOF_LONG * 8) {
if (len < SIZEOF_ZEND_LONG * 8) {
if (len == 0) {
Z_LVAL_P(zendlval) = 0;
ZVAL_LONG(zendlval, 0);
} else {
Z_LVAL_P(zendlval) = strtol(bin, NULL, 2);
ZVAL_LONG(zendlval, ZEND_STRTOL(bin, NULL, 2));
}
zendlval->type = IS_LONG;
return T_LNUMBER;
} else {
ZVAL_DOUBLE(zendlval, zend_bin_strtod(bin, NULL));
@@ -1520,22 +1536,19 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_IN_SCRIPTING>{LNUM} {
if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0);
ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, NULL, 0));
} else {
errno = 0;
Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0);
ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, NULL, 0));
if (errno == ERANGE) { /* Overflow */
if (yytext[0] == '0') { /* octal overflow */
Z_DVAL_P(zendlval) = zend_oct_strtod(yytext, NULL);
ZVAL_DOUBLE(zendlval, zend_oct_strtod(yytext, NULL));
} else {
Z_DVAL_P(zendlval) = zend_strtod(yytext, NULL);
ZVAL_DOUBLE(zendlval, zend_strtod(yytext, NULL));
}
zendlval->type = IS_DOUBLE;
return T_DNUMBER;
}
}
zendlval->type = IS_LONG;
return T_LNUMBER;
}
@@ -1549,13 +1562,12 @@ NEWLINE ("\r"|"\n"|"\r\n")
len--;
}
if (len < SIZEOF_LONG * 2 || (len == SIZEOF_LONG * 2 && *hex <= '7')) {
if (len < SIZEOF_ZEND_LONG * 2 || (len == SIZEOF_ZEND_LONG * 2 && *hex <= '7')) {
if (len == 0) {
Z_LVAL_P(zendlval) = 0;
ZVAL_LONG(zendlval, 0);
} else {
Z_LVAL_P(zendlval) = strtol(hex, NULL, 16);
ZVAL_LONG(zendlval, ZEND_STRTOL(hex, NULL, 16));
}
zendlval->type = IS_LONG;
return T_LNUMBER;
} else {
ZVAL_DOUBLE(zendlval, zend_hex_strtod(hex, NULL));
@@ -1565,15 +1577,15 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_VAR_OFFSET>[0]|([1-9][0-9]*) { /* Offset could be treated as a long */
if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) {
ZVAL_LONG(zendlval, strtol(yytext, NULL, 10));
ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, NULL, 10));
} else {
ZVAL_STRINGL(zendlval, yytext, yyleng, 1);
ZVAL_STRINGL(zendlval, yytext, yyleng);
}
return T_NUM_STRING;
}
<ST_VAR_OFFSET>{LNUM}|{HNUM}|{BNUM} { /* Offset must be treated as a string */
ZVAL_STRINGL(zendlval, yytext, yyleng, 1);
ZVAL_STRINGL(zendlval, yytext, yyleng);
return T_NUM_STRING;
}
@@ -1587,12 +1599,11 @@ NEWLINE ("\r"|"\n"|"\r\n")
if (ce && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) {
/* We create a special __CLASS__ constant that is going to be resolved
at run-time */
Z_STRLEN_P(zendlval) = sizeof("__CLASS__")-1;
Z_STRVAL_P(zendlval) = estrndup("__CLASS__", Z_STRLEN_P(zendlval));
zendlval->type = IS_CONSTANT;
ZVAL_STRINGL(zendlval, "__CLASS__", sizeof("__CLASS__") - 1);
Z_TYPE_INFO_P(zendlval) = IS_CONSTANT_EX;
} else {
if (ce && ce->name) {
ZVAL_STRINGL(zendlval, ce->name, ce->name_length, 1);
ZVAL_STR(zendlval, zend_string_copy(ce->name));
} else {
ZVAL_EMPTY_STRING(zendlval);
}
@@ -1603,7 +1614,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_IN_SCRIPTING>"__TRAIT__" {
zend_class_entry *ce = CG(active_class_entry);
if (ce && ce->name && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) {
ZVAL_STRINGL(zendlval, ce->name, ce->name_length, 1);
ZVAL_STR(zendlval, zend_string_copy(ce->name));
} else {
ZVAL_EMPTY_STRING(zendlval);
}
@@ -1613,7 +1624,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_IN_SCRIPTING>"__FUNCTION__" {
zend_op_array *op_array = CG(active_op_array);
if (op_array && op_array->function_name) {
ZVAL_STRING(zendlval, op_array->function_name, 1);
ZVAL_STR(zendlval, zend_string_copy(op_array->function_name));
} else {
ZVAL_EMPTY_STRING(zendlval);
}
@@ -1621,15 +1632,34 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING>"__METHOD__" {
const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL;
const char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL;
if (CG(active_class_entry)) {
int len = 0;
Z_STRLEN_P(zendlval) = zend_spprintf(&Z_STRVAL_P(zendlval), 0, "%s%s%s",
class_name ? class_name : "",
class_name && func_name ? "::" : "",
func_name ? func_name : ""
);
zendlval->type = IS_STRING;
if (CG(active_class_entry)->name) {
len += CG(active_class_entry)->name->len;
}
if (CG(active_op_array) && CG(active_op_array)->function_name) {
len += sizeof("::")-1;
len += CG(active_op_array)->function_name->len;
}
ZVAL_NEW_STR(zendlval, zend_string_alloc(len, 0));
len = 0;
if (CG(active_class_entry)->name) {
memcpy(Z_STRVAL_P(zendlval), CG(active_class_entry)->name->val, CG(active_class_entry)->name->len);
len += CG(active_class_entry)->name->len;
}
if (CG(active_op_array) && CG(active_op_array)->function_name) {
memcpy(Z_STRVAL_P(zendlval) + len, "::", sizeof("::")-1);
len += sizeof("::")-1;
memcpy(Z_STRVAL_P(zendlval) + len, CG(active_op_array)->function_name->val, CG(active_op_array)->function_name->len);
len += CG(active_op_array)->function_name->len;
}
Z_STRVAL_P(zendlval)[len] = 0;
} else if (CG(active_op_array) && CG(active_op_array)->function_name) {
ZVAL_STR(zendlval, zend_string_copy(CG(active_op_array)->function_name));
} else {
ZVAL_EMPTY_STRING(zendlval);
}
return T_METHOD_C;
}
@@ -1639,44 +1669,44 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING>"__FILE__" {
char *filename = zend_get_compiled_filename(TSRMLS_C);
zend_string *filename = zend_get_compiled_filename(TSRMLS_C);
if (!filename) {
filename = "";
ZVAL_EMPTY_STRING(zendlval);
} else {
ZVAL_STR(zendlval, zend_string_copy(filename));
}
ZVAL_STRING(zendlval, filename, 1);
return T_FILE;
}
<ST_IN_SCRIPTING>"__DIR__" {
char *filename = zend_get_compiled_filename(TSRMLS_C);
const size_t filename_len = strlen(filename);
char *dirname;
zend_string *filename = zend_get_compiled_filename(TSRMLS_C);
zend_string *dirname;
if (!filename) {
filename = "";
filename = STR_EMPTY_ALLOC();
}
dirname = estrndup(filename, filename_len);
zend_dirname(dirname, filename_len);
dirname = zend_string_init(filename->val, filename->len, 0);
zend_dirname(dirname->val, dirname->len);
if (strcmp(dirname, ".") == 0) {
dirname = erealloc(dirname, MAXPATHLEN);
if (strcmp(dirname->val, ".") == 0) {
dirname = zend_string_realloc(dirname, MAXPATHLEN, 0);
#if HAVE_GETCWD
VCWD_GETCWD(dirname, MAXPATHLEN);
VCWD_GETCWD(dirname->val, MAXPATHLEN);
#elif HAVE_GETWD
VCWD_GETWD(dirname);
VCWD_GETWD(dirname->val);
#endif
}
ZVAL_STRING(zendlval, dirname, 0);
dirname->len = strlen(dirname->val);
ZVAL_STR(zendlval, dirname);
return T_DIR;
}
<ST_IN_SCRIPTING>"__NAMESPACE__" {
if (CG(current_namespace)) {
*zendlval = *CG(current_namespace);
zval_copy_ctor(zendlval);
if (Z_TYPE(CG(current_namespace)) != IS_UNDEF) {
ZVAL_DUP(zendlval, &CG(current_namespace));
} else {
ZVAL_EMPTY_STRING(zendlval);
}
@@ -1693,7 +1723,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
HANDLE_NEWLINES(yytext, yyleng);
ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
DUMMY_STRINGL(zendlval, yytext, yyleng);
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
}
@@ -1701,7 +1731,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<INITIAL>"<%=" {
if (CG(asp_tags)) {
ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
DUMMY_STRINGL(zendlval, yytext, yyleng);
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG_WITH_ECHO;
} else {
@@ -1711,7 +1741,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<INITIAL>"<?=" {
ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
DUMMY_STRINGL(zendlval, yytext, yyleng);
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG_WITH_ECHO;
}
@@ -1719,7 +1749,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<INITIAL>"<%" {
if (CG(asp_tags)) {
ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
DUMMY_STRINGL(zendlval, yytext, yyleng);
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
} else {
@@ -1729,7 +1759,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<INITIAL>"<?php"([ \t]|{NEWLINE}) {
ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
DUMMY_STRINGL(zendlval, yytext, yyleng);
HANDLE_NEWLINE(yytext[yyleng-1]);
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
@@ -1738,7 +1768,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<INITIAL>"<?" {
if (CG(short_tags)) {
ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
DUMMY_STRINGL(zendlval, yytext, yyleng);
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
} else {
@@ -1791,17 +1821,18 @@ inline_html:
if (SCNG(output_filter)) {
int readsize;
char *s = NULL;
size_t sz = 0;
readsize = SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC);
Z_STRLEN_P(zendlval) = sz;
// TODO: avoid reallocation ???
readsize = SCNG(output_filter)((unsigned char **)&s, &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC);
ZVAL_STRINGL(zendlval, s, sz);
efree(s);
if (readsize < yyleng) {
yyless(readsize);
}
} else {
Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng);
Z_STRLEN_P(zendlval) = yyleng;
ZVAL_STRINGL(zendlval, yytext, yyleng);
}
zendlval->type = IS_STRING;
HANDLE_NEWLINES(yytext, yyleng);
return T_INLINE_HTML;
}
@@ -1814,7 +1845,6 @@ inline_html:
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
return T_VARIABLE;
}
@@ -1824,13 +1854,11 @@ inline_html:
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
return T_VARIABLE;
}
<ST_IN_SCRIPTING,ST_DOUBLE_QUOTES,ST_HEREDOC,ST_BACKQUOTE,ST_VAR_OFFSET>"$"{LABEL} {
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
zendlval->type = IS_STRING;
return T_VARIABLE;
}
@@ -1853,7 +1881,6 @@ inline_html:
<ST_IN_SCRIPTING,ST_VAR_OFFSET>{LABEL} {
zend_copy_value(zendlval, yytext, yyleng);
zendlval->type = IS_STRING;
return T_STRING;
}
@@ -1918,8 +1945,7 @@ inline_html:
HANDLE_NEWLINES(yytext, yyleng);
if (doc_com) {
CG(doc_comment) = estrndup(yytext, yyleng);
CG(doc_comment_len) = yyleng;
CG(doc_comment) = zend_string_init(yytext, yyleng, 0);
return T_DOC_COMMENT;
}
@@ -1927,7 +1953,7 @@ inline_html:
}
<ST_IN_SCRIPTING>("?>"|"</script"{WHITESPACE}*">"){NEWLINE}? {
ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
DUMMY_STRINGL(zendlval, yytext, yyleng);
BEGIN(INITIAL);
return T_CLOSE_TAG; /* implicit ';' at php-end tag */
}
@@ -1936,7 +1962,7 @@ inline_html:
<ST_IN_SCRIPTING>"%>"{NEWLINE}? {
if (CG(asp_tags)) {
BEGIN(INITIAL);
ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */
DUMMY_STRINGL(zendlval, yytext, yyleng);
return T_CLOSE_TAG; /* implicit ';' at php-end tag */
} else {
yyless(1);
@@ -1970,7 +1996,7 @@ inline_html:
}
}
ZVAL_STRINGL(zendlval, yytext+bprefix+1, yyleng-bprefix-2, 1);
ZVAL_STRINGL(zendlval, yytext+bprefix+1, yyleng-bprefix-2);
/* convert escape sequences */
s = t = Z_STRVAL_P(zendlval);
@@ -2003,9 +2029,11 @@ inline_html:
if (SCNG(output_filter)) {
size_t sz = 0;
char *str = NULL;
s = Z_STRVAL_P(zendlval);
SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC);
Z_STRLEN_P(zendlval) = sz;
// TODO: avoid reallocation ???
SCNG(output_filter)((unsigned char **)&str, &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC);
ZVAL_STRINGL(zendlval, str, sz);
efree(s);
}
return T_CONSTANT_ENCAPSED_STRING;
@@ -2123,7 +2151,7 @@ inline_html:
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"{$" {
Z_LVAL_P(zendlval) = (long) '{';
Z_LVAL_P(zendlval) = (zend_long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
yyless(1);
return T_CURLY_OPEN;
@@ -2359,7 +2387,6 @@ nowdoc_scan_done:
yyleng = YYCURSOR - SCNG(yy_text);
zend_copy_value(zendlval, yytext, yyleng - newline);
zendlval->type = IS_STRING;
HANDLE_NEWLINES(yytext, yyleng - newline);
return T_ENCAPSED_AND_WHITESPACE;
}
+15 -15
View File
@@ -1,15 +1,15 @@
/* Generated by re2c 0.13.5 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {
yycST_IN_SCRIPTING,
yycST_LOOKING_FOR_PROPERTY,
yycST_BACKQUOTE,
yycST_DOUBLE_QUOTES,
yycST_HEREDOC,
yycST_LOOKING_FOR_VARNAME,
yycST_VAR_OFFSET,
yycINITIAL,
yycST_END_HEREDOC,
yycST_NOWDOC,
};
/* Generated by re2c 0.13.5 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {
yycST_IN_SCRIPTING,
yycST_LOOKING_FOR_PROPERTY,
yycST_BACKQUOTE,
yycST_DOUBLE_QUOTES,
yycST_HEREDOC,
yycST_LOOKING_FOR_VARNAME,
yycST_VAR_OFFSET,
yycINITIAL,
yycST_END_HEREDOC,
yycST_NOWDOC,
};
+135 -177
View File
@@ -31,88 +31,85 @@ ZEND_API int le_index_ptr;
/* true global */
static HashTable list_destructors;
ZEND_API int zend_list_insert(void *ptr, int type TSRMLS_DC)
ZEND_API zval *zend_list_insert(void *ptr, int type TSRMLS_DC)
{
int index;
zend_rsrc_list_entry le;
le.ptr=ptr;
le.type=type;
le.refcount=1;
zval zv;
index = zend_hash_next_free_element(&EG(regular_list));
zend_hash_index_update(&EG(regular_list), index, (void *) &le, sizeof(zend_rsrc_list_entry), NULL);
return index;
if (index == 0) {
index = 1;
}
ZVAL_NEW_RES(&zv, index, ptr, type);
return zend_hash_index_add_new(&EG(regular_list), index, &zv);
}
ZEND_API int _zend_list_delete(int id TSRMLS_DC)
ZEND_API int _zend_list_delete(zend_resource *res TSRMLS_DC)
{
zend_rsrc_list_entry *le;
if (--GC_REFCOUNT(res) <= 0) {
return zend_hash_index_del(&EG(regular_list), res->handle);
} else {
return SUCCESS;
}
}
ZEND_API int _zend_list_free(zend_resource *res TSRMLS_DC)
{
if (GC_REFCOUNT(res) <= 0) {
return zend_hash_index_del(&EG(regular_list), res->handle);
} else {
return SUCCESS;
}
}
static void zend_resource_dtor(zend_resource *res TSRMLS_DC)
{
zend_rsrc_list_dtors_entry *ld;
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
/* printf("del(%d): %d->%d\n", id, le->refcount, le->refcount-1); */
if (--le->refcount<=0) {
return zend_hash_index_del(&EG(regular_list), id);
} else {
return SUCCESS;
ld = zend_hash_index_find_ptr(&list_destructors, res->type);
if (ld) {
if (ld->list_dtor_ex) {
ld->list_dtor_ex(res TSRMLS_CC);
}
} else {
return FAILURE;
zend_error(E_WARNING,"Unknown list entry type (%d)", res->type);
}
res->ptr = NULL;
res->type = -1;
}
ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC)
ZEND_API int _zend_list_close(zend_resource *res TSRMLS_DC)
{
zend_rsrc_list_entry *le;
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
*type = le->type;
return le->ptr;
} else {
*type = -1;
return NULL;
if (GC_REFCOUNT(res) <= 0) {
return zend_list_delete(res);
} else if (res->type >= 0) {
zend_resource_dtor(res TSRMLS_CC);
}
return SUCCESS;
}
ZEND_API int _zend_list_addref(int id TSRMLS_DC)
ZEND_API zend_resource* zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC)
{
zend_rsrc_list_entry *le;
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
/* printf("add(%d): %d->%d\n", id, le->refcount, le->refcount+1); */
le->refcount++;
return SUCCESS;
} else {
return FAILURE;
}
}
zval *zv;
ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC)
{
int rsrc_id;
rsrc_id = zend_list_insert(rsrc_pointer, rsrc_type TSRMLS_CC);
zv = zend_list_insert(rsrc_pointer, rsrc_type TSRMLS_CC);
if (rsrc_result) {
rsrc_result->value.lval = rsrc_id;
rsrc_result->type = IS_RESOURCE;
ZVAL_COPY_VALUE(rsrc_result, zv);
return Z_RES_P(rsrc_result);
} else {
return Z_RES_P(zv);
}
return rsrc_id;
}
ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...)
ZEND_API void *zend_fetch_resource(zval *passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...)
{
int id;
int actual_resource_type;
void *resource;
// void *resource;
va_list resource_types;
int i;
zend_resource *res;
const char *space;
const char *class_name;
@@ -123,26 +120,25 @@ ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, c
zend_error(E_WARNING, "%s%s%s(): no %s resource supplied", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name);
}
return NULL;
} else if ((*passed_id)->type != IS_RESOURCE) {
} else if (Z_TYPE_P(passed_id) != IS_RESOURCE) {
if (resource_type_name) {
class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%s%s%s(): supplied argument is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name);
}
return NULL;
}
id = (*passed_id)->value.lval;
} else {
id = default_id;
}
resource = zend_list_find(id, &actual_resource_type);
if (!resource) {
if (resource_type_name) {
class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%s%s%s(): %d is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), id, resource_type_name);
passed_id = zend_hash_index_find(&EG(regular_list), default_id);
if (!passed_id) {
if (resource_type_name) {
class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%s%s%s(): %d is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), default_id, resource_type_name);
}
return NULL;
}
return NULL;
}
res = Z_RES_P(passed_id);
actual_resource_type = res->type;
va_start(resource_types, num_resource_types);
for (i=0; i<num_resource_types; i++) {
@@ -151,7 +147,7 @@ ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, c
if (found_resource_type) {
*found_resource_type = actual_resource_type;
}
return resource;
return res->ptr;
}
}
va_end(resource_types);
@@ -164,73 +160,66 @@ ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, c
return NULL;
}
void list_entry_destructor(void *ptr)
void list_entry_destructor(zval *zv)
{
zend_rsrc_list_entry *le = (zend_rsrc_list_entry *) ptr;
zend_rsrc_list_dtors_entry *ld;
TSRMLS_FETCH();
zend_resource *res = Z_RES_P(zv);
if (res->type >= 0) {
TSRMLS_FETCH();
if (zend_hash_index_find(&list_destructors, le->type, (void **) &ld)==SUCCESS) {
switch (ld->type) {
case ZEND_RESOURCE_LIST_TYPE_STD:
if (ld->list_dtor) {
(ld->list_dtor)(le->ptr);
}
break;
case ZEND_RESOURCE_LIST_TYPE_EX:
if (ld->list_dtor_ex) {
ld->list_dtor_ex(le TSRMLS_CC);
}
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
} else {
zend_error(E_WARNING,"Unknown list entry type in request shutdown (%d)", le->type);
zend_resource_dtor(res TSRMLS_CC);
}
efree(res);
}
void plist_entry_destructor(void *ptr)
void plist_entry_destructor(zval *zv)
{
zend_rsrc_list_entry *le = (zend_rsrc_list_entry *) ptr;
zend_rsrc_list_dtors_entry *ld;
TSRMLS_FETCH();
zend_resource *res = Z_RES_P(zv);
if (zend_hash_index_find(&list_destructors, le->type, (void **) &ld)==SUCCESS) {
switch (ld->type) {
case ZEND_RESOURCE_LIST_TYPE_STD:
if (ld->plist_dtor) {
(ld->plist_dtor)(le->ptr);
}
break;
case ZEND_RESOURCE_LIST_TYPE_EX:
if (ld->plist_dtor_ex) {
ld->plist_dtor_ex(le TSRMLS_CC);
}
break;
EMPTY_SWITCH_DEFAULT_CASE()
if (res->type >= 0) {
zend_rsrc_list_dtors_entry *ld;
TSRMLS_FETCH();
ld = zend_hash_index_find_ptr(&list_destructors, res->type);
if (ld) {
if (ld->plist_dtor_ex) {
ld->plist_dtor_ex(res TSRMLS_CC);
}
} else {
zend_error(E_WARNING,"Unknown list entry type (%d)", res->type);
}
} else {
zend_error(E_WARNING,"Unknown persistent list entry type in module shutdown (%d)", le->type);
}
free(res);
}
int zend_init_rsrc_list(TSRMLS_D)
{
if (zend_hash_init(&EG(regular_list), 0, NULL, list_entry_destructor, 0)==SUCCESS) {
EG(regular_list).nNextFreeElement=1; /* we don't want resource id 0 */
return SUCCESS;
} else {
return FAILURE;
}
zend_hash_init(&EG(regular_list), 8, NULL, list_entry_destructor, 0);
return SUCCESS;
}
int zend_init_rsrc_plist(TSRMLS_D)
{
return zend_hash_init_ex(&EG(persistent_list), 0, NULL, plist_entry_destructor, 1, 0);
zend_hash_init_ex(&EG(persistent_list), 8, NULL, plist_entry_destructor, 1, 0);
return SUCCESS;
}
static int zend_close_rsrc(zval *zv TSRMLS_DC)
{
zend_resource *res = Z_PTR_P(zv);
if (res->type >= 0) {
zend_resource_dtor(res TSRMLS_CC);
}
return ZEND_HASH_APPLY_KEEP;
}
void zend_close_rsrc_list(HashTable *ht TSRMLS_DC)
{
zend_hash_reverse_apply(ht, zend_close_rsrc TSRMLS_CC);
}
@@ -239,9 +228,10 @@ void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC)
zend_hash_graceful_reverse_destroy(ht);
}
static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id TSRMLS_DC)
static int clean_module_resource(zval *zv, void *arg TSRMLS_DC)
{
if (le->type == *resource_id) {
int resource_id = *(int *)arg;
if (Z_RES_TYPE_P(zv) == resource_id) {
return 1;
} else {
return 0;
@@ -249,10 +239,12 @@ static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id TSRM
}
static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *module_number TSRMLS_DC)
static int zend_clean_module_rsrc_dtors_cb(zval *zv, void *arg TSRMLS_DC)
{
if (ld->module_number == *module_number) {
zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC);
zend_rsrc_list_dtors_entry *ld = (zend_rsrc_list_dtors_entry *)Z_PTR_P(zv);
int module_number = *(int *)arg;
if (ld->module_number == module_number) {
zend_hash_apply_with_argument(&EG(persistent_list), clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC);
return 1;
} else {
return 0;
@@ -262,83 +254,52 @@ static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *
void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC)
{
zend_hash_apply_with_argument(&list_destructors, (apply_func_arg_t) zend_clean_module_rsrc_dtors_cb, (void *) &module_number TSRMLS_CC);
}
ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number)
{
zend_rsrc_list_dtors_entry lde;
#if 0
printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number);
#endif
lde.list_dtor=(void (*)(void *)) ld;
lde.plist_dtor=(void (*)(void *)) pld;
lde.list_dtor_ex = lde.plist_dtor_ex = NULL;
lde.module_number = module_number;
lde.resource_id = list_destructors.nNextFreeElement;
lde.type = ZEND_RESOURCE_LIST_TYPE_STD;
lde.type_name = NULL;
if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) {
return FAILURE;
}
return list_destructors.nNextFreeElement-1;
zend_hash_apply_with_argument(&list_destructors, zend_clean_module_rsrc_dtors_cb, (void *) &module_number TSRMLS_CC);
}
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, const char *type_name, int module_number)
{
zend_rsrc_list_dtors_entry lde;
zend_rsrc_list_dtors_entry *lde;
zval zv;
#if 0
printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number);
#endif
lde.list_dtor = NULL;
lde.plist_dtor = NULL;
lde.list_dtor_ex = ld;
lde.plist_dtor_ex = pld;
lde.module_number = module_number;
lde.resource_id = list_destructors.nNextFreeElement;
lde.type = ZEND_RESOURCE_LIST_TYPE_EX;
lde.type_name = type_name;
lde = malloc(sizeof(zend_rsrc_list_dtors_entry));
lde->list_dtor_ex = ld;
lde->plist_dtor_ex = pld;
lde->module_number = module_number;
lde->resource_id = list_destructors.nNextFreeElement;
lde->type_name = type_name;
ZVAL_PTR(&zv, lde);
if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) {
if (zend_hash_next_index_insert(&list_destructors, &zv) == NULL) {
return FAILURE;
}
return list_destructors.nNextFreeElement-1;
}
ZEND_API int zend_fetch_list_dtor_id(char *type_name)
ZEND_API int zend_fetch_list_dtor_id(const char *type_name)
{
zend_rsrc_list_dtors_entry *lde;
HashPosition pos;
zend_hash_internal_pointer_reset_ex(&list_destructors, &pos);
while (zend_hash_get_current_data_ex(&list_destructors, (void **)&lde, &pos) == SUCCESS) {
ZEND_HASH_FOREACH_PTR(&list_destructors, lde) {
if (lde->type_name && (strcmp(type_name, lde->type_name) == 0)) {
#if 0
printf("Found resource id %d for resource type %s\n", (*lde).resource_id, type_name);
#endif
return lde->resource_id;
}
zend_hash_move_forward_ex(&list_destructors, &pos);
}
} ZEND_HASH_FOREACH_END();
return 0;
}
static void list_destructors_dtor(zval *zv)
{
free(Z_PTR_P(zv));
}
int zend_init_rsrc_list_dtors(void)
{
int retval;
retval = zend_hash_init(&list_destructors, 50, NULL, NULL, 1);
zend_hash_init(&list_destructors, 64, NULL, list_destructors_dtor, 1);
list_destructors.nNextFreeElement=1; /* we don't want resource type 0 */
return retval;
return SUCCESS;
}
@@ -348,15 +309,12 @@ void zend_destroy_rsrc_list_dtors(void)
}
const char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC)
const char *zend_rsrc_list_get_rsrc_type(zend_resource *res TSRMLS_DC)
{
zend_rsrc_list_dtors_entry *lde;
int rsrc_type;
if (!zend_list_find(resource, &rsrc_type))
return NULL;
if (zend_hash_index_find(&list_destructors, rsrc_type, (void **) &lde)==SUCCESS) {
lde = zend_hash_index_find_ptr(&list_destructors, res->type);
if (lde) {
return lde->type_name;
} else {
return NULL;
+16 -32
View File
@@ -27,24 +27,10 @@
BEGIN_EXTERN_C()
#define ZEND_RESOURCE_LIST_TYPE_STD 1
#define ZEND_RESOURCE_LIST_TYPE_EX 2
typedef struct _zend_rsrc_list_entry {
void *ptr;
int type;
int refcount;
} zend_rsrc_list_entry;
typedef void (*rsrc_dtor_func_t)(zend_rsrc_list_entry *rsrc TSRMLS_DC);
#define ZEND_RSRC_DTOR_FUNC(name) void name(zend_rsrc_list_entry *rsrc TSRMLS_DC)
typedef void (*rsrc_dtor_func_t)(zend_resource *res TSRMLS_DC);
#define ZEND_RSRC_DTOR_FUNC(name) void name(zend_resource *res TSRMLS_DC)
typedef struct _zend_rsrc_list_dtors_entry {
/* old style destructors */
void (*list_dtor)(void *);
void (*plist_dtor)(void *);
/* new style destructors */
rsrc_dtor_func_t list_dtor_ex;
rsrc_dtor_func_t plist_dtor_ex;
@@ -52,38 +38,36 @@ typedef struct _zend_rsrc_list_dtors_entry {
int module_number;
int resource_id;
unsigned char type;
} zend_rsrc_list_dtors_entry;
#define register_list_destructors(ld, pld) zend_register_list_destructors((void (*)(void *))ld, (void (*)(void *))pld, module_number);
ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number);
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, const char *type_name, int module_number);
void list_entry_destructor(void *ptr);
void plist_entry_destructor(void *ptr);
void list_entry_destructor(zval *ptr);
void plist_entry_destructor(zval *ptr);
void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC);
int zend_init_rsrc_list(TSRMLS_D);
int zend_init_rsrc_plist(TSRMLS_D);
void zend_close_rsrc_list(HashTable *ht TSRMLS_DC);
void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC);
int zend_init_rsrc_list_dtors(void);
void zend_destroy_rsrc_list_dtors(void);
ZEND_API int zend_list_insert(void *ptr, int type TSRMLS_DC);
ZEND_API int _zend_list_addref(int id TSRMLS_DC);
ZEND_API int _zend_list_delete(int id TSRMLS_DC);
ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC);
ZEND_API zval *zend_list_insert(void *ptr, int type TSRMLS_DC);
ZEND_API int _zend_list_free(zend_resource *res TSRMLS_DC);
ZEND_API int _zend_list_delete(zend_resource *res TSRMLS_DC);
ZEND_API int _zend_list_close(zend_resource *res TSRMLS_DC);
#define zend_list_addref(id) _zend_list_addref(id TSRMLS_CC)
#define zend_list_delete(id) _zend_list_delete(id TSRMLS_CC)
#define zend_list_find(id, type) _zend_list_find(id, type TSRMLS_CC)
#define zend_list_free(res) _zend_list_free(res TSRMLS_CC)
#define zend_list_delete(res) _zend_list_delete(res TSRMLS_CC)
#define zend_list_close(res) _zend_list_close(res TSRMLS_CC)
ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC);
ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
ZEND_API zend_resource *zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC);
ZEND_API void *zend_fetch_resource(zval *passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
ZEND_API const char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC);
ZEND_API int zend_fetch_list_dtor_id(char *type_name);
ZEND_API const char *zend_rsrc_list_get_rsrc_type(zend_resource *res TSRMLS_DC);
ZEND_API int zend_fetch_list_dtor_id(const char *type_name);
extern ZEND_API int le_index_ptr; /* list entry type for index pointers */
+141
View File
@@ -0,0 +1,141 @@
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Anatol Belski <ab@php.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_LONG_H
#define ZEND_LONG_H
#include "main/php_stdint.h"
/* This is the heart of the whole int64 enablement in zval. Based on this
macros the size_t datatype is handled, see zend_types.h */
#if defined(__X86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64)
# define ZEND_ENABLE_INT64 1
#endif
/* Integer types or the old bad long. */
#ifdef ZEND_ENABLE_INT64
# ifdef ZEND_WIN32
# ifdef _WIN64
typedef __int64 zend_long;
typedef unsigned __int64 zend_ulong;
typedef __int64 zend_off_t;
# define ZEND_LONG_MAX _I64_MAX
# define ZEND_LONG_MIN _I64_MIN
# define ZEND_ULONG_MAX _UI64_MAX
# define Z_L(i) i##i64
# define Z_UL(i) i##Ui64
# else
# error Cant enable 64 bit integers on non 64 bit platform
# endif
# else
# if defined(__X86_64__) || defined(__LP64__) || defined(_LP64)
typedef int64_t zend_long;
typedef uint64_t zend_ulong;
typedef off_t zend_off_t;
# define ZEND_LONG_MAX INT64_MAX
# define ZEND_LONG_MIN INT64_MIN
# define ZEND_ULONG_MAX UINT64_MAX
# define Z_L(i) i##LL
# define Z_UL(i) i##ULL
# else
# error Cant enable 64 bit integers on non 64 bit platform
# endif
# endif
# define SIZEOF_ZEND_LONG 8
#else
typedef long zend_long;
typedef unsigned long zend_ulong;
typedef long zend_off_t;
# define ZEND_LONG_MAX LONG_MAX
# define ZEND_LONG_MIN LONG_MIN
# define ZEND_ULONG_MAX ULONG_MAX
# define Z_L(i) i##L
# define Z_UL(i) i##UL
# define SIZEOF_ZEND_LONG SIZEOF_LONG
#endif
/* conversion macros */
#define ZEND_LTOA_BUF_LEN 65
#ifdef ZEND_ENABLE_INT64
# ifdef PHP_WIN32
# define ZEND_LTOA(i, s, len) _i64toa_s((i), (s), (len), 10)
# define ZEND_ATOL(i, s) i = _atoi64((s))
# define ZEND_STRTOL(s0, s1, base) _strtoi64((s0), (s1), (base))
# define ZEND_STRTOUL(s0, s1, base) _strtoui64((s0), (s1), (base))
# define ZEND_LONG_FMT "%I64d"
# define ZEND_ULONG_FMT "%I64u"
# define ZEND_LONG_FMT_SPEC "I64d"
# define ZEND_ULONG_FMT_SPEC "I64u"
# define ZEND_STRTOL_PTR _strtoi64
# define ZEND_STRTOUL_PTR _strtoui64
# define ZEND_ABS _abs64
# else
# define ZEND_LTOA(i, s, len) \
do { \
int st = snprintf((s), (len), "%lld", (i)); \
(s)[st] = '\0'; \
} while (0)
# define ZEND_ATOL(i, s) (i) = atoll((s))
# define ZEND_STRTOL(s0, s1, base) strtoll((s0), (s1), (base))
# define ZEND_STRTOUL(s0, s1, base) strtoull((s0), (s1), (base))
# define ZEND_LONG_FMT "%" PRId64
# define ZEND_ULONG_FMT "%" PRIu64
# define ZEND_LONG_FMT_SPEC PRId64
# define ZEND_ULONG_FMT_SPEC PRIu64
# define ZEND_STRTOL_PTR strtoll
# define ZEND_STRTOUL_PTR strtoull
# define ZEND_ABS llabs
# endif
#else
# define ZEND_STRTOL(s0, s1, base) strtol((s0), (s1), (base))
# define ZEND_STRTOUL(s0, s1, base) strtoul((s0), (s1), (base))
# ifdef PHP_WIN32
# define ZEND_LTOA(i, s, len) _ltoa_s((i), (s), (len), 10)
# define ZEND_ATOL(i, s) i = atol((s))
# else
# define ZEND_LTOA(i, s, len) \
do { \
int st = snprintf((s), (len), "%ld", (i)); \
(s)[st] = '\0'; \
} while (0)
# define ZEND_ATOL(i, s) (i) = atol((s))
# endif
# define ZEND_LONG_FMT "%ld"
# define ZEND_ULONG_FMT "%lu"
# define ZEND_LONG_FMT_SPEC "ld"
# define ZEND_ULONG_FMT_SPEC "lu"
# define ZEND_STRTOL_PTR strtol
# define ZEND_STRTOUL_PTR strtoul
# define ZEND_ABS abs
#endif
#endif /* ZEND_LONG_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
*/
+1 -3
View File
@@ -33,7 +33,7 @@
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC
#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC
#define ZEND_MODULE_API_NO 20131226
#define ZEND_MODULE_API_NO 20140815
#ifdef ZTS
#define USING_ZTS 1
#else
@@ -125,11 +125,9 @@ struct _zend_module_dep {
extern ZEND_API HashTable module_registry;
void module_destructor(zend_module_entry *module);
int module_registry_cleanup(zend_module_entry *module TSRMLS_DC);
int module_registry_request_startup(zend_module_entry *module TSRMLS_DC);
int module_registry_unload_temp(const zend_module_entry *module TSRMLS_DC);
#define ZEND_MODULE_DTOR (void (*)(void *)) module_destructor
#endif
/*
+3 -3
View File
@@ -114,7 +114,7 @@ ZEND_API int zend_multibyte_set_functions(const zend_multibyte_functions *functi
* populated, we need to reinitialize script_encoding here.
*/
{
const char *value = zend_ini_string("zend.script_encoding", sizeof("zend.script_encoding"), 0);
const char *value = zend_ini_string("zend.script_encoding", sizeof("zend.script_encoding") - 1, 0);
zend_multibyte_set_script_encoding_by_string(value, strlen(value) TSRMLS_CC);
}
return SUCCESS;
@@ -168,7 +168,7 @@ ZEND_API const zend_encoding *zend_multibyte_get_script_encoding(TSRMLS_D)
ZEND_API int zend_multibyte_set_script_encoding(const zend_encoding **encoding_list, size_t encoding_list_size TSRMLS_DC)
{
if (CG(script_encoding_list)) {
free(CG(script_encoding_list));
free((char*)CG(script_encoding_list));
}
CG(script_encoding_list) = encoding_list;
CG(script_encoding_list_size) = encoding_list_size;
@@ -195,7 +195,7 @@ ZEND_API int zend_multibyte_set_script_encoding_by_string(const char *new_value,
}
if (size == 0) {
pefree(list, 1);
pefree((void*)list, 1);
return FAILURE;
}
+19 -6
View File
@@ -22,7 +22,7 @@
#if defined(__i386__) && defined(__GNUC__)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
long __tmpvar; \
zend_long __tmpvar; \
__asm__ ("imul %3,%0\n" \
"adc $0,%1" \
: "=r"(__tmpvar),"=r"(usedval) \
@@ -34,7 +34,7 @@
#elif defined(__x86_64__) && defined(__GNUC__)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
long __tmpvar; \
zend_long __tmpvar; \
__asm__ ("imul %3,%0\n" \
"adc $0,%1" \
: "=r"(__tmpvar),"=r"(usedval) \
@@ -46,7 +46,7 @@
#elif defined(__arm__) && defined(__GNUC__)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
long __tmpvar; \
zend_long __tmpvar; \
__asm__("smull %0, %1, %2, %3\n" \
"sub %1, %1, %0, asr #31" \
: "=r"(__tmpvar), "=r"(usedval) \
@@ -58,7 +58,7 @@
#elif defined(__aarch64__) && defined(__GNUC__)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
long __tmpvar; \
zend_long __tmpvar; \
__asm__("mul %0, %2, %3\n" \
"smulh %1, %2, %3\n" \
"sub %1, %1, %0, asr #63\n" \
@@ -68,11 +68,24 @@
else (lval) = __tmpvar; \
} while (0)
#elif SIZEOF_LONG == 4 && defined(HAVE_ZEND_LONG64)
#elif defined(ZEND_WIN32)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
zend_long __lres = (a) * (b); \
long double __dres = (long double)(a) * (long double)(b); \
long double __delta = (long double) __lres - __dres; \
if ( ((usedval) = (( __dres + __delta ) != __dres))) { \
(dval) = __dres; \
} else { \
(lval) = __lres; \
} \
} while (0)
#elif SIZEOF_ZEND_LONG == 4 && defined(HAVE_ZEND_LONG64)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
zend_long64 __result = (zend_long64) (a) * (zend_long64) (b); \
if (__result > LONG_MAX || __result < LONG_MIN) { \
if (__result > ZEND_INT_MAX || __result < ZEND_INT_MIN) { \
(dval) = (double) __result; \
(usedval) = 1; \
} else { \
File diff suppressed because it is too large. Load diff
+30 -30
View File
@@ -24,17 +24,16 @@
union _zend_function;
struct _zend_property_info;
struct _zend_literal;
/* The following rule applies to read_property() and read_dimension() implementations:
If you return a zval which is not otherwise referenced by the extension or the engine's
symbol table, its reference count should be 0.
*/
/* Used to fetch property from the object, read-only */
typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type, const struct _zend_literal *key TSRMLS_DC);
typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC);
/* Used to fetch dimension from the object, read-only */
typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int type TSRMLS_DC);
typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int type, zval *rv TSRMLS_DC);
/* The following rule applies to write_property() and write_dimension() implementations:
@@ -43,23 +42,23 @@ typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int ty
any changes. You should NOT modify the reference count of the value passed to you.
*/
/* Used to set property of the object */
typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value, const struct _zend_literal *key TSRMLS_DC);
typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC);
/* Used to set dimension of the object */
typedef void (*zend_object_write_dimension_t)(zval *object, zval *offset, zval *value TSRMLS_DC);
/* Used to create pointer to the property of the object, for future direct r/w access */
typedef zval **(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member, int type, const struct _zend_literal *key TSRMLS_DC);
typedef zval *(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC);
/* Used to set object value. Can be used to override assignments and scalar
write ops (like ++, +=) on the object */
typedef void (*zend_object_set_t)(zval **object, zval *value TSRMLS_DC);
typedef void (*zend_object_set_t)(zval *object, zval *value TSRMLS_DC);
/* Used to get object value. Can be used when converting object value to
* one of the basic types and when using scalar ops (like ++, +=) on the object
*/
typedef zval* (*zend_object_get_t)(zval *object TSRMLS_DC);
typedef zval* (*zend_object_get_t)(zval *object, zval *rv TSRMLS_DC);
/* Used to check if a property of the object exists */
/* param has_set_exists:
@@ -67,13 +66,13 @@ typedef zval* (*zend_object_get_t)(zval *object TSRMLS_DC);
* 1 (set) whether property exists and is true
* 2 (exists) whether property exists
*/
typedef int (*zend_object_has_property_t)(zval *object, zval *member, int has_set_exists, const struct _zend_literal *key TSRMLS_DC);
typedef int (*zend_object_has_property_t)(zval *object, zval *member, int has_set_exists, void **cache_slot TSRMLS_DC);
/* Used to check if a dimension of the object exists */
typedef int (*zend_object_has_dimension_t)(zval *object, zval *member, int check_empty TSRMLS_DC);
/* Used to remove a property of the object */
typedef void (*zend_object_unset_property_t)(zval *object, zval *member, const struct _zend_literal *key TSRMLS_DC);
typedef void (*zend_object_unset_property_t)(zval *object, zval *member, void **cache_slot TSRMLS_DC);
/* Used to remove a dimension of the object */
typedef void (*zend_object_unset_dimension_t)(zval *object, zval *offset TSRMLS_DC);
@@ -87,18 +86,17 @@ typedef HashTable *(*zend_object_get_debug_info_t)(zval *object, int *is_temp TS
/* args on stack! */
/* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback for this.
*/
typedef int (*zend_object_call_method_t)(const char *method, INTERNAL_FUNCTION_PARAMETERS);
typedef union _zend_function *(*zend_object_get_method_t)(zval **object_ptr, char *method, int method_len, const struct _zend_literal *key TSRMLS_DC);
typedef union _zend_function *(*zend_object_get_constructor_t)(zval *object TSRMLS_DC);
typedef int (*zend_object_call_method_t)(zend_string *method, zend_object *object, INTERNAL_FUNCTION_PARAMETERS);
typedef union _zend_function *(*zend_object_get_method_t)(zend_object **object, zend_string *method, const zval *key TSRMLS_DC);
typedef union _zend_function *(*zend_object_get_constructor_t)(zend_object *object TSRMLS_DC);
/* Object maintenance/destruction */
typedef void (*zend_object_add_ref_t)(zval *object TSRMLS_DC);
typedef void (*zend_object_del_ref_t)(zval *object TSRMLS_DC);
typedef void (*zend_object_delete_obj_t)(zval *object TSRMLS_DC);
typedef zend_object_value (*zend_object_clone_obj_t)(zval *object TSRMLS_DC);
typedef void (*zend_object_dtor_obj_t)(zend_object *object TSRMLS_DC);
typedef void (*zend_object_free_obj_t)(zend_object *object TSRMLS_DC);
typedef zend_object* (*zend_object_clone_obj_t)(zval *object TSRMLS_DC);
typedef zend_class_entry *(*zend_object_get_class_entry_t)(const zval *object TSRMLS_DC);
typedef int (*zend_object_get_class_name_t)(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC);
typedef zend_class_entry *(*zend_object_get_class_entry_t)(const zend_object *object TSRMLS_DC);
typedef zend_string *(*zend_object_get_class_name_t)(const zend_object *object, int parent TSRMLS_DC);
typedef int (*zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC);
typedef int (*zend_object_compare_zvals_t)(zval *resul, zval *op1, zval *op2 TSRMLS_DC);
@@ -108,18 +106,20 @@ typedef int (*zend_object_cast_t)(zval *readobj, zval *retval, int type TSRMLS_D
/* updates *count to hold the number of elements present and returns SUCCESS.
* Returns FAILURE if the object does not have any sense of overloaded dimensions */
typedef int (*zend_object_count_elements_t)(zval *object, long *count TSRMLS_DC);
typedef int (*zend_object_count_elements_t)(zval *object, zend_long *count TSRMLS_DC);
typedef int (*zend_object_get_closure_t)(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC);
typedef int (*zend_object_get_closure_t)(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zend_object **obj_ptr TSRMLS_DC);
typedef HashTable *(*zend_object_get_gc_t)(zval *object, zval ***table, int *n TSRMLS_DC);
typedef HashTable *(*zend_object_get_gc_t)(zval *object, zval **table, int *n TSRMLS_DC);
typedef int (*zend_object_do_operation_t)(zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC);
struct _zend_object_handlers {
/* offset of real object header (usually zero) */
int offset;
/* general object functions */
zend_object_add_ref_t add_ref;
zend_object_del_ref_t del_ref;
zend_object_free_obj_t free_obj;
zend_object_dtor_obj_t dtor_obj;
zend_object_clone_obj_t clone_obj;
/* individual object functions */
zend_object_read_property_t read_property;
@@ -155,26 +155,26 @@ extern ZEND_API zend_object_handlers std_object_handlers;
((fbc)->common.prototype ? (fbc)->common.prototype->common.scope : (fbc)->common.scope)
BEGIN_EXTERN_C()
ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, const char *function_name_strval, int function_name_strlen, const struct _zend_literal *key TSRMLS_DC);
ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, zend_bool silent, const struct _zend_literal *key TSRMLS_DC);
ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, const struct _zend_literal *key TSRMLS_DC);
ZEND_API union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC);
ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name_strval, const zval *key TSRMLS_DC);
ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent, void **cache_slot TSRMLS_DC);
ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name, void **cache_slot TSRMLS_DC);
ZEND_API union _zend_function *zend_std_get_constructor(zend_object *object TSRMLS_DC);
ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC);
ZEND_API HashTable *zend_std_get_properties(zval *object TSRMLS_DC);
ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC);
ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC);
ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, const struct _zend_literal *key TSRMLS_DC);
ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC);
ZEND_API void rebuild_object_properties(zend_object *zobj);
#define IS_ZEND_STD_OBJECT(z) (Z_TYPE(z) == IS_OBJECT && (Z_OBJ_HT((z))->get_class_entry != NULL))
#define HAS_CLASS_ENTRY(z) (Z_OBJ_HT(z)->get_class_entry != NULL)
ZEND_API int zend_check_private(union _zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC);
ZEND_API int zend_check_private(union _zend_function *fbc, zend_class_entry *ce, zend_string *function_name TSRMLS_DC);
ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope);
ZEND_API int zend_check_property_access(zend_object *zobj, const char *prop_info_name, int prop_info_name_len TSRMLS_DC);
ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name TSRMLS_DC);
ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS);
END_EXTERN_C()
+67 -102
View File
@@ -28,14 +28,27 @@
ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC)
{
GC_REFCOUNT(object) = 1;
GC_TYPE_INFO(object) = IS_OBJECT;
object->ce = ce;
object->properties = NULL;
object->properties_table = NULL;
object->guards = NULL;
zend_objects_store_put(object TSRMLS_CC);
if (EXPECTED(ce->default_properties_count != 0)) {
zval *p = object->properties_table;
zval *end = p + ce->default_properties_count;
do {
ZVAL_UNDEF(p);
p++;
} while (p != end);
}
}
ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
{
int i;
if (object->guards) {
zend_hash_destroy(object->guards);
FREE_HASHTABLE(object->guards);
@@ -43,29 +56,19 @@ ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
if (object->properties) {
zend_hash_destroy(object->properties);
FREE_HASHTABLE(object->properties);
if (object->properties_table) {
efree(object->properties_table);
}
} else if (object->properties_table) {
int i;
for (i = 0; i < object->ce->default_properties_count; i++) {
if (object->properties_table[i]) {
zval_ptr_dtor(&object->properties_table[i]);
}
}
efree(object->properties_table);
}
for (i = 0; i < object->ce->default_properties_count; i++) {
zval_ptr_dtor(&object->properties_table[i]);
}
}
ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC)
ZEND_API void zend_objects_destroy_object(zend_object *object TSRMLS_DC)
{
zend_function *destructor = object ? object->ce->destructor : NULL;
if (destructor) {
zval *old_exception;
zval *obj;
zend_object_store_bucket *obj_bucket;
zend_object *old_exception;
zval obj;
if (destructor->op_array.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED)) {
if (destructor->op_array.fn_flags & ZEND_ACC_PRIVATE) {
@@ -74,11 +77,11 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
if (object->ce != EG(scope)) {
zend_class_entry *ce = object->ce;
zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
zend_error(EG(current_execute_data) ? E_ERROR : E_WARNING,
"Call to private %s::__destruct() from context '%s'%s",
ce->name,
EG(scope) ? EG(scope)->name : "",
EG(in_execution) ? "" : " during shutdown ignored");
ce->name->val,
EG(scope) ? EG(scope)->name->val : "",
EG(current_execute_data) ? "" : " during shutdown ignored");
return;
}
} else {
@@ -87,25 +90,18 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
if (!zend_check_protected(zend_get_function_root_class(destructor), EG(scope))) {
zend_class_entry *ce = object->ce;
zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
zend_error(EG(current_execute_data) ? E_ERROR : E_WARNING,
"Call to protected %s::__destruct() from context '%s'%s",
ce->name,
EG(scope) ? EG(scope)->name : "",
EG(in_execution) ? "" : " during shutdown ignored");
ce->name->val,
EG(scope) ? EG(scope)->name->val : "",
EG(current_execute_data) ? "" : " during shutdown ignored");
return;
}
}
}
MAKE_STD_ZVAL(obj);
Z_TYPE_P(obj) = IS_OBJECT;
Z_OBJ_HANDLE_P(obj) = handle;
obj_bucket = &EG(objects_store).object_buckets[handle];
if (!obj_bucket->bucket.obj.handlers) {
obj_bucket->bucket.obj.handlers = &std_object_handlers;
}
Z_OBJ_HT_P(obj) = obj_bucket->bucket.obj.handlers;
zval_copy_ctor(obj);
ZVAL_OBJ(&obj, object);
Z_ADDREF(obj);
/* Make sure that destructors are protected from previously thrown exceptions.
* For example, if an exception was thrown in a function and when the function's
@@ -113,7 +109,7 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
*/
old_exception = NULL;
if (EG(exception)) {
if (Z_OBJ_HANDLE_P(EG(exception)) == handle) {
if (EG(exception) == object) {
zend_error(E_ERROR, "Attempt to destruct pending exception");
} else {
old_exception = EG(exception);
@@ -132,104 +128,73 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
}
}
ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC)
ZEND_API zend_object *zend_objects_new(zend_class_entry *ce TSRMLS_DC)
{
zend_object_std_dtor(object TSRMLS_CC);
efree(object);
zend_object *object = emalloc(sizeof(zend_object) + sizeof(zval) * (ce->default_properties_count - 1));
zend_object_std_init(object, ce TSRMLS_CC);
object->handlers = &std_object_handlers;
return object;
}
ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
*object = emalloc(sizeof(zend_object));
(*object)->ce = class_type;
(*object)->properties = NULL;
(*object)->properties_table = NULL;
(*object)->guards = NULL;
retval.handle = zend_objects_store_put(*object, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) zend_objects_free_object_storage, NULL TSRMLS_CC);
retval.handlers = &std_object_handlers;
return retval;
}
ZEND_API zend_object *zend_objects_get_address(const zval *zobject TSRMLS_DC)
{
return (zend_object *)zend_object_store_get_object(zobject TSRMLS_CC);
}
ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object_value new_obj_val, zend_object *old_object, zend_object_handle handle TSRMLS_DC)
ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object *old_object TSRMLS_DC)
{
int i;
if (old_object->properties_table) {
if (!new_object->properties_table) {
new_object->properties_table = emalloc(sizeof(zval*) * old_object->ce->default_properties_count);
memset(new_object->properties_table, 0, sizeof(zval*) * old_object->ce->default_properties_count);
}
if (old_object->ce->default_properties_count) {
for (i = 0; i < old_object->ce->default_properties_count; i++) {
if (!new_object->properties) {
if (new_object->properties_table[i]) {
zval_ptr_dtor(&new_object->properties_table[i]);
}
}
if (!old_object->properties) {
new_object->properties_table[i] = old_object->properties_table[i];
if (new_object->properties_table[i]) {
Z_ADDREF_P(new_object->properties_table[i]);
}
}
zval_ptr_dtor(&new_object->properties_table[i]);
ZVAL_COPY(&new_object->properties_table[i], &old_object->properties_table[i]);
}
}
if (old_object->properties) {
zval *prop, new_prop;
zend_ulong num_key;
zend_string *key;
if (!new_object->properties) {
ALLOC_HASHTABLE(new_object->properties);
zend_hash_init(new_object->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_init(new_object->properties, 8, NULL, ZVAL_PTR_DTOR, 0);
}
zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref, (void *) NULL /* Not used anymore */, sizeof(zval *));
if (old_object->properties_table) {
HashPosition pos;
zend_property_info *prop_info;
for (zend_hash_internal_pointer_reset_ex(&old_object->ce->properties_info, &pos);
zend_hash_get_current_data_ex(&old_object->ce->properties_info, (void**)&prop_info, &pos) == SUCCESS;
zend_hash_move_forward_ex(&old_object->ce->properties_info, &pos)) {
if ((prop_info->flags & ZEND_ACC_STATIC) == 0) {
if (zend_hash_quick_find(new_object->properties, prop_info->name, prop_info->name_length+1, prop_info->h, (void**)&new_object->properties_table[prop_info->offset]) == FAILURE) {
new_object->properties_table[prop_info->offset] = NULL;
}
}
ZEND_HASH_FOREACH_KEY_VAL(old_object->properties, num_key, key, prop) {
if (Z_TYPE_P(prop) == IS_INDIRECT) {
ZVAL_INDIRECT(&new_prop, new_object->properties_table + (Z_INDIRECT_P(prop) - old_object->properties_table));
} else {
ZVAL_COPY_VALUE(&new_prop, prop);
zval_add_ref(&new_prop);
}
}
if (key) {
zend_hash_update(new_object->properties, key, &new_prop);
} else {
zend_hash_index_update(new_object->properties, num_key, &new_prop);
}
} ZEND_HASH_FOREACH_END();
}
if (old_object->ce->clone) {
zval *new_obj;
MAKE_STD_ZVAL(new_obj);
new_obj->type = IS_OBJECT;
new_obj->value.obj = new_obj_val;
zval_copy_ctor(new_obj);
zval new_obj;
ZVAL_OBJ(&new_obj, new_object);
zval_copy_ctor(&new_obj);
zend_call_method_with_0_params(&new_obj, old_object->ce, &old_object->ce->clone, ZEND_CLONE_FUNC_NAME, NULL);
zval_ptr_dtor(&new_obj);
}
}
ZEND_API zend_object_value zend_objects_clone_obj(zval *zobject TSRMLS_DC)
ZEND_API zend_object *zend_objects_clone_obj(zval *zobject TSRMLS_DC)
{
zend_object_value new_obj_val;
zend_object *old_object;
zend_object *new_object;
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
/* assume that create isn't overwritten, so when clone depends on the
* overwritten one then it must itself be overwritten */
old_object = zend_objects_get_address(zobject TSRMLS_CC);
new_obj_val = zend_objects_new(&new_object, old_object->ce TSRMLS_CC);
old_object = Z_OBJ_P(zobject);
new_object = zend_objects_new(old_object->ce TSRMLS_CC);
zend_objects_clone_members(new_object, new_obj_val, old_object, handle TSRMLS_CC);
zend_objects_clone_members(new_object, old_object TSRMLS_CC);
return new_obj_val;
return new_object;
}
/*
+4 -6
View File
@@ -27,12 +27,10 @@
BEGIN_EXTERN_C()
ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC);
ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC);
ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC);
ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC);
ZEND_API zend_object *zend_objects_get_address(const zval *object TSRMLS_DC);
ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object_value new_obj_val, zend_object *old_object, zend_object_handle handle TSRMLS_DC);
ZEND_API zend_object_value zend_objects_clone_obj(zval *object TSRMLS_DC);
ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC);
ZEND_API zend_object *zend_objects_new(zend_class_entry *ce TSRMLS_DC);
ZEND_API void zend_objects_destroy_object(zend_object *object TSRMLS_DC);
ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object *old_object TSRMLS_DC);
ZEND_API zend_object *zend_objects_clone_obj(zval *object TSRMLS_DC);
END_EXTERN_C()
#endif /* ZEND_OBJECTS_H */
+125 -219
View File
@@ -23,17 +23,15 @@
#include "zend_globals.h"
#include "zend_variables.h"
#include "zend_API.h"
#include "zend_objects_API.h"
#include "zend_objects_API.h"
#define ZEND_DEBUG_OBJECTS 0
ZEND_API void zend_objects_store_init(zend_objects_store *objects, zend_uint init_size)
ZEND_API void zend_objects_store_init(zend_objects_store *objects, uint32_t init_size)
{
objects->object_buckets = (zend_object_store_bucket *) emalloc(init_size * sizeof(zend_object_store_bucket));
objects->object_buckets = (zend_object **) emalloc(init_size * sizeof(zend_object*));
objects->top = 1; /* Skip 0 so that handles are true */
objects->size = init_size;
objects->free_list_head = -1;
memset(&objects->object_buckets[0], 0, sizeof(zend_object_store_bucket));
memset(&objects->object_buckets[0], 0, sizeof(zend_object*));
}
ZEND_API void zend_objects_store_destroy(zend_objects_store *objects)
@@ -44,25 +42,17 @@ ZEND_API void zend_objects_store_destroy(zend_objects_store *objects)
ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC)
{
zend_uint i = 1;
uint32_t i;
for (i = 1; i < objects->top ; i++) {
if (objects->object_buckets[i].valid) {
struct _store_object *obj = &objects->object_buckets[i].bucket.obj;
zend_object *obj = objects->object_buckets[i];
if (!objects->object_buckets[i].destructor_called) {
objects->object_buckets[i].destructor_called = 1;
if (obj->dtor && obj->object) {
obj->refcount++;
obj->dtor(obj->object, i TSRMLS_CC);
obj = &objects->object_buckets[i].bucket.obj;
obj->refcount--;
if (obj->refcount == 0) {
/* in case gc_collect_cycle is triggered before free_storage */
GC_REMOVE_ZOBJ_FROM_BUFFER(obj);
}
}
if (IS_OBJ_VALID(obj)) {
if (!(GC_FLAGS(obj) & IS_OBJ_DESTRUCTOR_CALLED)) {
GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
GC_REFCOUNT(obj)++;
obj->handlers->dtor_obj(obj TSRMLS_CC);
GC_REFCOUNT(obj)--;
}
}
}
@@ -70,33 +60,49 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC)
{
zend_uint i;
uint32_t i;
if (!objects->object_buckets) {
return;
}
for (i = 1; i < objects->top ; i++) {
if (objects->object_buckets[i].valid) {
objects->object_buckets[i].destructor_called = 1;
zend_object *obj = objects->object_buckets[i];
if (IS_OBJ_VALID(obj)) {
GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
}
}
}
ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC)
{
zend_uint i = 1;
uint32_t i;
for (i = 1; i < objects->top ; i++) {
if (objects->object_buckets[i].valid) {
struct _store_object *obj = &objects->object_buckets[i].bucket.obj;
/* Free object properties but don't free object their selves */
for (i = objects->top - 1; i > 0 ; i--) {
zend_object *obj = objects->object_buckets[i];
GC_REMOVE_ZOBJ_FROM_BUFFER(obj);
objects->object_buckets[i].valid = 0;
if (obj->free_storage) {
obj->free_storage(obj->object TSRMLS_CC);
if (IS_OBJ_VALID(obj)) {
if (!(GC_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
if (obj->handlers->free_obj) {
GC_REFCOUNT(obj)++;
obj->handlers->free_obj(obj TSRMLS_CC);
GC_REFCOUNT(obj)--;
}
}
}
}
/* Now free objects theirselves */
for (i = 1; i < objects->top ; i++) {
zend_object *obj = objects->object_buckets[i];
if (IS_OBJ_VALID(obj)) {
/* Not adding to free list as we are shutting down anyway */
void *ptr = ((char*)obj) - obj->handlers->offset;
GC_REMOVE_FROM_BUFFER(obj);
efree(ptr);
}
}
}
@@ -104,188 +110,97 @@ ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects
/* Store objects API */
ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_store_dtor_t dtor, zend_objects_free_object_storage_t free_storage, zend_objects_store_clone_t clone TSRMLS_DC)
ZEND_API void zend_objects_store_put(zend_object *object TSRMLS_DC)
{
zend_object_handle handle;
struct _store_object *obj;
int handle;
if (EG(objects_store).free_list_head != -1) {
handle = EG(objects_store).free_list_head;
EG(objects_store).free_list_head = EG(objects_store).object_buckets[handle].bucket.free_list.next;
EG(objects_store).free_list_head = GET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[handle]);
} else {
if (EG(objects_store).top == EG(objects_store).size) {
EG(objects_store).size <<= 1;
EG(objects_store).object_buckets = (zend_object_store_bucket *) erealloc(EG(objects_store).object_buckets, EG(objects_store).size * sizeof(zend_object_store_bucket));
EG(objects_store).object_buckets = (zend_object **) erealloc(EG(objects_store).object_buckets, EG(objects_store).size * sizeof(zend_object*));
}
handle = EG(objects_store).top++;
}
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
EG(objects_store).object_buckets[handle].destructor_called = 0;
EG(objects_store).object_buckets[handle].valid = 1;
EG(objects_store).object_buckets[handle].apply_count = 0;
obj->refcount = 1;
GC_OBJ_INIT(obj);
obj->object = object;
obj->dtor = dtor?dtor:(zend_objects_store_dtor_t)zend_objects_destroy_object;
obj->free_storage = free_storage;
obj->clone = clone;
obj->handlers = NULL;
#if ZEND_DEBUG_OBJECTS
fprintf(stderr, "Allocated object id #%d\n", handle);
#endif
return handle;
object->handle = handle;
EG(objects_store).object_buckets[handle] = object;
}
ZEND_API zend_uint zend_objects_store_get_refcount(zval *object TSRMLS_DC)
{
zend_object_handle handle = Z_OBJ_HANDLE_P(object);
#define ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST(handle) \
SET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[handle], EG(objects_store).free_list_head); \
EG(objects_store).free_list_head = handle;
return EG(objects_store).object_buckets[handle].bucket.obj.refcount;
ZEND_API void zend_objects_store_free(zend_object *object TSRMLS_DC) /* {{{ */
{
uint32_t handle = object->handle;
void *ptr = ((char*)object) - object->handlers->offset;
GC_REMOVE_FROM_BUFFER(object);
efree(ptr);
ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST(handle);
}
/* }}} */
ZEND_API void zend_objects_store_add_ref(zval *object TSRMLS_DC)
ZEND_API void zend_objects_store_del(zend_object *object TSRMLS_DC) /* {{{ */
{
zend_object_handle handle = Z_OBJ_HANDLE_P(object);
EG(objects_store).object_buckets[handle].bucket.obj.refcount++;
#if ZEND_DEBUG_OBJECTS
fprintf(stderr, "Increased refcount of object id #%d\n", handle);
#endif
}
/*
* Add a reference to an objects store entry given the object handle.
*/
ZEND_API void zend_objects_store_add_ref_by_handle(zend_object_handle handle TSRMLS_DC)
{
EG(objects_store).object_buckets[handle].bucket.obj.refcount++;
}
#define ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST() \
EG(objects_store).object_buckets[handle].bucket.free_list.next = EG(objects_store).free_list_head; \
EG(objects_store).free_list_head = handle; \
EG(objects_store).object_buckets[handle].valid = 0;
ZEND_API void zend_objects_store_del_ref(zval *zobject TSRMLS_DC)
{
zend_object_handle handle;
handle = Z_OBJ_HANDLE_P(zobject);
Z_ADDREF_P(zobject);
zend_objects_store_del_ref_by_handle_ex(handle, Z_OBJ_HT_P(zobject) TSRMLS_CC);
Z_DELREF_P(zobject);
GC_ZOBJ_CHECK_POSSIBLE_ROOT(zobject);
}
/*
* Delete a reference to an objects store entry given the object handle.
*/
ZEND_API void zend_objects_store_del_ref_by_handle_ex(zend_object_handle handle, const zend_object_handlers *handlers TSRMLS_DC) /* {{{ */
{
struct _store_object *obj;
int failure = 0;
if (!EG(objects_store).object_buckets) {
return;
}
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
/* Make sure we hold a reference count during the destructor call
otherwise, when the destructor ends the storage might be freed
when the refcount reaches 0 a second time
*/
if (EG(objects_store).object_buckets[handle].valid) {
if (obj->refcount == 1) {
if (!EG(objects_store).object_buckets[handle].destructor_called) {
EG(objects_store).object_buckets[handle].destructor_called = 1;
if (EG(objects_store).object_buckets &&
IS_OBJ_VALID(EG(objects_store).object_buckets[object->handle])) {
if (GC_REFCOUNT(object) == 0) {
int failure = 0;
if (obj->dtor) {
if (handlers && !obj->handlers) {
obj->handlers = handlers;
}
if (!(GC_FLAGS(object) & IS_OBJ_DESTRUCTOR_CALLED)) {
GC_FLAGS(object) |= IS_OBJ_DESTRUCTOR_CALLED;
if (object->handlers->dtor_obj) {
GC_REFCOUNT(object)++;
zend_try {
obj->dtor(obj->object, handle TSRMLS_CC);
object->handlers->dtor_obj(object TSRMLS_CC);
} zend_catch {
failure = 1;
} zend_end_try();
GC_REFCOUNT(object)--;
}
}
/* re-read the object from the object store as the store might have been reallocated in the dtor */
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
if (GC_REFCOUNT(object) == 0) {
uint32_t handle = object->handle;
void *ptr;
if (obj->refcount == 1) {
GC_REMOVE_ZOBJ_FROM_BUFFER(obj);
if (obj->free_storage) {
zend_try {
obj->free_storage(obj->object TSRMLS_CC);
} zend_catch {
failure = 1;
} zend_end_try();
EG(objects_store).object_buckets[handle] = SET_OBJ_INVALID(object);
if (!(GC_FLAGS(object) & IS_OBJ_FREE_CALLED)) {
GC_FLAGS(object) |= IS_OBJ_FREE_CALLED;
if (object->handlers->free_obj) {
zend_try {
GC_REFCOUNT(object)++;
object->handlers->free_obj(object TSRMLS_CC);
GC_REFCOUNT(object)--;
} zend_catch {
failure = 1;
} zend_end_try();
}
}
ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST();
ptr = ((char*)object) - object->handlers->offset;
GC_REMOVE_FROM_BUFFER(object);
efree(ptr);
ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST(handle);
}
if (failure) {
zend_bailout();
}
} else {
GC_REFCOUNT(object)--;
}
}
obj->refcount--;
#if ZEND_DEBUG_OBJECTS
if (obj->refcount == 0) {
fprintf(stderr, "Deallocated object id #%d\n", handle);
} else {
fprintf(stderr, "Decreased refcount of object id #%d\n", handle);
}
#endif
if (failure) {
zend_bailout();
}
}
/* }}} */
ZEND_API zend_object_value zend_objects_store_clone_obj(zval *zobject TSRMLS_DC)
{
zend_object_value retval;
void *new_object;
struct _store_object *obj;
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
if (obj->clone == NULL) {
zend_error(E_CORE_ERROR, "Trying to clone uncloneable object of class %s", Z_OBJCE_P(zobject)->name);
}
obj->clone(obj->object, &new_object TSRMLS_CC);
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
retval.handle = zend_objects_store_put(new_object, obj->dtor, obj->free_storage, obj->clone TSRMLS_CC);
retval.handlers = Z_OBJ_HT_P(zobject);
EG(objects_store).object_buckets[handle].bucket.obj.handlers = retval.handlers;
return retval;
}
ZEND_API void *zend_object_store_get_object(const zval *zobject TSRMLS_DC)
{
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
return EG(objects_store).object_buckets[handle].bucket.obj.object;
}
/*
* Retrieve an entry from the objects store given the object handle.
*/
ZEND_API void *zend_object_store_get_object_by_handle(zend_object_handle handle TSRMLS_DC)
{
return EG(objects_store).object_buckets[handle].bucket.obj.object;
}
/* zend_object_store_set_object:
* It is ONLY valid to call this function from within the constructor of an
* overloaded object. Its purpose is to set the object pointer for the object
@@ -293,34 +208,27 @@ ZEND_API void *zend_object_store_get_object_by_handle(zend_object_handle handle
* from the constructor function. You MUST NOT use this function for any other
* weird games, or call it at any other time after the object is constructed.
* */
ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC)
ZEND_API void zend_object_store_set_object(zval *zobject, zend_object *object TSRMLS_DC)
{
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
EG(objects_store).object_buckets[handle].bucket.obj.object = object;
EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zobject)] = object;
}
/* Called when the ctor was terminated by an exception */
ZEND_API void zend_object_store_ctor_failed(zval *zobject TSRMLS_DC)
ZEND_API void zend_object_store_ctor_failed(zend_object *obj TSRMLS_DC)
{
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
zend_object_store_bucket *obj_bucket = &EG(objects_store).object_buckets[handle];
obj_bucket->bucket.obj.handlers = Z_OBJ_HT_P(zobject);;
obj_bucket->destructor_called = 1;
GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
}
/* Proxy objects workings */
typedef struct _zend_proxy_object {
zval *object;
zval *property;
zend_object std;
zval object;
zval property;
} zend_proxy_object;
static zend_object_handlers zend_object_proxy_handlers;
ZEND_API void zend_objects_proxy_destroy(zend_object *object, zend_object_handle handle TSRMLS_DC)
ZEND_API void zend_objects_proxy_destroy(zend_object *object TSRMLS_DC)
{
}
@@ -336,46 +244,44 @@ ZEND_API void zend_objects_proxy_clone(zend_proxy_object *object, zend_proxy_obj
*object_clone = emalloc(sizeof(zend_proxy_object));
(*object_clone)->object = object->object;
(*object_clone)->property = object->property;
zval_add_ref(&(*object_clone)->property);
zval_add_ref(&(*object_clone)->object);
Z_ADDREF_P(&(*object_clone)->property);
Z_ADDREF_P(&(*object_clone)->object);
}
ZEND_API zval *zend_object_create_proxy(zval *object, zval *member TSRMLS_DC)
ZEND_API zend_object *zend_object_create_proxy(zval *object, zval *member TSRMLS_DC)
{
zend_proxy_object *pobj = emalloc(sizeof(zend_proxy_object));
zval *retval;
zend_proxy_object *obj = emalloc(sizeof(zend_proxy_object));
pobj->object = object;
zval_add_ref(&pobj->object);
ALLOC_ZVAL(pobj->property);
INIT_PZVAL_COPY(pobj->property, member);
zval_copy_ctor(pobj->property);
GC_REFCOUNT(obj) = 1;
GC_TYPE_INFO(obj) = IS_OBJECT;
obj->std.ce = NULL;
obj->std.properties = NULL;
obj->std.guards = NULL;
obj->std.handlers = &zend_object_proxy_handlers;
ZVAL_COPY(&obj->object, object);
ZVAL_DUP(&obj->property, member);
MAKE_STD_ZVAL(retval);
Z_TYPE_P(retval) = IS_OBJECT;
Z_OBJ_HANDLE_P(retval) = zend_objects_store_put(pobj, (zend_objects_store_dtor_t)zend_objects_proxy_destroy, (zend_objects_free_object_storage_t) zend_objects_proxy_free_storage, (zend_objects_store_clone_t) zend_objects_proxy_clone TSRMLS_CC);
Z_OBJ_HT_P(retval) = &zend_object_proxy_handlers;
return retval;
return (zend_object*)obj;
}
ZEND_API void zend_object_proxy_set(zval **property, zval *value TSRMLS_DC)
ZEND_API void zend_object_proxy_set(zval *property, zval *value TSRMLS_DC)
{
zend_proxy_object *probj = zend_object_store_get_object(*property TSRMLS_CC);
zend_proxy_object *probj = (zend_proxy_object*)Z_OBJ_P(property);
if (Z_OBJ_HT_P(probj->object) && Z_OBJ_HT_P(probj->object)->write_property) {
Z_OBJ_HT_P(probj->object)->write_property(probj->object, probj->property, value, 0 TSRMLS_CC);
if (Z_OBJ_HT(probj->object) && Z_OBJ_HT(probj->object)->write_property) {
Z_OBJ_HT(probj->object)->write_property(&probj->object, &probj->property, value, NULL TSRMLS_CC);
} else {
zend_error(E_WARNING, "Cannot write property of object - no write handler defined");
}
}
ZEND_API zval* zend_object_proxy_get(zval *property TSRMLS_DC)
ZEND_API zval* zend_object_proxy_get(zval *property, zval *rv TSRMLS_DC)
{
zend_proxy_object *probj = zend_object_store_get_object(property TSRMLS_CC);
zend_proxy_object *probj = (zend_proxy_object*)Z_OBJ_P(property);
if (Z_OBJ_HT_P(probj->object) && Z_OBJ_HT_P(probj->object)->read_property) {
return Z_OBJ_HT_P(probj->object)->read_property(probj->object, probj->property, BP_VAR_R, 0 TSRMLS_CC);
if (Z_OBJ_HT(probj->object) && Z_OBJ_HT(probj->object)->read_property) {
return Z_OBJ_HT(probj->object)->read_property(&probj->object, &probj->property, BP_VAR_R, NULL, rv TSRMLS_CC);
} else {
zend_error(E_WARNING, "Cannot read property of object - no read handler defined");
}
Loaded 100 of 1175 files, more files were not shown because too many files have changed in this diff. Show more