mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 18:20:50 +00:00
Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57e698d582 | ||
|
|
7e35e8b9ef | ||
|
|
a2edb3e7e4 | ||
|
|
a964242f19 | ||
|
|
ce20287810 | ||
|
|
11d102ebbc | ||
|
|
eb44463e35 | ||
|
|
b3b1c0b63d | ||
|
|
8871aa912f | ||
|
|
dae8ff251c | ||
|
|
79bfef5ba3 | ||
|
|
326ab8b147 | ||
|
|
99bd2fd9c4 | ||
|
|
1f148f7ad9 | ||
|
|
8648f76bac |
No files matched your search
@@ -22,10 +22,6 @@ sapi/nsapi/nsapi.c ident
|
||||
sapi/continuity/capi.c ident
|
||||
Zend/RFCs/002.txt ident
|
||||
Zend/RFCs/003.txt ident
|
||||
ext/exif/exif.c ident
|
||||
ext/ldap/ldap.c ident
|
||||
ext/pdo_pgsql/pdo_pgsql.c ident
|
||||
ext/tidy/tidy.c ident
|
||||
NEWS merge=NEWS
|
||||
UPGRADING merge=NEWS
|
||||
UPGRADING.INTERNALS merge=NEWS
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
*.tgz
|
||||
*.tar.gz
|
||||
*.tar.bz2
|
||||
*.tar.xz
|
||||
.FBCIndex
|
||||
.FBCLockFolder
|
||||
.deps
|
||||
|
||||
+6
-14
@@ -1,12 +1,13 @@
|
||||
language: c
|
||||
language: php
|
||||
|
||||
php:
|
||||
# We only specify one version so we only get one worker
|
||||
- 5.4
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_failure: change
|
||||
|
||||
cache:
|
||||
- apt
|
||||
|
||||
env:
|
||||
global:
|
||||
- MYSQL_TEST_HOST=127.0.0.1
|
||||
@@ -20,13 +21,6 @@ env:
|
||||
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
|
||||
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -y libenchant-dev libaspell-dev libpspell-dev librecode-dev
|
||||
- sudo cp ./travis/de /var/lib/locales/supported.d/de
|
||||
- sudo dpkg-reconfigure locales
|
||||
- ./travis/install.sh
|
||||
|
||||
before_script:
|
||||
# Compile PHP
|
||||
- ./travis/compile.sh
|
||||
@@ -38,6 +32,4 @@ before_script:
|
||||
- . ./travis/ext/pdo_pgsql/setup.sh
|
||||
|
||||
# Run PHPs run-tests.php
|
||||
script:
|
||||
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --set-timeout 120
|
||||
- ./sapi/cli/php sapi/phpdbg/tests/run-tests.php -diff2stdout --phpdbg sapi/phpdbg/phpdbg
|
||||
script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120
|
||||
+1
-1
@@ -42,7 +42,7 @@ Exceptions:
|
||||
|
||||
4. When writing functions that deal with strings, be sure to remember
|
||||
that PHP holds the length property of each string, and that it
|
||||
shouldn't be calculated with strlen(). Write your functions in such
|
||||
shouldn't be calculated with strlen(). Write your functions in a such
|
||||
a way so that they'll take advantage of the length property, both
|
||||
for efficiency and in order for them to be binary-safe.
|
||||
Functions that change strings and obtain their new lengths while
|
||||
|
||||
-12
@@ -385,12 +385,6 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.4
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: hash
|
||||
PRIMARY MAINTAINER: Sara Golemon <pollita@php.net>, Mike Wallner <mike@php.net>, Anatol Belski <ab@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.1.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: iconv
|
||||
PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -444,12 +438,6 @@ PRIMARY MAINTAINER: Frank M. Kromann
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: opcache
|
||||
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com>, Xinchen Hui <laruence@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.5.0
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: openssl
|
||||
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>, Pierre-Alain Joye <pajoye@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
|
||||
@@ -155,7 +155,7 @@ Table of Contents
|
||||
a list of all available options along with short explanations running
|
||||
./configure --help. Our manual documents the different options
|
||||
separately. You will find the core options in the appendix, while the
|
||||
different extension specific options are described on the reference
|
||||
different extension specific options are descibed on the reference
|
||||
pages.
|
||||
|
||||
When PHP is configured, you are ready to build the module and/or
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--------------------------------------------------------------------
|
||||
The PHP License, version 3.01
|
||||
Copyright (c) 1999 - 2015 The PHP Group. All rights reserved.
|
||||
Copyright (c) 1999 - 2012 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ php_lcov.info: lcov-test
|
||||
@rm -rf lcov_data/
|
||||
@$(mkinstalldirs) lcov_data/
|
||||
@echo
|
||||
-@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.c -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | $(EGREP) $(LCOV_INCLUDE) | sed -e 's/.libs/zzzz/g' | sort | sed -e 's/zzzz/.libs/g' | uniq` ;\
|
||||
-@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.c -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | $(EGREP) $(LCOV_INCLUDE) | uniq` ;\
|
||||
for x in $$files; do \
|
||||
echo -n . ;\
|
||||
y=`echo $$x | sed -e 's!\.libs/!!'`; \
|
||||
|
||||
+4
-8
@@ -45,16 +45,15 @@ Currently we have the following branches in use::
|
||||
|
||||
master The active development branch.
|
||||
|
||||
PHP-5.6 Is used to release the PHP 5.6.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.5 Is used to release the PHP 5.5.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.3 This branch is closed.
|
||||
PHP-5.3 Is used to release the PHP 5.3.x series. This is currently
|
||||
in extended support and open forsecurity fixes only. Triaged
|
||||
via security@php.net
|
||||
|
||||
PHP-5.2 This branch is closed.
|
||||
|
||||
@@ -62,12 +61,9 @@ Currently we have the following branches in use::
|
||||
|
||||
PHP-4.4 This branch is closed.
|
||||
|
||||
PHP-X.Y.Z These branches are used for the release managers for tagging
|
||||
the releases, hence they are closed to the general public.
|
||||
|
||||
The next few rules are more of a technical nature::
|
||||
|
||||
1. All changes should first go to the lowest branch (i.e. 5.4) and then
|
||||
1. All changes should first go to the lowest branch (i.e. 5.3) and then
|
||||
get merged up to all other branches. If a change is not needed for
|
||||
later branches (i.e. fixes for features which where dropped from later
|
||||
branches) an empty merge should be done.
|
||||
|
||||
@@ -196,11 +196,11 @@ last commit id to web/php.git, then, mirrors will now sync
|
||||
Getting the stable release announced
|
||||
------------------------------------
|
||||
|
||||
1. Update phpweb/include/releases.inc with the old release info
|
||||
(updates the download archives)
|
||||
1. Run the bumpRelease script for phpweb on your local checkout
|
||||
|
||||
a. You can run ``php bin/bumpRelease 5`` if you are making a release for the
|
||||
highest branch, otherwise you have to do this manually, see point 1.b
|
||||
a. ``php bin/bumpRelease 5`` to create the release file (releases/x_y_z.php)
|
||||
The release announcement file should list in detail security fixes and
|
||||
changes in behavior (whether due to a bug fix or not).
|
||||
|
||||
b. In case multiple PHP minor versions are in active development you have
|
||||
to manually copy the old information to include/releases.inc
|
||||
@@ -220,9 +220,8 @@ Getting the stable release announced
|
||||
|
||||
f. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows")
|
||||
|
||||
3. Create the release file (releases/x_y_z.php)
|
||||
Usually we use the same content as for point 6, but included in php template
|
||||
instead of the release xml.
|
||||
3. Update phpweb/include/releases.php with the old release info
|
||||
(updates the download archives)
|
||||
|
||||
4. Update php-qa/include/release-qa.php and add the next version as an QARELEASE
|
||||
(prepare for next RC)
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ the original run-tests.php script. server-tests is *not* used by
|
||||
'make test'. server-tests was developed to provide support for
|
||||
testing PHP under it's primary environment, HTTP, and can run the
|
||||
PHP tests under any of the SAPI modules that are direct executables,
|
||||
or are accessible via HTTP.
|
||||
or are accessable via HTTP.
|
||||
|
||||
[New features]
|
||||
----------------
|
||||
@@ -95,7 +95,7 @@ include:
|
||||
$filename full native path to file, will become PATH_TRANSLATED
|
||||
$filepath =dirname($filename)
|
||||
$scriptname this is what will become SCRIPT_NAME unless you override it
|
||||
$docroot the equivalent of DOCUMENT_ROOT under Apache
|
||||
$docroot the equivelant of DOCUMENT_ROOT under Apache
|
||||
$cwd the directory that the test is being initiated from
|
||||
$this->conf all server-tests configuration vars
|
||||
$this->env all environment variables that will get passed to the test
|
||||
@@ -105,7 +105,7 @@ include:
|
||||
This section is also eval'd, and is similar in nature to --ENV--. However,
|
||||
this section is used to build the url used in an HTTP request. Valid values
|
||||
to set in this section would include:
|
||||
SCRIPT_NAME The initial part of the request url
|
||||
SCRIPT_NAME The inital part of the request url
|
||||
PATH_INFO The pathinfo part of a request url
|
||||
FRAGMENT The fragment section of a url (after #)
|
||||
QUERY_STRING The query part of a url (after ?)
|
||||
|
||||
Regular → Executable
File mode changed.
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
| Copyright (c) 1997-2014 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
| Copyright (c) 1997-2014 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
| Copyright (c) 1997-2014 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2015 The PHP Group |
|
||||
| Copyright (c) 1997-2014 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -89,10 +89,6 @@ PHP 5.6 UPGRADE NOTES
|
||||
- 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
|
||||
@@ -217,7 +213,6 @@ PHP 5.6 UPGRADE NOTES
|
||||
|
||||
- Strings:
|
||||
substr_compare() now allows $length to be zero.
|
||||
pack() and unpack() now support 64-bit format specifiers: q, Q, J and P.
|
||||
|
||||
- Crypt:
|
||||
crypt() will now raise an E_NOTICE error if the salt parameter is omitted.
|
||||
@@ -233,13 +228,6 @@ PHP 5.6 UPGRADE NOTES
|
||||
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.
|
||||
@@ -257,26 +245,12 @@ PHP 5.6 UPGRADE NOTES
|
||||
Manipulated serialization strings for objects implementing Serializable by
|
||||
replacing "C:" with "O:" at the start will now produce an error.
|
||||
|
||||
- parse_ini_file():
|
||||
- parse_ini_string():
|
||||
Added scanner mode INI_SCANNER_TYPED to yield typed .ini values.
|
||||
For PHP >= 5.6.1
|
||||
|
||||
- JSON:
|
||||
Added JSON_PRESERVE_ZERO_FRACTION option (PHP >= 5.6.5)
|
||||
|
||||
========================================
|
||||
6. New Functions
|
||||
========================================
|
||||
|
||||
- Datetime:
|
||||
Added DatePeriod::getStartDate(), DatePeriod::getEndDate(), DatePeriod::getDateInterval() in 5.6.5.
|
||||
|
||||
- GMP:
|
||||
Added gmp_root($a, $nth) and gmp_rootrem($a, $nth) for calculating nth roots.
|
||||
Added gmp_import($data, $word_size = 1, $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN) in PHP 5.6.1.
|
||||
Added gmp_export($gmpnumber, $word_size = 1, $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN) in PHP 5.6.1.
|
||||
Added gmp_random_range() and gmp_random_bits() in PHP 5.6.3.
|
||||
|
||||
- Hash
|
||||
Added hash_equals($known_string, $user_string)
|
||||
@@ -304,15 +278,12 @@ PHP 5.6 UPGRADE NOTES
|
||||
Added PDO::pgsqlGetNotify($result_type = PDO::FETCH_USE_DEFAULT, $ms_timeout = 0)
|
||||
Added PDO::pgsqlGetPid()
|
||||
|
||||
- Reflection
|
||||
Added ReflectionFunction::isVariadic() and ReflectionParameter::isVariadic().
|
||||
- Zip:
|
||||
Added ZipArchive::setPassword($password)
|
||||
|
||||
- SPL
|
||||
Added SplFileObject::fread($length) to complement fwrite() method (>= 5.5.11)
|
||||
|
||||
- Zip:
|
||||
Added ZipArchive::setPassword($password)
|
||||
|
||||
========================================
|
||||
7. New Classes and Interfaces
|
||||
========================================
|
||||
@@ -387,16 +358,10 @@ PHP 5.6 UPGRADE NOTES
|
||||
- Added LISTEN/NOTIFY support via PDO::pgsqlGetNotify / PDO::pgsqlGetPid()
|
||||
as described in https://bugs.php.net/bug.php?id=42614.
|
||||
|
||||
- DOM:
|
||||
- DOMNode::textContent is now a writeable property. (>= 5.6.1)
|
||||
|
||||
========================================
|
||||
10. New Global Constants
|
||||
========================================
|
||||
|
||||
- CURL:
|
||||
CURL_HTTP_VERSION_2_0 and CURL_VERSION_HTTP2 (>= 5.6.8)
|
||||
|
||||
- LDAP:
|
||||
LDAP_ESCAPE_FILTER int(1)
|
||||
LDAP_ESCAPE_DN int(2)
|
||||
|
||||
+13
-5
@@ -1,6 +1,6 @@
|
||||
$Id$
|
||||
|
||||
PHP 5.6 INTERNALS UPGRADE NOTES
|
||||
UPGRADE NOTES - PHP X.Y
|
||||
|
||||
1. Internal API changes
|
||||
a. Addition of do_operation and compare object handlers
|
||||
@@ -12,8 +12,9 @@ PHP 5.6 INTERNALS UPGRADE NOTES
|
||||
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
|
||||
j. An additional parameter is sent to Countable::count()
|
||||
k. Unserialization of manipulated object strings
|
||||
l. Removal of IS_CONSTANT_ARRAY and IS_CONSTANT_INDEX hack
|
||||
|
||||
2. Build system changes
|
||||
a. Unix build system changes
|
||||
@@ -184,7 +185,14 @@ PHP 5.6 INTERNALS UPGRADE NOTES
|
||||
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
|
||||
j. An additional parameter is sent to Countable::count()
|
||||
|
||||
That parameter denotes the $mode passed to count; it shouldn't affect any
|
||||
userland code, but any zend_parse_parameters() used with no arguments should
|
||||
fail. Extensions which implement Countable internally, need to accept one
|
||||
optional long as parameter.
|
||||
|
||||
k. Unserialization of manipulated object strings
|
||||
|
||||
Strings requiring unserialization of objects are now explicitly checked
|
||||
whether the object they contain implements the Serializable interface.
|
||||
@@ -199,7 +207,7 @@ PHP 5.6 INTERNALS UPGRADE NOTES
|
||||
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
|
||||
l. 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
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67468 (Segfault in highlight_file()/highlight_string())
|
||||
--SKIPIF--
|
||||
<?php if(!function_exists("leak")) print "skip only for debug builds"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
highlight_string("<?php __CLASS__;", true);
|
||||
echo "done";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #65419 (Inside trait, self::class != __CLASS__)
|
||||
--FILE--
|
||||
<?php
|
||||
trait abc
|
||||
{
|
||||
static function def()
|
||||
{
|
||||
echo self::class, "\n";
|
||||
echo __CLASS__, "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class ghi
|
||||
{
|
||||
use abc;
|
||||
}
|
||||
|
||||
ghi::def();
|
||||
?>
|
||||
--EXPECTF--
|
||||
ghi
|
||||
ghi
|
||||
@@ -1,73 +0,0 @@
|
||||
--TEST--
|
||||
Bug #66608 (Incorrect behavior with nested "finally" blocks)
|
||||
--FILE--
|
||||
<?php
|
||||
function bar() {
|
||||
try {
|
||||
echo "1\n";
|
||||
try {
|
||||
} finally {
|
||||
try {
|
||||
} finally {
|
||||
}
|
||||
echo "2\n";
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
throw new Exception ("");
|
||||
} catch (Exception $ab) {
|
||||
echo "3\n";
|
||||
} finally {
|
||||
try {
|
||||
} finally {
|
||||
echo "4\n";
|
||||
try {
|
||||
} finally {
|
||||
}
|
||||
echo "5\n";
|
||||
}
|
||||
}
|
||||
echo "6\n";
|
||||
try {
|
||||
} finally {
|
||||
while (1) {
|
||||
try {
|
||||
echo "7\n";
|
||||
break;
|
||||
} finally {
|
||||
echo "8\n";
|
||||
}
|
||||
echo "bad";
|
||||
}
|
||||
echo "9\n";
|
||||
while (1) {
|
||||
try {
|
||||
throw new Exception("");
|
||||
} catch(Exception $e) {
|
||||
echo "10\n";
|
||||
break;
|
||||
} finally {
|
||||
echo "11\n";
|
||||
}
|
||||
echo "bak\n";
|
||||
}
|
||||
}
|
||||
echo "12\n";
|
||||
}
|
||||
echo "13\n";
|
||||
}
|
||||
bar();
|
||||
--EXPECT--
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #66609 (php crashes with __get() and ++ operator in some cases)
|
||||
--FILE--
|
||||
<?php
|
||||
$bar = new Bar;
|
||||
$foo = new Foo;
|
||||
class Bar {
|
||||
public function __get($x) {
|
||||
global $foo;
|
||||
return $foo->foo;
|
||||
}
|
||||
}
|
||||
class Foo {
|
||||
public function __get($x) {
|
||||
global $bar;
|
||||
return $bar->bar;
|
||||
}
|
||||
}
|
||||
$foo->blah += 1; //crash
|
||||
++$foo->blah; //crash
|
||||
$foo->blah++; //crash
|
||||
$foo->blah--; //crash
|
||||
--$foo->blah; //crash
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined property: Bar::$bar in %sbug66609.php on line %d
|
||||
okey
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67111: Memory leak when using "continue 2" inside two foreach loops
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array1 = [1, 2, 3];
|
||||
$array2 = [1, 2, 3];
|
||||
|
||||
foreach ($array1 as $x) {
|
||||
foreach ($array2 as $y) {
|
||||
echo "$x.$y\n";
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
1.1
|
||||
2.1
|
||||
3.1
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67368 (Memory leak with immediately dereferenced array in class constant)
|
||||
--INI--
|
||||
report_memleaks=1
|
||||
--FILE--
|
||||
<?php
|
||||
class FooBar {
|
||||
const bar = ["bar" => 3]["bar"];
|
||||
}
|
||||
echo "okey";
|
||||
--EXPECTF--
|
||||
okey
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
class a {
|
||||
public function test($arg = c::TESTCONSTANT) {
|
||||
echo __METHOD__ . "($arg)\n";
|
||||
}
|
||||
|
||||
static public function staticTest() {
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
class b extends a {
|
||||
public function test() {
|
||||
echo __METHOD__ . "()\n";
|
||||
parent::test();
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
bug67436: Autoloader isn't called if user defined error handler is present
|
||||
|
||||
--INI--
|
||||
error_reporting=-1
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($classname) {
|
||||
if (in_array($classname, array('a','b','c'))) {
|
||||
require_once __DIR__ . "/{$classname}.php";
|
||||
}
|
||||
});
|
||||
|
||||
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
|
||||
}, error_reporting());
|
||||
|
||||
a::staticTest();
|
||||
|
||||
$b = new b();
|
||||
$b->test();
|
||||
|
||||
--EXPECT--
|
||||
b::test()
|
||||
a::test(c::TESTCONSTANT)
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
bug67436: E_STRICT instead of custom error handler
|
||||
|
||||
--INI--
|
||||
error_reporting=-1
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($classname) {
|
||||
if (in_array($classname, array('a','b','c'))) {
|
||||
require_once __DIR__ . "/{$classname}.php";
|
||||
}
|
||||
});
|
||||
|
||||
a::staticTest();
|
||||
|
||||
$b = new b();
|
||||
$b->test();
|
||||
|
||||
--EXPECTF--
|
||||
Strict Standards: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s%ebug67436%eb.php on line %d
|
||||
b::test()
|
||||
a::test(c::TESTCONSTANT)
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
class c {
|
||||
const TESTCONSTANT = "c::TESTCONSTANT";
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67633: A foreach on an array returned from a function not doing copy-on-write
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function id($x) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
function &ref_id(&$x) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
$c = 'c';
|
||||
$array = ['a', 'b', $c];
|
||||
|
||||
foreach(id($array) as &$v) {
|
||||
$v .= 'q';
|
||||
}
|
||||
var_dump($array);
|
||||
|
||||
foreach(ref_id($array) as &$v) {
|
||||
$v .= 'q';
|
||||
}
|
||||
var_dump($array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "a"
|
||||
[1]=>
|
||||
string(1) "b"
|
||||
[2]=>
|
||||
string(1) "c"
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(2) "aq"
|
||||
[1]=>
|
||||
string(2) "bq"
|
||||
[2]=>
|
||||
&string(2) "cq"
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67938: Segfault when extending interface method with variadic
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface TestInterface {
|
||||
public function foo();
|
||||
public function bar(array $bar);
|
||||
}
|
||||
|
||||
class Test implements TestInterface {
|
||||
public function foo(...$args) {
|
||||
echo __METHOD__, "\n";
|
||||
}
|
||||
public function bar(array $bar, ...$args) {
|
||||
echo __METHOD__, "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$obj->foo();
|
||||
$obj->bar([]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Test::foo
|
||||
Test::bar
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67985 - Last used array index not copied to new array at assignment
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = ['zero', 'one', 'two'];
|
||||
unset($a[2]);
|
||||
$b = $a;
|
||||
$a[] = 'three';
|
||||
$b[] = 'three';
|
||||
|
||||
var_dump($a === $b);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #68118: $a->foo .= 'test'; can leave $a->foo undefined
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function() {
|
||||
$obj = new stdClass;
|
||||
$obj->test = 'meow';
|
||||
return true;
|
||||
});
|
||||
|
||||
$a = new stdClass;
|
||||
$a->undefined .= 'test';
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#2 (1) {
|
||||
["undefined"]=>
|
||||
string(4) "test"
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #68370 "unset($this)" can make the program crash
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
public function test() {
|
||||
unset($this);
|
||||
return get_defined_vars();
|
||||
}
|
||||
}
|
||||
$c = new C();
|
||||
$x = $c->test();
|
||||
print_r($x);
|
||||
unset($c, $x);
|
||||
--EXPECTF--
|
||||
Array
|
||||
(
|
||||
)
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Bug #68446 (Array constant not accepted for array parameter default)
|
||||
--FILE--
|
||||
<?php
|
||||
const FOO = [1];
|
||||
const BAR = null;
|
||||
|
||||
function a(array $a = FOO) {
|
||||
var_dump($a);
|
||||
}
|
||||
|
||||
function b(array $b = BAR) {
|
||||
var_dump($b);
|
||||
}
|
||||
|
||||
b(null);
|
||||
b([]);
|
||||
b();
|
||||
a([]);
|
||||
a();
|
||||
a(null);
|
||||
?>
|
||||
--EXPECTF--
|
||||
NULL
|
||||
array(0) {
|
||||
}
|
||||
NULL
|
||||
array(0) {
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
|
||||
Catchable fatal error: Argument 1 passed to a() must be of the type array, null given, called in %s on line %d and defined in %s on line %d
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
--TEST--
|
||||
#69017 (Fail to push to the empty array with the constant value defined in class scope)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class c1
|
||||
{
|
||||
const ZERO = 0;
|
||||
const ONE = 1;
|
||||
const MAX = PHP_INT_MAX;
|
||||
public static $a1 = array(self::ONE => 'one');
|
||||
public static $a2 = array(self::ZERO => 'zero');
|
||||
public static $a3 = array(self::MAX => 'zero');
|
||||
}
|
||||
|
||||
|
||||
c1::$a1[] = 1;
|
||||
c1::$a2[] = 1;
|
||||
c1::$a3[] = 1;
|
||||
|
||||
var_dump(c1::$a1);
|
||||
var_dump(c1::$a2);
|
||||
var_dump(c1::$a3);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %sbug69017.php on line %d
|
||||
array(2) {
|
||||
[1]=>
|
||||
string(3) "one"
|
||||
[2]=>
|
||||
int(1)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(4) "zero"
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
array(1) {
|
||||
[%d]=>
|
||||
string(4) "zero"
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69174 (leaks when unused inner class use traits precedence)
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
class C1 {
|
||||
use T1, T2 {
|
||||
T1::foo insteadof T2;
|
||||
T1::bar insteadof T2;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
==DONE==
|
||||
@@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69212: Leaking VIA_HANDLER func when exception thrown in __call/... arg passing
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public static function __callStatic($method, $args) {}
|
||||
public function __call($method, $args) {}
|
||||
}
|
||||
|
||||
function do_throw() { throw new Exception; }
|
||||
|
||||
try {
|
||||
Test::foo(do_throw());
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
try {
|
||||
(new Test)->bar(do_throw());
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
|
||||
try {
|
||||
$f = function () {};
|
||||
$f->__invoke(do_throw());
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
|
||||
try {
|
||||
$t = new Test;
|
||||
$f->__invoke($t->bar(Test::foo(do_throw())));
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Caught!
|
||||
Caught!
|
||||
Caught!
|
||||
Caught!
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69221: Segmentation fault when using a generator in combination with an Iterator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield 1;
|
||||
};
|
||||
|
||||
$gen1 = gen();
|
||||
$gen2 = (object) $gen1;
|
||||
|
||||
foreach ($gen1 as $v1) {
|
||||
foreach ($gen2 as $v2) {
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
|
||||
unset($gen1);
|
||||
foreach ($gen2 as $v) { var_dump($v); }
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69221: Segmentation fault when using a generator in combination with an Iterator (2)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$gen = function() {
|
||||
yield 1;
|
||||
};
|
||||
|
||||
$iter = new IteratorIterator($gen());
|
||||
$ngen = $iter->getInnerIterator();
|
||||
|
||||
var_dump(iterator_to_array($ngen, false));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Closure 049: static::class in static closure in non-static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
function foo() {
|
||||
$f = static function() {
|
||||
return static::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
$b = new B;
|
||||
|
||||
var_dump($b->foo());
|
||||
--EXPECT--
|
||||
string(1) "B"
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Closure 050: static::class in non-static closure in non-static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
function foo() {
|
||||
$f = function() {
|
||||
return static::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
$b = new B;
|
||||
var_dump($b->foo());
|
||||
|
||||
--EXPECT--
|
||||
string(1) "B"
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Closure 051: static::class in static closure in static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
static function foo() {
|
||||
$f = static function() {
|
||||
return static::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
var_dump(B::foo());
|
||||
|
||||
--EXPECT--
|
||||
string(1) "B"
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Closure 052: static::class in non-static closure in static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
static function foo() {
|
||||
$f = function() {
|
||||
return static::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
var_dump(B::foo());
|
||||
|
||||
--EXPECT--
|
||||
string(1) "B"
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Closure 053: self::class in static closure in non-static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
function foo() {
|
||||
$f = static function() {
|
||||
return self::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
$b = new B;
|
||||
var_dump($b->foo());
|
||||
|
||||
--EXPECT--
|
||||
string(1) "A"
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Closure 054: self::class in non-static closure in non-static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
function foo() {
|
||||
$f = function() {
|
||||
return self::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
$b = new B;
|
||||
var_dump($b->foo());
|
||||
|
||||
--EXPECT--
|
||||
string(1) "A"
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Closure 055: self::class in static closure in static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
static function foo() {
|
||||
$f = static function() {
|
||||
return self::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
var_dump(B::foo());
|
||||
|
||||
--EXPECT--
|
||||
string(1) "A"
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Closure 056: self::class in non-static closure in static method.
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
static function foo() {
|
||||
$f = function() {
|
||||
return self::class;
|
||||
};
|
||||
return $f();
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
var_dump(B::foo());
|
||||
|
||||
--EXPECT--
|
||||
string(1) "A"
|
||||
@@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Bug 66622: Closures do not correctly capture the late bound class (static::) in some cases
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
static function name() { return 'A'; }
|
||||
function foo() {
|
||||
$fn = function() { return static::name(); };
|
||||
echo static::name() . ' vs ' . $fn() . "\n";
|
||||
}
|
||||
function bar() {
|
||||
$fn = static function() { return static::name(); };
|
||||
echo static::name() . ' vs ' . $fn() . "\n";
|
||||
}
|
||||
static function baz() {
|
||||
$fn = function() { return static::name(); };
|
||||
echo static::name() . ' vs ' . $fn() . "\n";
|
||||
}
|
||||
}
|
||||
class B extends A {
|
||||
static function name() { return 'B'; }
|
||||
}
|
||||
|
||||
function test() {
|
||||
(new B)->foo();
|
||||
(new B)->bar();
|
||||
(new B)->baz();
|
||||
B::baz();
|
||||
}
|
||||
test();
|
||||
|
||||
--EXPECT--
|
||||
B vs B
|
||||
B vs B
|
||||
B vs B
|
||||
B vs B
|
||||
@@ -1,66 +0,0 @@
|
||||
--TEST--
|
||||
Constant expressions with arrays
|
||||
--FILE--
|
||||
<?php
|
||||
const a = [1,2,[3,[4]]];
|
||||
const b = a[0];
|
||||
const c = a[2][0];
|
||||
const d = a[2];
|
||||
const e = ["string" => [1]]["string"][0];
|
||||
|
||||
var_dump(b, c, e);
|
||||
|
||||
function test ($a = d[1][0]) {
|
||||
var_dump($a);
|
||||
}
|
||||
|
||||
test();
|
||||
|
||||
class foo {
|
||||
const bar = [1][0];
|
||||
}
|
||||
|
||||
var_dump(foo::bar);
|
||||
|
||||
var_dump(a, a[0], a[2], a[2][1], a[3]);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
int(3)
|
||||
int(1)
|
||||
int(4)
|
||||
int(1)
|
||||
|
||||
Notice: Undefined offset: 3 in %s on line %d
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
}
|
||||
int(1)
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(3)
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(4)
|
||||
}
|
||||
NULL
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Self-referencing constant expression (part of a constant AST)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
const FOO = [self::BAR];
|
||||
const BAR = [self::FOO];
|
||||
}
|
||||
var_dump(A::FOO);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot declare self-referencing constant 'self::FOO' in %s on line %d
|
||||
|
||||
@@ -76,4 +76,4 @@ NULL
|
||||
|
||||
Notice: Undefined offset: 3 in %s on line %d
|
||||
|
||||
Fatal error: Call to a member function bar() on null in %s on line %d
|
||||
Fatal error: Call to a member function bar() on a non-object in %s on line %d
|
||||
@@ -12,12 +12,4 @@ var_dump(test::TEST);
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
[1]=>
|
||||
int(2)
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
Done
|
||||
Fatal error: Arrays are not allowed in constants at run-time in %s on line %d
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #67467: eval with parse error causes segmentation fault in generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
$a = 1;
|
||||
yield $a;
|
||||
}
|
||||
|
||||
@eval('abc');
|
||||
|
||||
$values = gen();
|
||||
$values->next();
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -7,5 +7,5 @@ const C = array();
|
||||
var_dump(C);
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(0) {
|
||||
}
|
||||
Fatal error: Arrays are not allowed in constants at run-time in %sns_059.php on line 4
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Bug #65576 (Constructor from trait conflicts with inherited constructor)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait T
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
echo "Trait contructor\n";
|
||||
}
|
||||
}
|
||||
|
||||
class A
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
echo "Parent constructor\n";
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A
|
||||
{
|
||||
use T;
|
||||
}
|
||||
|
||||
new B();
|
||||
|
||||
--EXPECT--
|
||||
Trait contructor
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Bug #65576 (Constructor from trait conflicts with inherited constructor)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait T
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
echo "Trait contructor\n";
|
||||
}
|
||||
}
|
||||
|
||||
class A
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
echo "Parent constructor\n";
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A
|
||||
{
|
||||
use T;
|
||||
}
|
||||
|
||||
new B();
|
||||
|
||||
--EXPECT--
|
||||
Parent constructor
|
||||
Trait contructor
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Try finally (segfault with empty break)
|
||||
--FILE--
|
||||
<?php
|
||||
function foo () {
|
||||
try {
|
||||
break;
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
foo();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot break/continue 1 level in %stry_finally_011.php on line %d
|
||||
+6
-17
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -128,7 +128,7 @@ ZEND_API zval zval_used_for_init; /* True global variable */
|
||||
/* version information */
|
||||
static char *zend_version_info;
|
||||
static uint zend_version_info_length;
|
||||
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2015 Zend Technologies\n"
|
||||
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2014 Zend Technologies\n"
|
||||
#define PRINT_ZVAL_INDENT 4
|
||||
|
||||
static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, zend_bool is_object TSRMLS_DC) /* {{{ */
|
||||
@@ -817,22 +817,11 @@ void zend_shutdown(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
#ifdef ZEND_SIGNALS
|
||||
zend_signal_shutdown(TSRMLS_C);
|
||||
#endif
|
||||
#ifdef ZEND_WIN32
|
||||
zend_shutdown_timeout_thread();
|
||||
#endif
|
||||
zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
|
||||
|
||||
if (EG(active))
|
||||
{
|
||||
/*
|
||||
* The order of destruction is important here.
|
||||
* See bugs #65463 and 66036.
|
||||
*/
|
||||
zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) zend_cleanup_function_data_full TSRMLS_CC);
|
||||
zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) zend_cleanup_user_class_data TSRMLS_CC);
|
||||
zend_cleanup_internal_classes(TSRMLS_C);
|
||||
zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) clean_non_persistent_function_full TSRMLS_CC);
|
||||
zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) clean_non_persistent_class_full TSRMLS_CC);
|
||||
}
|
||||
|
||||
zend_destroy_modules();
|
||||
|
||||
virtual_cwd_deactivate(TSRMLS_C);
|
||||
@@ -898,7 +887,7 @@ ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
|
||||
/* }}} */
|
||||
END_EXTERN_C()
|
||||
|
||||
ZEND_API void zend_append_version_info(const zend_extension *extension) /* {{{ */
|
||||
void zend_append_version_info(const zend_extension *extension) /* {{{ */
|
||||
{
|
||||
char *new_info;
|
||||
uint new_info_length;
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -22,7 +22,7 @@
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "2.6.0"
|
||||
#define ZEND_VERSION "2.6.0-dev"
|
||||
|
||||
#define ZEND_ENGINE_2
|
||||
|
||||
|
||||
+11
-8
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -2499,7 +2499,7 @@ ZEND_API void zend_post_deactivate_modules(TSRMLS_D) /* {{{ */
|
||||
/* }}} */
|
||||
|
||||
/* return the next free module number */
|
||||
ZEND_API int zend_next_free_module(void) /* {{{ */
|
||||
int zend_next_free_module(void) /* {{{ */
|
||||
{
|
||||
return zend_hash_num_elements(&module_registry) + 1;
|
||||
}
|
||||
@@ -2635,15 +2635,18 @@ ZEND_API ZEND_FUNCTION(display_disabled_function)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_function_entry disabled_function[] = {
|
||||
ZEND_FE(display_disabled_function, NULL)
|
||||
ZEND_FE_END
|
||||
};
|
||||
|
||||
ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_internal_function *func;
|
||||
if (zend_hash_find(CG(function_table), function_name, function_name_length+1, (void **)&func)==SUCCESS) {
|
||||
func->arg_info = NULL;
|
||||
func->handler = ZEND_FN(display_disabled_function);
|
||||
return SUCCESS;
|
||||
if (zend_hash_del(CG(function_table), function_name, function_name_length+1)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
return FAILURE;
|
||||
disabled_function[0].fname = function_name;
|
||||
return zend_register_functions(NULL, disabled_function, CG(function_table), MODULE_PERSISTENT TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -233,7 +233,7 @@ typedef struct _zend_fcall_info_cache {
|
||||
|
||||
#define ZEND_FCI_INITIALIZED(fci) ((fci).size != 0)
|
||||
|
||||
ZEND_API int zend_next_free_module(void);
|
||||
int zend_next_free_module(void);
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API int zend_get_parameters(int ht, int param_count, ...);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
+7
-15
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -251,19 +251,10 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
|
||||
zval_dtor(&op2);
|
||||
break;
|
||||
case ZEND_CONST:
|
||||
/* class constants may be updated in-place */
|
||||
if (scope) {
|
||||
if (IS_CONSTANT_TYPE(Z_TYPE_P(ast->u.val))) {
|
||||
zval_update_constant_ex(&ast->u.val, 1, scope TSRMLS_CC);
|
||||
}
|
||||
*result = *ast->u.val;
|
||||
zval_copy_ctor(result);
|
||||
} 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);
|
||||
}
|
||||
*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);
|
||||
}
|
||||
break;
|
||||
case ZEND_BOOL_AND:
|
||||
@@ -337,7 +328,8 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
|
||||
{
|
||||
zval *tmp;
|
||||
zend_fetch_dimension_by_zval(&tmp, &op1, &op2 TSRMLS_CC);
|
||||
ZVAL_ZVAL(result, tmp, 1, 1);
|
||||
*result = *tmp;
|
||||
efree(tmp);
|
||||
}
|
||||
zval_dtor(&op1);
|
||||
zval_dtor(&op2);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -245,16 +245,16 @@ static const zend_function_entry builtin_functions[] = { /* {{{ */
|
||||
ZEND_FE(func_num_args, arginfo_zend__void)
|
||||
ZEND_FE(func_get_arg, arginfo_func_get_arg)
|
||||
ZEND_FE(func_get_args, arginfo_zend__void)
|
||||
ZEND_FE(strlen, arginfo_strlen)
|
||||
ZEND_FE(strcmp, arginfo_strcmp)
|
||||
ZEND_FE(strncmp, arginfo_strncmp)
|
||||
ZEND_FE(strcasecmp, arginfo_strcmp)
|
||||
ZEND_FE(strlen, arginfo_strlen)
|
||||
ZEND_FE(strcmp, arginfo_strcmp)
|
||||
ZEND_FE(strncmp, arginfo_strncmp)
|
||||
ZEND_FE(strcasecmp, arginfo_strcmp)
|
||||
ZEND_FE(strncasecmp, arginfo_strncmp)
|
||||
ZEND_FE(each, arginfo_each)
|
||||
ZEND_FE(each, arginfo_each)
|
||||
ZEND_FE(error_reporting, arginfo_error_reporting)
|
||||
ZEND_FE(define, arginfo_define)
|
||||
ZEND_FE(defined, arginfo_defined)
|
||||
ZEND_FE(get_class, arginfo_get_class)
|
||||
ZEND_FE(define, arginfo_define)
|
||||
ZEND_FE(defined, arginfo_defined)
|
||||
ZEND_FE(get_class, arginfo_get_class)
|
||||
ZEND_FE(get_called_class, arginfo_zend__void)
|
||||
ZEND_FE(get_parent_class, arginfo_get_class)
|
||||
ZEND_FE(method_exists, arginfo_method_exists)
|
||||
@@ -274,13 +274,13 @@ static const zend_function_entry builtin_functions[] = { /* {{{ */
|
||||
ZEND_FE(get_included_files, arginfo_zend__void)
|
||||
ZEND_FALIAS(get_required_files, get_included_files, arginfo_zend__void)
|
||||
ZEND_FE(is_subclass_of, arginfo_is_subclass_of)
|
||||
ZEND_FE(is_a, arginfo_is_subclass_of)
|
||||
ZEND_FE(is_a, arginfo_is_subclass_of)
|
||||
ZEND_FE(get_class_vars, arginfo_get_class_vars)
|
||||
ZEND_FE(get_object_vars, arginfo_get_object_vars)
|
||||
ZEND_FE(get_class_methods, arginfo_get_class_methods)
|
||||
ZEND_FE(trigger_error, arginfo_trigger_error)
|
||||
ZEND_FALIAS(user_error, trigger_error, arginfo_trigger_error)
|
||||
ZEND_FE(set_error_handler, arginfo_set_error_handler)
|
||||
ZEND_FE(set_error_handler, arginfo_set_error_handler)
|
||||
ZEND_FE(restore_error_handler, arginfo_zend__void)
|
||||
ZEND_FE(set_exception_handler, arginfo_set_exception_handler)
|
||||
ZEND_FE(restore_exception_handler, arginfo_zend__void)
|
||||
@@ -288,14 +288,14 @@ static const zend_function_entry builtin_functions[] = { /* {{{ */
|
||||
ZEND_FE(get_declared_traits, arginfo_zend__void)
|
||||
ZEND_FE(get_declared_interfaces, arginfo_zend__void)
|
||||
ZEND_FE(get_defined_functions, arginfo_zend__void)
|
||||
ZEND_FE(get_defined_vars, arginfo_zend__void)
|
||||
ZEND_FE(create_function, arginfo_create_function)
|
||||
ZEND_FE(get_resource_type, arginfo_get_resource_type)
|
||||
ZEND_FE(get_defined_vars, arginfo_zend__void)
|
||||
ZEND_FE(create_function, arginfo_create_function)
|
||||
ZEND_FE(get_resource_type, arginfo_get_resource_type)
|
||||
ZEND_FE(get_loaded_extensions, arginfo_get_loaded_extensions)
|
||||
ZEND_FE(extension_loaded, arginfo_extension_loaded)
|
||||
ZEND_FE(extension_loaded, arginfo_extension_loaded)
|
||||
ZEND_FE(get_extension_funcs, arginfo_extension_loaded)
|
||||
ZEND_FE(get_defined_constants, arginfo_get_defined_constants)
|
||||
ZEND_FE(debug_backtrace, arginfo_debug_backtrace)
|
||||
ZEND_FE(debug_backtrace, arginfo_debug_backtrace)
|
||||
ZEND_FE(debug_print_backtrace, arginfo_debug_print_backtrace)
|
||||
#if ZEND_DEBUG
|
||||
ZEND_FE(zend_test_func, NULL)
|
||||
@@ -305,7 +305,7 @@ static const zend_function_entry builtin_functions[] = { /* {{{ */
|
||||
#endif
|
||||
ZEND_FE(gc_collect_cycles, arginfo_zend__void)
|
||||
ZEND_FE(gc_enabled, arginfo_zend__void)
|
||||
ZEND_FE(gc_enable, arginfo_zend__void)
|
||||
ZEND_FE(gc_enable, arginfo_zend__void)
|
||||
ZEND_FE(gc_disable, arginfo_zend__void)
|
||||
ZEND_FE_END
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -443,7 +443,6 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
|
||||
|
||||
closure->func = *func;
|
||||
closure->func.common.prototype = NULL;
|
||||
closure->func.common.fn_flags |= ZEND_ACC_CLOSURE;
|
||||
|
||||
if ((scope == NULL) && (this_ptr != NULL)) {
|
||||
/* use dummy scope if we're binding an object without specifying a scope */
|
||||
@@ -481,7 +480,6 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
|
||||
}
|
||||
}
|
||||
|
||||
closure->this_ptr = NULL;
|
||||
/* Invariants:
|
||||
* If the closure is unscoped, it has no bound object.
|
||||
* The the closure is scoped, it's either static or it's bound */
|
||||
@@ -493,7 +491,10 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
|
||||
Z_ADDREF_P(this_ptr);
|
||||
} else {
|
||||
closure->func.common.fn_flags |= ZEND_ACC_STATIC;
|
||||
closure->this_ptr = NULL;
|
||||
}
|
||||
} else {
|
||||
closure->this_ptr = NULL;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
+13
-62
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -1931,11 +1931,8 @@ void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initializ
|
||||
if (class_type->u.constant.type == IS_ARRAY) {
|
||||
cur_arg_info->type_hint = IS_ARRAY;
|
||||
if (op == ZEND_RECV_INIT) {
|
||||
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
|
||||
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) {
|
||||
cur_arg_info->allow_null = 1;
|
||||
} else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) {
|
||||
/* delay constant resolution and check to run-time */
|
||||
cur_arg_info->allow_null = 0;
|
||||
} else if (Z_TYPE(initialization->u.constant) != IS_ARRAY) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL");
|
||||
}
|
||||
@@ -1943,11 +1940,8 @@ void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initializ
|
||||
} else if (class_type->u.constant.type == IS_CALLABLE) {
|
||||
cur_arg_info->type_hint = IS_CALLABLE;
|
||||
if (op == ZEND_RECV_INIT) {
|
||||
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
|
||||
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) {
|
||||
cur_arg_info->allow_null = 1;
|
||||
} else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) {
|
||||
/* delay constant resolution and check to run-time */
|
||||
cur_arg_info->allow_null = 0;
|
||||
} else {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with callable type hint can only be NULL");
|
||||
}
|
||||
@@ -1961,11 +1955,8 @@ void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initializ
|
||||
cur_arg_info->class_name = Z_STRVAL(class_type->u.constant);
|
||||
cur_arg_info->class_name_len = Z_STRLEN(class_type->u.constant);
|
||||
if (op == ZEND_RECV_INIT) {
|
||||
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
|
||||
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) {
|
||||
cur_arg_info->allow_null = 1;
|
||||
} else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) {
|
||||
/* delay constant resolution and check to run-time */
|
||||
cur_arg_info->allow_null = 0;
|
||||
} else {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with a class type hint can only be NULL");
|
||||
}
|
||||
@@ -2214,12 +2205,6 @@ void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static
|
||||
if (!CG(active_class_entry)) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot access self::class when no class scope is active");
|
||||
}
|
||||
if (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) {
|
||||
constant_name.op_type = IS_CONST;
|
||||
ZVAL_STRINGL(&constant_name.u.constant, "class", sizeof("class")-1, 1);
|
||||
zend_do_fetch_constant(result, class_name, &constant_name, ZEND_RT, 1 TSRMLS_CC);
|
||||
break;
|
||||
}
|
||||
zval_dtor(&class_name->u.constant);
|
||||
class_name->op_type = IS_CONST;
|
||||
ZVAL_STRINGL(&class_name->u.constant, CG(active_class_entry)->name, CG(active_class_entry)->name_length, 1);
|
||||
@@ -3273,7 +3258,7 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
|
||||
* go through all the parameters of the function and not just those present in the
|
||||
* prototype. */
|
||||
num_args = proto->common.num_args;
|
||||
if ((proto->common.fn_flags & ZEND_ACC_VARIADIC)
|
||||
if ((fe->common.fn_flags & ZEND_ACC_VARIADIC)
|
||||
&& fe->common.num_args > proto->common.num_args) {
|
||||
num_args = fe->common.num_args;
|
||||
}
|
||||
@@ -3476,11 +3461,8 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{
|
||||
*zv = *precv->op2.zv;
|
||||
zval_copy_ctor(zv);
|
||||
INIT_PZVAL(zv);
|
||||
if ((Z_TYPE_P(zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
|
||||
REALLOC_BUF_IF_EXCEED(buf, offset, length, Z_STRLEN_P(zv));
|
||||
memcpy(offset, Z_STRVAL_P(zv), Z_STRLEN_P(zv));
|
||||
offset += Z_STRLEN_P(zv);
|
||||
} else if (Z_TYPE_P(zv) == IS_BOOL) {
|
||||
zval_update_constant_ex(&zv, 1, fptr->common.scope TSRMLS_CC);
|
||||
if (Z_TYPE_P(zv) == IS_BOOL) {
|
||||
if (Z_LVAL_P(zv)) {
|
||||
memcpy(offset, "true", 4);
|
||||
offset += 4;
|
||||
@@ -3505,9 +3487,6 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{
|
||||
} else if (Z_TYPE_P(zv) == IS_ARRAY) {
|
||||
memcpy(offset, "Array", 5);
|
||||
offset += 5;
|
||||
} else if ((Z_TYPE_P(zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT_AST) {
|
||||
memcpy(offset, "<expression>", 12);
|
||||
offset += 12;
|
||||
} else {
|
||||
zend_make_printable_zval(zv, &zv_copy, &use_copy);
|
||||
REALLOC_BUF_IF_EXCEED(buf, offset, length, Z_STRLEN(zv_copy));
|
||||
@@ -3979,7 +3958,7 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint
|
||||
if (!strncmp(mname, ZEND_CLONE_FUNC_NAME, mname_len)) {
|
||||
ce->clone = fe; fe->common.fn_flags |= ZEND_ACC_CLONE;
|
||||
} else if (!strncmp(mname, ZEND_CONSTRUCTOR_FUNC_NAME, mname_len)) {
|
||||
if (ce->constructor && (!ce->parent || ce->constructor != ce->parent->constructor)) {
|
||||
if (ce->constructor) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name);
|
||||
}
|
||||
ce->constructor = fe; fe->common.fn_flags |= ZEND_ACC_CTOR;
|
||||
@@ -4006,7 +3985,7 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint
|
||||
zend_str_tolower_copy(lowercase_name, ce->name, ce->name_length);
|
||||
lowercase_name = (char*)zend_new_interned_string(lowercase_name, ce->name_length + 1, 1 TSRMLS_CC);
|
||||
if (!memcmp(mname, lowercase_name, mname_len)) {
|
||||
if (ce->constructor && (!ce->parent || ce->constructor != ce->parent->constructor)) {
|
||||
if (ce->constructor) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name);
|
||||
}
|
||||
ce->constructor = fe;
|
||||
@@ -4211,7 +4190,6 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait
|
||||
static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
size_t i, j = 0;
|
||||
zend_trait_precedence **precedences;
|
||||
zend_trait_precedence *cur_precedence;
|
||||
zend_trait_method_reference *cur_method_ref;
|
||||
char *lcname;
|
||||
@@ -4220,9 +4198,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
/* resolve class references */
|
||||
if (ce->trait_precedences) {
|
||||
i = 0;
|
||||
precedences = ce->trait_precedences;
|
||||
ce->trait_precedences = NULL;
|
||||
while ((cur_precedence = precedences[i])) {
|
||||
while ((cur_precedence = ce->trait_precedences[i])) {
|
||||
/** Resolve classes for all precedence operations. */
|
||||
if (cur_precedence->exclude_from_classes) {
|
||||
cur_method_ref = cur_precedence->trait_method;
|
||||
@@ -4264,8 +4240,8 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
|
||||
/* make sure that the trait method is not from a class mentioned in
|
||||
exclude_from_classes, for consistency */
|
||||
if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[j]) {
|
||||
zend_error(E_COMPILE_ERROR,
|
||||
if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[i]) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR,
|
||||
"Inconsistent insteadof definition. "
|
||||
"The method %s is to be used from %s, but %s is also on the exclude list",
|
||||
cur_method_ref->method_name,
|
||||
@@ -4279,7 +4255,6 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
}
|
||||
i++;
|
||||
}
|
||||
ce->trait_precedences = precedences;
|
||||
}
|
||||
|
||||
if (ce->trait_aliases) {
|
||||
@@ -4347,20 +4322,16 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
if (ce->trait_precedences) {
|
||||
HashTable exclude_table;
|
||||
zend_trait_precedence **precedences;
|
||||
|
||||
/* TODO: revisit this start size, may be its not optimal */
|
||||
zend_hash_init_ex(&exclude_table, 2, NULL, NULL, 0, 0);
|
||||
|
||||
precedences = ce->trait_precedences;
|
||||
ce->trait_precedences = NULL;
|
||||
zend_traits_compile_exclude_table(&exclude_table, precedences, ce->traits[i]);
|
||||
zend_traits_compile_exclude_table(&exclude_table, ce->trait_precedences, ce->traits[i]);
|
||||
|
||||
/* copies functions, applies defined aliasing, and excludes unused trait methods */
|
||||
zend_hash_apply_with_arguments(&ce->traits[i]->function_table TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, ce, &overriden, &exclude_table);
|
||||
|
||||
zend_hash_destroy(&exclude_table);
|
||||
ce->trait_precedences = precedences;
|
||||
} else {
|
||||
zend_hash_apply_with_arguments(&ce->traits[i]->function_table TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, ce, &overriden, NULL);
|
||||
}
|
||||
@@ -4368,17 +4339,6 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
|
||||
|
||||
zend_hash_apply_with_argument(&ce->function_table, (apply_func_arg_t)zend_fixup_trait_method, ce TSRMLS_CC);
|
||||
|
||||
if (ce->trait_precedences) {
|
||||
i = 0;
|
||||
while (ce->trait_precedences[i]) {
|
||||
if (ce->trait_precedences[i]->exclude_from_classes) {
|
||||
efree(ce->trait_precedences[i]->exclude_from_classes);
|
||||
ce->trait_precedences[i]->exclude_from_classes = NULL;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (overriden) {
|
||||
zend_hash_destroy(overriden);
|
||||
FREE_HASHTABLE(overriden);
|
||||
@@ -6371,15 +6331,6 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
|
||||
/* save the location of FETCH_W instruction(s) */
|
||||
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
|
||||
zend_do_end_variable_parse(array, BP_VAR_W, 0 TSRMLS_CC);
|
||||
|
||||
if (zend_is_function_or_method_call(array)) {
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
opline->opcode = ZEND_SEPARATE;
|
||||
SET_NODE(opline->op1, array);
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->result_type = IS_VAR;
|
||||
opline->result.var = opline->op1.var;
|
||||
}
|
||||
} else {
|
||||
is_variable = 0;
|
||||
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
|
||||
|
||||
+1
-6
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -686,8 +686,6 @@ 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 int clean_non_persistent_function_full(zend_function *function TSRMLS_DC);
|
||||
ZEND_API int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC);
|
||||
|
||||
ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC);
|
||||
ZEND_API void zend_function_dtor(zend_function *function);
|
||||
@@ -866,9 +864,6 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC);
|
||||
#define ZEND_FAST_RET_TO_CATCH 1
|
||||
#define ZEND_FAST_RET_TO_FINALLY 2
|
||||
|
||||
#define ZEND_FAST_CALL_FROM_CATCH 1
|
||||
#define ZEND_FAST_CALL_FROM_FINALLY 2
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#define ZEND_CLONE_FUNC_NAME "__clone"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -587,14 +587,10 @@ ZEND_METHOD(exception, getTraceAsString)
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
|
||||
if(Z_TYPE_P(trace) != IS_ARRAY) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
res = estrdup("");
|
||||
str = &res;
|
||||
|
||||
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);
|
||||
|
||||
s_tmp = emalloc(1 + MAX_LENGTH_OF_LONG + 7 + 1);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
+6
-42
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -608,22 +608,7 @@ ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int is_null_constant(zval *default_value TSRMLS_DC)
|
||||
{
|
||||
if (IS_CONSTANT_TYPE(Z_TYPE_P(default_value))) {
|
||||
zval constant = *default_value;
|
||||
zval *constant_ptr = &constant;
|
||||
|
||||
zval_update_constant(&constant_ptr, 0 TSRMLS_CC);
|
||||
if (Z_TYPE(constant) == IS_NULL) {
|
||||
return 1;
|
||||
}
|
||||
zval_dtor(&constant);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg, ulong fetch_type, zval *default_value TSRMLS_DC)
|
||||
static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg, ulong fetch_type TSRMLS_DC)
|
||||
{
|
||||
zend_arg_info *cur_arg_info;
|
||||
char *need_msg;
|
||||
@@ -653,7 +638,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
|
||||
if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
|
||||
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "instance of ", Z_OBJCE_P(arg)->name TSRMLS_CC);
|
||||
}
|
||||
} else if (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC)))) {
|
||||
} else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) {
|
||||
need_msg = zend_verify_arg_class_kind(cur_arg_info, fetch_type, &class_name, &ce TSRMLS_CC);
|
||||
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "" TSRMLS_CC);
|
||||
}
|
||||
@@ -664,7 +649,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
|
||||
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", "none", "" TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) {
|
||||
if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
|
||||
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", zend_zval_type_name(arg), "" TSRMLS_CC);
|
||||
}
|
||||
break;
|
||||
@@ -673,7 +658,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
|
||||
if (!arg) {
|
||||
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", "none", "" TSRMLS_CC);
|
||||
}
|
||||
if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) {
|
||||
if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
|
||||
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "" TSRMLS_CC);
|
||||
}
|
||||
break;
|
||||
@@ -958,26 +943,6 @@ copy_value:
|
||||
}
|
||||
}
|
||||
|
||||
static void zval_deep_copy(zval **p)
|
||||
{
|
||||
zval *value;
|
||||
|
||||
ALLOC_ZVAL(value);
|
||||
*value = **p;
|
||||
if (Z_TYPE_P(value) == IS_ARRAY) {
|
||||
HashTable *ht;
|
||||
|
||||
ALLOC_HASHTABLE(ht);
|
||||
zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL_P(value)), NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(ht, Z_ARRVAL_P(value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *));
|
||||
Z_ARRVAL_P(value) = ht;
|
||||
} else {
|
||||
zval_copy_ctor(value);
|
||||
}
|
||||
INIT_PZVAL(value);
|
||||
*p = value;
|
||||
}
|
||||
|
||||
/* Utility Functions for Extensions */
|
||||
static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
|
||||
{
|
||||
@@ -1525,8 +1490,7 @@ ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_i
|
||||
} else {
|
||||
zval **return_value_ptr = &EX_TMP_VAR(execute_data_ptr, execute_data_ptr->opline->result.var)->var.ptr;
|
||||
execute_data_ptr->function_state.function->internal_function.handler(
|
||||
execute_data_ptr->opline->extended_value + execute_data_ptr->call->num_additional_args,
|
||||
*return_value_ptr, return_value_ptr,
|
||||
execute_data_ptr->opline->extended_value, *return_value_ptr, return_value_ptr,
|
||||
execute_data_ptr->object, return_value_used TSRMLS_CC
|
||||
);
|
||||
}
|
||||
|
||||
+8
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -364,6 +364,13 @@ 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);
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
void zend_init_timeout_thread(void);
|
||||
void zend_shutdown_timeout_thread(void);
|
||||
#define WM_REGISTER_ZEND_TIMEOUT (WM_USER+1)
|
||||
#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))
|
||||
|
||||
|
||||
+126
-44
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -46,10 +46,13 @@ ZEND_API const zend_fcall_info empty_fcall_info = { 0, NULL, NULL, NULL, NULL, 0
|
||||
ZEND_API const zend_fcall_info_cache empty_fcall_info_cache = { 0, NULL, NULL, NULL, NULL };
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
#ifdef ZTS
|
||||
__declspec(thread)
|
||||
#endif
|
||||
HANDLE tq_timer = NULL;
|
||||
#include <process.h>
|
||||
static WNDCLASS wc;
|
||||
static HWND timeout_window;
|
||||
static HANDLE timeout_thread_event;
|
||||
static HANDLE timeout_thread_handle;
|
||||
static DWORD timeout_thread_id;
|
||||
static int timeout_thread_initialized=0;
|
||||
#endif
|
||||
|
||||
#if 0&&ZEND_DEBUG
|
||||
@@ -106,7 +109,7 @@ static int clean_non_persistent_function(zend_function *function TSRMLS_DC) /* {
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int clean_non_persistent_function_full(zend_function *function TSRMLS_DC) /* {{{ */
|
||||
static int clean_non_persistent_function_full(zend_function *function TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return (function->type == ZEND_INTERNAL_FUNCTION) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
|
||||
}
|
||||
@@ -118,7 +121,7 @@ static int clean_non_persistent_class(zend_class_entry **ce TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC) /* {{{ */
|
||||
static int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return ((*ce)->type == ZEND_INTERNAL_CLASS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
|
||||
}
|
||||
@@ -446,6 +449,8 @@ ZEND_API int zend_is_true(zval *op) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#include "../TSRM/tsrm_strtok_r.h"
|
||||
|
||||
#define IS_VISITED_CONSTANT 0x80
|
||||
#define IS_CONSTANT_VISITED(p) (Z_TYPE_P(p) & IS_VISITED_CONSTANT)
|
||||
#define Z_REAL_TYPE_P(p) (Z_TYPE_P(p) & ~IS_VISITED_CONSTANT)
|
||||
@@ -1231,19 +1236,111 @@ ZEND_API void zend_timeout(int dummy) /* {{{ */
|
||||
/* }}} */
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
VOID CALLBACK tq_timer_cb(PVOID arg, BOOLEAN timed_out)
|
||||
static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) /* {{{ */
|
||||
{
|
||||
zend_bool *php_timed_out;
|
||||
switch (message) {
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
case WM_REGISTER_ZEND_TIMEOUT:
|
||||
/* wParam is the thread id pointer, lParam is the timeout amount in seconds */
|
||||
if (lParam == 0) {
|
||||
KillTimer(timeout_window, wParam);
|
||||
} else {
|
||||
#ifdef ZTS
|
||||
void ***tsrm_ls;
|
||||
#endif
|
||||
SetTimer(timeout_window, wParam, lParam*1000, NULL);
|
||||
#ifdef ZTS
|
||||
tsrm_ls = ts_resource_ex(0, &wParam);
|
||||
if (!tsrm_ls) {
|
||||
/* shouldn't normally happen */
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
EG(timed_out) = 0;
|
||||
}
|
||||
break;
|
||||
case WM_UNREGISTER_ZEND_TIMEOUT:
|
||||
/* wParam is the thread id pointer */
|
||||
KillTimer(timeout_window, wParam);
|
||||
break;
|
||||
case WM_TIMER: {
|
||||
#ifdef ZTS
|
||||
void ***tsrm_ls;
|
||||
|
||||
/* The doc states it'll be always true, however it theoretically
|
||||
could be FALSE when the thread was signaled. */
|
||||
if (!timed_out) {
|
||||
tsrm_ls = ts_resource_ex(0, &wParam);
|
||||
if (!tsrm_ls) {
|
||||
/* Thread died before receiving its timeout? */
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
KillTimer(timeout_window, wParam);
|
||||
EG(timed_out) = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static unsigned __stdcall timeout_thread_proc(void *pArgs) /* {{{ */
|
||||
{
|
||||
MSG message;
|
||||
|
||||
wc.style=0;
|
||||
wc.lpfnWndProc = zend_timeout_WndProc;
|
||||
wc.cbClsExtra=0;
|
||||
wc.cbWndExtra=0;
|
||||
wc.hInstance=NULL;
|
||||
wc.hIcon=NULL;
|
||||
wc.hCursor=NULL;
|
||||
wc.hbrBackground=(HBRUSH)(COLOR_BACKGROUND + 5);
|
||||
wc.lpszMenuName=NULL;
|
||||
wc.lpszClassName = "Zend Timeout Window";
|
||||
if (!RegisterClass(&wc)) {
|
||||
return -1;
|
||||
}
|
||||
timeout_window = CreateWindow(wc.lpszClassName, wc.lpszClassName, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL);
|
||||
SetEvent(timeout_thread_event);
|
||||
while (GetMessage(&message, NULL, 0, 0)) {
|
||||
SendMessage(timeout_window, message.message, message.wParam, message.lParam);
|
||||
if (message.message == WM_QUIT) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
DestroyWindow(timeout_window);
|
||||
UnregisterClass(wc.lpszClassName, NULL);
|
||||
SetEvent(timeout_thread_handle);
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_init_timeout_thread(void) /* {{{ */
|
||||
{
|
||||
timeout_thread_event = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
timeout_thread_handle = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
_beginthreadex(NULL, 0, timeout_thread_proc, NULL, 0, &timeout_thread_id);
|
||||
WaitForSingleObject(timeout_thread_event, INFINITE);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void zend_shutdown_timeout_thread(void) /* {{{ */
|
||||
{
|
||||
if (!timeout_thread_initialized) {
|
||||
return;
|
||||
}
|
||||
PostThreadMessage(timeout_thread_id, WM_QUIT, 0, 0);
|
||||
|
||||
php_timed_out = (zend_bool *)arg;
|
||||
*php_timed_out = 1;
|
||||
/* Wait for thread termination */
|
||||
WaitForSingleObject(timeout_thread_handle, 5000);
|
||||
CloseHandle(timeout_thread_handle);
|
||||
timeout_thread_initialized = 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#endif
|
||||
|
||||
/* This one doesn't exists on QNX */
|
||||
@@ -1261,28 +1358,13 @@ void zend_set_timeout(long seconds, int reset_signals) /* {{{ */
|
||||
if(!seconds) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Don't use ChangeTimerQueueTimer() as it will not restart an expired
|
||||
timer, so we could end up with just an ignored timeout. Instead
|
||||
delete and recreate. */
|
||||
if (NULL != tq_timer) {
|
||||
if (!DeleteTimerQueueTimer(NULL, tq_timer, NULL)) {
|
||||
EG(timed_out) = 0;
|
||||
tq_timer = NULL;
|
||||
zend_error(E_ERROR, "Could not delete queued timer");
|
||||
return;
|
||||
}
|
||||
tq_timer = NULL;
|
||||
if (timeout_thread_initialized == 0 && InterlockedIncrement(&timeout_thread_initialized) == 1) {
|
||||
/* We start up this process-wide thread here and not in zend_startup(), because if Zend
|
||||
* is initialized inside a DllMain(), you're not supposed to start threads from it.
|
||||
*/
|
||||
zend_init_timeout_thread();
|
||||
}
|
||||
|
||||
/* XXX passing NULL means the default timer queue provided by the system is used */
|
||||
if (!CreateTimerQueueTimer(&tq_timer, NULL, (WAITORTIMERCALLBACK)tq_timer_cb, (VOID*)&EG(timed_out), seconds*1000, 0, WT_EXECUTEONLYONCE)) {
|
||||
EG(timed_out) = 0;
|
||||
tq_timer = NULL;
|
||||
zend_error(E_ERROR, "Could not queue new timer");
|
||||
return;
|
||||
}
|
||||
EG(timed_out) = 0;
|
||||
PostThreadMessage(timeout_thread_id, WM_REGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) seconds);
|
||||
#else
|
||||
# ifdef HAVE_SETITIMER
|
||||
{
|
||||
@@ -1324,16 +1406,9 @@ void zend_set_timeout(long seconds, int reset_signals) /* {{{ */
|
||||
void zend_unset_timeout(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
#ifdef ZEND_WIN32
|
||||
if (NULL != tq_timer) {
|
||||
if (!DeleteTimerQueueTimer(NULL, tq_timer, NULL)) {
|
||||
EG(timed_out) = 0;
|
||||
tq_timer = NULL;
|
||||
zend_error(E_ERROR, "Could not delete queued timer");
|
||||
return;
|
||||
}
|
||||
tq_timer = NULL;
|
||||
if(timeout_thread_initialized) {
|
||||
PostThreadMessage(timeout_thread_id, WM_UNREGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) 0);
|
||||
}
|
||||
EG(timed_out) = 0;
|
||||
#else
|
||||
# ifdef HAVE_SETITIMER
|
||||
if (EG(timeout_seconds)) {
|
||||
@@ -1583,6 +1658,13 @@ ZEND_API void zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */
|
||||
/*printf("Cache miss! Initialized %x\n", EG(active_symbol_table));*/
|
||||
}
|
||||
ex->symbol_table = EG(active_symbol_table);
|
||||
|
||||
if (ex->op_array->this_var != -1 &&
|
||||
!*EX_CV_NUM(ex, ex->op_array->this_var) &&
|
||||
EG(This)) {
|
||||
*EX_CV_NUM(ex, ex->op_array->this_var) = (zval**)EX_CV_NUM(ex, ex->op_array->last_var + ex->op_array->this_var);
|
||||
**EX_CV_NUM(ex, ex->op_array->this_var) = EG(This);
|
||||
}
|
||||
for (i = 0; i < ex->op_array->last_var; i++) {
|
||||
if (*EX_CV_NUM(ex, i)) {
|
||||
zend_hash_quick_update(EG(active_symbol_table),
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -111,7 +111,7 @@ END_EXTERN_C()
|
||||
ZEND_API extern zend_llist zend_extensions;
|
||||
|
||||
void zend_extension_dtor(zend_extension *extension);
|
||||
ZEND_API void zend_append_version_info(const zend_extension *extension);
|
||||
void zend_append_version_info(const zend_extension *extension);
|
||||
int zend_startup_extensions_mechanism(void);
|
||||
int zend_startup_extensions(void);
|
||||
void zend_shutdown_extensions(TSRMLS_D);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
+1
-5
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -21,8 +21,6 @@
|
||||
#ifndef ZEND_FLOAT_H
|
||||
#define ZEND_FLOAT_H
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
/*
|
||||
Define functions for FP initialization and de-initialization.
|
||||
*/
|
||||
@@ -30,8 +28,6 @@ extern ZEND_API void zend_init_fpu(TSRMLS_D);
|
||||
extern ZEND_API void zend_shutdown_fpu(TSRMLS_D);
|
||||
extern ZEND_API void zend_ensure_fpu_mode(TSRMLS_D);
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
/* Copy of the contents of xpfpa.h (which is under public domain)
|
||||
See http://wiki.php.net/rfc/rounding for details.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -125,7 +125,6 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
|
||||
/* A fatal error / die occurred during the generator execution. Trying to clean
|
||||
* up the stack may not be safe in this case. */
|
||||
if (CG(unclean_shutdown)) {
|
||||
generator->execute_data = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -605,9 +604,9 @@ ZEND_METHOD(Generator, __wakeup)
|
||||
|
||||
static void zend_generator_iterator_dtor(zend_object_iterator *iterator TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_generator_iterator *iter = (zend_generator_iterator *) iterator;
|
||||
zval *object = ((zend_generator_iterator *) iterator)->object;
|
||||
|
||||
zend_objects_store_del_ref_by_handle(iter->handle TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -699,8 +698,8 @@ zend_object_iterator *zend_generator_get_iterator(zend_class_entry *ce, zval *ob
|
||||
|
||||
/* We have to keep a reference to the generator object zval around,
|
||||
* otherwise the generator may be destroyed during iteration. */
|
||||
iterator->handle = Z_OBJ_HANDLE_P(object);
|
||||
zend_objects_store_add_ref_by_handle(iterator->handle TSRMLS_CC);
|
||||
Z_ADDREF_P(object);
|
||||
iterator->object = object;
|
||||
|
||||
return (zend_object_iterator *) iterator;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -28,9 +28,9 @@ extern ZEND_API zend_class_entry *zend_ce_generator;
|
||||
typedef struct _zend_generator_iterator {
|
||||
zend_object_iterator intern;
|
||||
|
||||
/* The generator object handle has to be stored, because the
|
||||
* iterator is holding a ref to it, which has to be dtored. */
|
||||
zend_object_handle handle;
|
||||
/* 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 {
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -283,7 +283,7 @@ struct _zend_ini_scanner_globals {
|
||||
char *filename;
|
||||
int lineno;
|
||||
|
||||
/* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW, ZEND_INI_SCANNER_TYPED */
|
||||
/* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW */
|
||||
int scanner_mode;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
+1
-4
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -1269,9 +1269,6 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
|
||||
|
||||
if (key_type == HASH_KEY_IS_LONG) {
|
||||
p->h = num_index;
|
||||
if ((long)num_index >= (long)ht->nNextFreeElement) {
|
||||
ht->nNextFreeElement = num_index < LONG_MAX ? num_index + 1 : LONG_MAX;
|
||||
}
|
||||
} else {
|
||||
p->h = h;
|
||||
p->nKeyLength = str_length;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| 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 |
|
||||
@@ -150,7 +150,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
|
||||
case T_DOC_COMMENT:
|
||||
break;
|
||||
default:
|
||||
str_efree(token.value.str.val);
|
||||
efree(token.value.str.val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Loaded 100 of 1674 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user