mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 18:20:50 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b28860447a |
No files matched your search
@@ -37,60 +37,9 @@ end
|
||||
define dump_bt
|
||||
set $t = $arg0
|
||||
while $t
|
||||
printf "[%p] ", $t
|
||||
printf "[0x%08x] ", $t
|
||||
if $t->function_state.function->common.function_name
|
||||
if $t->function_state.arguments
|
||||
set $count = (int)*($t->function_state.arguments)
|
||||
printf "%s(", $t->function_state.function->common.function_name
|
||||
while $count > 0
|
||||
set $zvalue = *(zval **)($t->function_state.arguments - $count)
|
||||
set $type = $zvalue->type
|
||||
if $type == 0
|
||||
printf "NULL"
|
||||
end
|
||||
if $type == 1
|
||||
printf "%ld", $zvalue->value.lval
|
||||
end
|
||||
if $type == 2
|
||||
printf "%lf", $zvalue->value.dval
|
||||
end
|
||||
if $type == 3
|
||||
if $zvalue->value.lval
|
||||
printf "true"
|
||||
else
|
||||
printf "false"
|
||||
end
|
||||
end
|
||||
if $type == 4
|
||||
printf "array(%d)[%p]", $zvalue->value.ht->nNumOfElements, $zvalue
|
||||
end
|
||||
if $type == 5
|
||||
printf "object[%p]", $zvalue
|
||||
end
|
||||
if $type == 6
|
||||
____print_str $zvalue->value.str.val $zvalue->value.str.len
|
||||
end
|
||||
if $type == 7
|
||||
printf "resource(#%d)", $zvalue->value.lval
|
||||
end
|
||||
if $type == 8
|
||||
printf "constant"
|
||||
end
|
||||
if $type == 9
|
||||
printf "const_array"
|
||||
end
|
||||
if $type > 9
|
||||
printf "unknown type %d", $type
|
||||
end
|
||||
set $count = $count -1
|
||||
if $count > 0
|
||||
printf ", "
|
||||
end
|
||||
end
|
||||
printf ") "
|
||||
else
|
||||
printf "%s() ", $t->function_state.function->common.function_name
|
||||
end
|
||||
printf "%s() ", $t->function_state.function->common.function_name
|
||||
else
|
||||
printf "??? "
|
||||
end
|
||||
@@ -218,7 +167,7 @@ define ____printzv
|
||||
____executor_globals
|
||||
set $zvalue = $arg0
|
||||
|
||||
printf "[%p] ", $zvalue
|
||||
printf "[0x%08x] ", $zvalue
|
||||
|
||||
if $zvalue == $eg.uninitialized_zval_ptr
|
||||
printf "*uninitialized* "
|
||||
@@ -259,7 +208,7 @@ end
|
||||
|
||||
define print_const_table
|
||||
set $ind = 1
|
||||
printf "[%p] {\n", $arg0
|
||||
printf "[0x%08x] {\n", $arg0
|
||||
____print_const_table $arg0
|
||||
printf "}\n"
|
||||
end
|
||||
@@ -299,7 +248,7 @@ end
|
||||
|
||||
define print_ht
|
||||
set $ind = 1
|
||||
printf "[%p] {\n", $arg0
|
||||
printf "[0x%08x] {\n", $arg0
|
||||
____print_ht $arg0 1
|
||||
printf "}\n"
|
||||
end
|
||||
@@ -310,7 +259,7 @@ end
|
||||
|
||||
define print_htptr
|
||||
set $ind = 1
|
||||
printf "[%p] {\n", $arg0
|
||||
printf "[0x%08x] {\n", $arg0
|
||||
____print_ht $arg0 0
|
||||
printf "}\n"
|
||||
end
|
||||
@@ -321,7 +270,7 @@ end
|
||||
|
||||
define print_htstr
|
||||
set $ind = 1
|
||||
printf "[%p] {\n", $arg0
|
||||
printf "[0x%08x] {\n", $arg0
|
||||
____print_ht $arg0 2
|
||||
printf "}\n"
|
||||
end
|
||||
@@ -357,7 +306,7 @@ end
|
||||
|
||||
define print_ft
|
||||
set $ind = 1
|
||||
printf "[%p] {\n", $arg0
|
||||
printf "[0x%08x] {\n", $arg0
|
||||
____print_ft $arg0
|
||||
printf "}\n"
|
||||
end
|
||||
@@ -434,7 +383,7 @@ end
|
||||
|
||||
define print_pi
|
||||
set $pi = $arg0
|
||||
printf "[%p] {\n", $pi
|
||||
printf "[0x%08x] {\n", $pi
|
||||
printf " h = %lu\n", $pi->h
|
||||
printf " flags = %d (", $pi->flags
|
||||
if $pi->flags & 0x100
|
||||
@@ -490,7 +439,7 @@ define printzn
|
||||
set $optype = "IS_UNUSED"
|
||||
end
|
||||
|
||||
printf "[%p] %s", $znode, $optype
|
||||
printf "[0x%08x] %s", $znode, $optype
|
||||
|
||||
if $znode->op_type == 1
|
||||
printf ": "
|
||||
@@ -570,7 +519,7 @@ define zmemcheck
|
||||
else
|
||||
set $filename = $filename + 1
|
||||
end
|
||||
printf " %p ", $aptr
|
||||
printf " 0x%08x ", $aptr
|
||||
if $p->size == sizeof(struct _zval_struct) && ((struct _zval_struct *)$aptr)->type >= 0 && ((struct _zval_struct *)$aptr)->type < 10
|
||||
printf "ZVAL?(%-2d) ", $p->size
|
||||
else
|
||||
@@ -600,7 +549,7 @@ define zmemcheck
|
||||
end
|
||||
end
|
||||
if $not_found
|
||||
printf "no such block that begins at %p.\n", $aptr
|
||||
printf "no such block that begins at 0x%08x.\n", $aptr
|
||||
end
|
||||
if $arg0 == 0
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
|
||||
+1
-1
@@ -337,7 +337,7 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: curl
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>, Ilia Alshanetsky <iliaa@php.net>, Pierrick Charron <pierrick@php.net>
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>,Ilia Alshanetsky <iliaa@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.2
|
||||
|
||||
@@ -45,7 +45,7 @@ way round.
|
||||
Rolling a non stable release (alpha/beta/RC)
|
||||
--------------------------------------------
|
||||
|
||||
1. Check windows snapshot builder logs (http://windows.php.net/downloads/snaps/ the last revision)
|
||||
1. Check windows snapshot builder logs (http://snaps.php.net/win32/snapshot-STABLE.log f.e.)
|
||||
|
||||
2. run the "scripts/dev/credits" script in php-src and commit the changes in the
|
||||
credits files in ext/standard.
|
||||
@@ -56,7 +56,7 @@ Do not use abbreviations for alpha and beta.
|
||||
4. Commit those changes and note the revision id.
|
||||
|
||||
5. tag the repository with the version. To do the tag in a fast way do a svn copy on the server using full URLs. You should use the revision id from the above commit to prevent mistakes in case there was a commit in between. f.e. "``svn cp https://svn.php.net/repository/php/php-src/branches/PHP_5_3@308399 https://svn.php.net/repository/php/php-src/tags/php_5_3_6RC1``"
|
||||
(of course, you need to change that to the version you're rolling an RC for). Mail php-internals to announce the tag so tests/validation/check can be done prior to package it. It is especially important for RCs.
|
||||
(of course, you need to change that to the version you're rolling an RC for).
|
||||
|
||||
6. Bump up the version numbers in ``main/php_version.h``, ``configure.in``
|
||||
and possibly ``NEWS`` again, to the **next** version. F.e. if the release
|
||||
@@ -115,7 +115,7 @@ Derick) run the following commands for you:
|
||||
|
||||
4. Update ``web/php/trunk/include/version.inc`` (x=major version number)
|
||||
|
||||
a. ``$PHP_x_RC`` = "5.4.0RC1"
|
||||
a. ``$PHP_x_RC`` = "5.3.0RC1"
|
||||
|
||||
b. ``$PHP_x_RC_DATE`` = "06 September 2007"
|
||||
|
||||
@@ -126,8 +126,6 @@ Derick) run the following commands for you:
|
||||
6. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the
|
||||
INSTALL and win32/install.txt files which are generated from the PHP manual sources.
|
||||
|
||||
7. Publish the announce on www.php.net as well (for all releases, alpha, RCs or other)
|
||||
|
||||
Rolling a stable release
|
||||
------------------------
|
||||
|
||||
@@ -165,7 +163,7 @@ and build two tarballs (one gz and one bz2).
|
||||
|
||||
13. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created. Once
|
||||
those are made, they should be committed to SVN too.
|
||||
those are made, they should be committed to CVS too.
|
||||
|
||||
14. Check if the pear files are updated (phar for 5.1+ or run pear/make-pear-bundle.php with 4.4)
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2011 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-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2011 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2011 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 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2011 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-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2011 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-2012 The PHP Group |
|
||||
| Copyright (c) 1997-2011 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 |
|
||||
|
||||
@@ -30,7 +30,7 @@ UPGRADE NOTES - PHP 5.4
|
||||
========================================
|
||||
|
||||
- The default_charset setting now defaults to UTF-8.
|
||||
It was ISO-88590-1 before, so if you were relying
|
||||
It was ISO-88590-1 before, so if you were relying
|
||||
on the default, you will need to add:
|
||||
|
||||
default_charset = iso-8859-1
|
||||
@@ -49,7 +49,7 @@ UPGRADE NOTES - PHP 5.4
|
||||
|
||||
to your php.ini to preserve pre-PHP5.4 behavior.
|
||||
|
||||
- Deprecated ini directives will now throw an E_CORE_WARNING's
|
||||
- Deprecated ini directives will now throw an E_CORE_WARNING's
|
||||
instead of the previous E_WARNING's.
|
||||
|
||||
The following directives are marked as deprecated:
|
||||
@@ -57,8 +57,8 @@ UPGRADE NOTES - PHP 5.4
|
||||
- magic_quotes_runtime
|
||||
- magic_quotes_sybase
|
||||
|
||||
- The following directives, which indicates a removed feature
|
||||
in PHP will now throw an E_CORE_ERROR upon startup like the
|
||||
- The following directives, which indicates a removed feature
|
||||
in PHP will now throw an E_CORE_ERROR upon startup like the
|
||||
deprecation warnings.
|
||||
|
||||
The following directives are no longer available:
|
||||
@@ -75,10 +75,6 @@ UPGRADE NOTES - PHP 5.4
|
||||
- safe_mode_protected_env_vars
|
||||
- zend.ze1_compatibility_mode
|
||||
|
||||
- the following new directives were added
|
||||
|
||||
- max_input_vars - specifies how many GET/POST/COOKIE input variables may be
|
||||
accepted. default value 1000.
|
||||
|
||||
=============================
|
||||
2. Reserved words and classes
|
||||
@@ -101,7 +97,7 @@ UPGRADE NOTES - PHP 5.4
|
||||
{
|
||||
public function __construct($bar) {}
|
||||
}
|
||||
|
||||
|
||||
Now emits a Fatal error due the incompatible declaration.
|
||||
|
||||
- In previous versions, names of superglobals could be used for parameter
|
||||
@@ -118,18 +114,12 @@ UPGRADE NOTES - PHP 5.4
|
||||
$test = new StdClass;
|
||||
$test->baz = 1;
|
||||
|
||||
- Converting array to string now will cause E_NOTICE warning.
|
||||
- Converting array to string now will cause E_NOTICE warning.
|
||||
|
||||
- Chained string offsets - e.g. $a[0][0] where $a is a string - now work.
|
||||
- Chained string offsets - e.g. $a[0][0] where $a is a string - now work, which
|
||||
means isset($a['foo']['bar']) now will return true due to automatic type conversion.
|
||||
|
||||
- Non-numeric string offsets - e.g. $a['foo'] where $a is a string - now return
|
||||
false on isset() and true on empty(), and produce warning if trying to use them.
|
||||
Offsets of types double, bool and null produce notice. Numeric strings ($a['2'])
|
||||
still work as before.
|
||||
Note that offsets like '12.3' and '5 and a half' are considered non-numeric
|
||||
and produce warning, but are converted to 12 and 5 respectively for BC reasons.
|
||||
|
||||
- Changed E_ALL to include E_STRICT.
|
||||
- Changed E_ALL to include E_STRICT.
|
||||
|
||||
- Closures now support scopes and $this and can be rebound to
|
||||
objects using Closure::bind() and Closure::bindTo().
|
||||
@@ -139,7 +129,7 @@ UPGRADE NOTES - PHP 5.4
|
||||
|
||||
- <?= is now always available regardless of the short_open_tag setting.
|
||||
|
||||
- Parse error messages are changed to contain more information about the error.
|
||||
- Parse error messages are changed to contain more information about the error.
|
||||
|
||||
=====================================
|
||||
4. Changes made to existing functions
|
||||
@@ -218,40 +208,34 @@ UPGRADE NOTES - PHP 5.4
|
||||
- Added AES support to OpenSSL.
|
||||
- openssl_csr_new() expects the textual data to be in UTF-8.
|
||||
- Added no padding option to openssl_encrypt()/openssl_decrypt().
|
||||
- Added a "no_ticket" SSL context option to disable the SessionTicket TLS
|
||||
- Added a "no_ticket" SSL context option to disable the SessionTicket TLS
|
||||
extension.
|
||||
- Added new json_encode() options: JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES,
|
||||
- Added new json_encode() options: JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES,
|
||||
JSON_NUMERIC_CHECK, JSON_BIGINT_AS_STRING, JSON_UNESCAPED_UNICODE.
|
||||
- Added Tokyo Cabinet and Berkley DB 5 support to DBA extension.
|
||||
- Added support for CURLOPT_MAX_SEND_SPEED_LARGE and CURLOPT_MAX_RECV_SPEED_LARGE
|
||||
to cURL.
|
||||
- Added optional argument to debug_backtrace() and debug_print_backtrace()
|
||||
- Added optional argument to debug_backtrace() and debug_print_backtrace()
|
||||
to limit the amount of stack frames returned.
|
||||
- Fixed crypt_blowfish handling of 8-bit characters. crypt() in Blowfish mode
|
||||
now supports hashes marked $2a$, $2x$, $2y$ and $2z$.
|
||||
- mbstring now supports following encodings: Shift_JIS/UTF-8 Emoji,
|
||||
JIS X0213:2004 (Shift_JIS-2004, EUC-JP-2004, ISO-2022-JP-2004),
|
||||
- Fixed crypt_blowfish handling of 8-bit characters. crypt() in Blowfish mode now
|
||||
supports hashes marked $2a$, $2x$, $2y$ and $2z$.
|
||||
- mbstring now supports following encodings: Shift_JIS/UTF-8 Emoji,
|
||||
JIS X0213:2004 (Shift_JIS-2004, EUC-JP-2004, ISO-2022-JP-2004),
|
||||
MacJapanese (Shift_JIS), gb18030.
|
||||
- Added encode/decode in hex format to mb_[en|de]code_numericentity().
|
||||
- Added support for SORT_NATURAL and SORT_FLAG_CASE in array sort functions
|
||||
- Added support for SORT_NATURAL and SORT_FLAG_CASE in array sort functions
|
||||
(sort, rsort, ksort, krsort, asort, arsort and array_multisort).
|
||||
- is_a() and is_subclass_of() now have third boolean parameter, which specifies
|
||||
if the first argument can be a string class name. Default if false for is_a
|
||||
and true for is_subclass_of() for BC reasons.
|
||||
- ob_start() will now treat a chunk size of 1 as meaning 1 byte, rather than
|
||||
the previous special case behaviour of treating it as 4096 bytes.
|
||||
- idn_to_ascii() and idn_to_utf8() now take two extra parameters, one indicating
|
||||
the variant (IDNA 2003 or UTS #46) and another, passed by reference, to return
|
||||
details about the operation in case UTS #46 is chosen.
|
||||
- gzencode() used with FORCE_DEFLATE now generates RFC1950 compliant data.
|
||||
- ob_start() refuses to start multiple output buffers at once passed as
|
||||
array("callback1", "callback2", "callback3", ...).
|
||||
|
||||
===================================
|
||||
5. Changes made to existing methods
|
||||
===================================
|
||||
|
||||
- DateTime::parseFromFormat() now has + modifier to allow trailing text in
|
||||
- DateTime::parseFromFormat() now has + modifier to allow trailing text in
|
||||
the string to parse without throwing an error.
|
||||
- Added the ability to pass options to DOMDocument::loadHTML().
|
||||
- FilesystemIterator, GlobIterator and (Recursive)DirectoryIterator now use
|
||||
@@ -289,8 +273,8 @@ UPGRADE NOTES - PHP 5.4
|
||||
a. removed features
|
||||
|
||||
- magic quotes
|
||||
. remove magic_quotes_gpc, magic_quotes_runtime,
|
||||
magic_quotes_sybase (calling ini_set('magic_....')
|
||||
. remove magic_quotes_gpc, magic_quotes_runtime,
|
||||
magic_quotes_sybase (calling ini_set('magic_....')
|
||||
returns 0|false
|
||||
. get_magic_quotes_gpc, get_magic_quotes_runtime are kept but
|
||||
always return false
|
||||
@@ -339,10 +323,6 @@ UPGRADE NOTES - PHP 5.4
|
||||
- break $var;
|
||||
- continue $var;
|
||||
|
||||
e. removed hash algorithms
|
||||
|
||||
- Salsa10 and Salsa20, which are actually stream ciphers
|
||||
|
||||
=============
|
||||
9. Extensions
|
||||
=============
|
||||
@@ -359,10 +339,10 @@ UPGRADE NOTES - PHP 5.4
|
||||
- PDO_mysql: Support for linking with MySQL client libraries older
|
||||
than 4.1 is removed.
|
||||
- The session extension now can hook into the file upload feature
|
||||
in order to provide upload progress information through session
|
||||
in order to provide upload progress information through session
|
||||
variables.
|
||||
- SNMP extension
|
||||
- Functions in SNMP extension now returns FALSE on every error
|
||||
- Functions in SNMP extension now returns FALSE on every error
|
||||
condition including SNMP-related (no such instance, end of MIB,
|
||||
etc). Thus, in patricular, breaks previous behaviour of get/walk
|
||||
functions returning an empty string on SNMP-related errors.
|
||||
@@ -370,7 +350,7 @@ UPGRADE NOTES - PHP 5.4
|
||||
- New constants added for use in snmp_set_oid_output_format()
|
||||
function.
|
||||
- Function snmp_set_valueretrieval() changed it's behaviour:
|
||||
SNMP_VALUE_OBJECT can be combined with one of
|
||||
SNMP_VALUE_OBJECT can be combined with one of
|
||||
SNMP_VALUE_PLAIN or SNMP_VALUE_LIBRARY resulting OID value
|
||||
changes. When no SNMP_VALUE_PLAIN or SNMP_VALUE_LIBRARY
|
||||
is supplied with SNMP_VALUE_OBJECT, SNMP_VALUE_LIBRARY is used.
|
||||
@@ -382,7 +362,7 @@ UPGRADE NOTES - PHP 5.4
|
||||
- In sake of adding support for IPv6 DNS name resolution of
|
||||
remote SNMP agent (peer) is done by extension now, not by Net-SNMP
|
||||
library anymore.
|
||||
|
||||
|
||||
- Date extension
|
||||
- Setting the timezone with the TZ environment variable is no longer
|
||||
supported, instead date.timezone and/or date_default_timezone_set()
|
||||
@@ -399,12 +379,12 @@ UPGRADE NOTES - PHP 5.4
|
||||
- The REQUEST_TIME value inside server now returns a floating point number
|
||||
indicating the time with microsecond precision. All SAPIs providing this
|
||||
value should be returning float and not time_t.
|
||||
- apache_child_terminate(), getallheaders(), apache_request_headers()
|
||||
- apache_child_terminate(), getallheaders(), apache_request_headers()
|
||||
and apache_response_headers() now supported on FastCGI.
|
||||
- Added shortcut #inisetting=value to change ini settings at run-time.
|
||||
- Changed shell not to terminate on fatal errors.
|
||||
- Interactive shell works with shared readline extension.
|
||||
- Added command line option --rz <name> which shows information of the
|
||||
- Added command line option --rz <name> which shows information of the
|
||||
named Zend extension.
|
||||
- PHP-FPM now supports syslog value for error_log.
|
||||
|
||||
@@ -412,10 +392,10 @@ UPGRADE NOTES - PHP 5.4
|
||||
11. Changes in INI directives
|
||||
=============================
|
||||
|
||||
- Recommended production value for error_reporting changed to
|
||||
- Recommended production value for error_reporting changed to
|
||||
E_ALL & ~E_DEPRECATED & ~E_STRICT.
|
||||
- Added session.upload_progress.enabled, session.upload_progress.cleanup,
|
||||
session.upload_progress.prefix, session.upload_progress.name,
|
||||
- Added session.upload_progress.enabled, session.upload_progress.cleanup,
|
||||
session.upload_progress.prefix, session.upload_progress.name,
|
||||
session.upload_progress.freq, session.upload_progress.min_freq.
|
||||
- Added zend.multibyte directive as a replacement of PHP compile time
|
||||
configuration option --enable-zend-multibyte. Now ZE always contains code for
|
||||
@@ -430,7 +410,7 @@ UPGRADE NOTES - PHP 5.4
|
||||
three times.
|
||||
- A new directive, called windows_show_crt_warning, has been introduced.
|
||||
This directive shows the CRT warnings when enabled. These warnings were
|
||||
displayed by default until now. It is disabled by default.
|
||||
displayed by default until now. It is disabled by default.
|
||||
- Added cli.pager php.ini setting to set a pager for CLI output.
|
||||
- Added cli.prompt php.ini setting to configure the CLI shell prompt.
|
||||
- Added process.max to control the number of process FPM can fork.
|
||||
@@ -446,12 +426,12 @@ UPGRADE NOTES - PHP 5.4
|
||||
}
|
||||
|
||||
class CanIGetHello {
|
||||
use HelloWorld;
|
||||
use HelloWorld;
|
||||
}
|
||||
|
||||
|
||||
$hello = new CanIGetHello();
|
||||
$hello->sayHello();
|
||||
|
||||
|
||||
- Function call result array access:
|
||||
e.g.
|
||||
foo()[0]
|
||||
@@ -476,17 +456,17 @@ UPGRADE NOTES - PHP 5.4
|
||||
|
||||
- $str[1][0] where $str is a string is now a legal construct.
|
||||
|
||||
- Anonymous functions now support using $this and class scope.
|
||||
- Anonymous functions now support using $this and class scope.
|
||||
Anonymous function can be declared as "static" to ignore the scope.
|
||||
|
||||
- Class::{expr}() syntax is now supported:
|
||||
class A {
|
||||
static function foo() {
|
||||
class A {
|
||||
static function foo() {
|
||||
echo "Hello world!\n";
|
||||
}
|
||||
}
|
||||
$x = "f";
|
||||
$y = "o";
|
||||
}
|
||||
$x = "f";
|
||||
$y = "o";
|
||||
A::{$x.$y.$y}();
|
||||
|
||||
- Class member access on instantiation:
|
||||
@@ -498,7 +478,7 @@ UPGRADE NOTES - PHP 5.4
|
||||
13. Windows support
|
||||
===================
|
||||
|
||||
- is_link now works properly for symbolic links on Windows Vista
|
||||
- is_link now works properly for symbolic links on Windows Vista
|
||||
or later. Earlier systems do not support symbolic links.
|
||||
|
||||
===================
|
||||
@@ -525,22 +505,22 @@ UPGRADE NOTES - PHP 5.4
|
||||
- transliterator_get_error_message()
|
||||
- transliterator_list_ids()
|
||||
- transliterator_transliterate()
|
||||
|
||||
|
||||
- LDAP:
|
||||
- ldap_control_paged_results()
|
||||
- ldap_control_paged_results_response()
|
||||
|
||||
- libxml:
|
||||
- libxml_set_external_entity_loader()
|
||||
|
||||
|
||||
- mysqli:
|
||||
- mysqli_error_list()
|
||||
- mysqli_stmt_error_list()
|
||||
|
||||
|
||||
- Session:
|
||||
- session_register_shutdown()
|
||||
- session_status()
|
||||
|
||||
|
||||
- SPL
|
||||
- class_uses()
|
||||
|
||||
@@ -614,42 +594,22 @@ UPGRADE NOTES - PHP 5.4
|
||||
- ZLIB_ENCODING_DEFLATE
|
||||
- ZLIB_ENCODING_GZIP
|
||||
- ZLIB_ENCODING_RAW
|
||||
- U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR
|
||||
- IDNA_CHECK_BIDI
|
||||
- IDNA_CHECK_CONTEXTJ
|
||||
- IDNA_NONTRANSITIONAL_TO_ASCII
|
||||
- IDNA_NONTRANSITIONAL_TO_UNICODE
|
||||
- INTL_IDNA_VARIANT_2003
|
||||
- INTL_IDNA_VARIANT_UTS46
|
||||
- IDNA_ERROR_EMPTY_LABEL
|
||||
- IDNA_ERROR_LABEL_TOO_LONG
|
||||
- IDNA_ERROR_DOMAIN_NAME_TOO_LONG
|
||||
- IDNA_ERROR_LEADING_HYPHEN
|
||||
- IDNA_ERROR_TRAILING_HYPHEN
|
||||
- IDNA_ERROR_HYPHEN_3_4
|
||||
- IDNA_ERROR_LEADING_COMBINING_MARK
|
||||
- IDNA_ERROR_DISALLOWED
|
||||
- IDNA_ERROR_PUNYCODE
|
||||
- IDNA_ERROR_LABEL_HAS_DOT
|
||||
- IDNA_ERROR_INVALID_ACE_LABEL
|
||||
- IDNA_ERROR_BIDI
|
||||
- IDNA_ERROR_CONTEXTJ
|
||||
|
||||
c. New classes
|
||||
|
||||
- Reflection:
|
||||
- ReflectionZendExtension
|
||||
|
||||
|
||||
- Intl:
|
||||
- Transliterator
|
||||
- Spoofchecker
|
||||
|
||||
|
||||
- JSON:
|
||||
- JsonSerializable
|
||||
|
||||
- Session:
|
||||
- Session:
|
||||
- SessionHandler
|
||||
|
||||
|
||||
- SNMP:
|
||||
- SNMP
|
||||
|
||||
@@ -659,9 +619,9 @@ UPGRADE NOTES - PHP 5.4
|
||||
|
||||
d. New methods
|
||||
|
||||
- Closure:
|
||||
- Closure:
|
||||
- Closure::bind()
|
||||
- Closure::bindTo()
|
||||
- Closure::bindTo()
|
||||
|
||||
- Reflection:
|
||||
- ReflectionClass::getTraitAliases()
|
||||
@@ -726,5 +686,5 @@ UPGRADE NOTES - PHP 5.4
|
||||
- joaat
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ var_dump(isset($a['b']));
|
||||
|
||||
$simpleString = "Bogus String Text";
|
||||
echo isset($simpleString->wrong)?"bug\n":"ok\n";
|
||||
echo isset($simpleString["wrong"])?"bug\n":"ok\n";
|
||||
echo isset($simpleString["wrong"])?"ok\n":"bug\n";
|
||||
echo isset($simpleString[-1])?"bug\n":"ok\n";
|
||||
echo isset($simpleString[0])?"ok\n":"bug\n";
|
||||
echo isset($simpleString["0"])?"ok\n":"bug\n";
|
||||
@@ -34,8 +34,8 @@ bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
@@ -44,12 +44,8 @@ ok
|
||||
ok
|
||||
ok
|
||||
|
||||
Notice: Trying to get property of non-object in %s on line %d
|
||||
Notice: Trying to get property of non-object in %sbug31098.php on line %d
|
||||
ok
|
||||
|
||||
Warning: Illegal string offset 'wrong' in %s on line %d
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
|
||||
Warning: Illegal string offset 'wrong' in %s on line %d
|
||||
ok
|
||||
+14
-25
@@ -6,7 +6,7 @@ Bug #39018 (Error control operator '@' fails to suppress "Uninitialized string o
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$a = 'foo';
|
||||
$a[111111111111111111111];
|
||||
$a[11111111111];
|
||||
|
||||
$a = '';
|
||||
|
||||
@@ -62,42 +62,31 @@ print "\nDone\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
|
||||
Notice: Uninitialized string offset: 0 in %s on line %d
|
||||
Notice: Uninitialized string offset: %i in %s on line 6
|
||||
|
||||
Notice: Uninitialized string offset: 0 in %s on line %d
|
||||
Notice: Uninitialized string offset: 0 in %s on line 10
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
Notice: Uninitialized string offset: 0 in %s on line 12
|
||||
|
||||
Notice: Uninitialized string offset: %i in %s on line %d
|
||||
Notice: Uninitialized string offset: %i in %s on line 14
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
Notice: Uninitialized string offset: %i in %s on line 16
|
||||
|
||||
Notice: Uninitialized string offset: %i in %s on line %d
|
||||
Notice: Uninitialized string offset: 0 in %s on line 18
|
||||
|
||||
Notice: Uninitialized string offset: 0 in %s on line %d
|
||||
Notice: Uninitialized string offset: 4 in %s on line 28
|
||||
|
||||
Notice: Uninitialized string offset: 4 in %s on line %d
|
||||
Notice: Uninitialized string offset: 4 in %s on line 34
|
||||
|
||||
Notice: Uninitialized string offset: 4 in %s on line %d
|
||||
Notice: Uninitialized string offset: 4 in %s on line 38
|
||||
|
||||
Notice: Uninitialized string offset: 4 in %s on line %d
|
||||
Notice: Uninitialized string offset: 4 in %s on line 42
|
||||
|
||||
Notice: Uninitialized string offset: 4 in %s on line %d
|
||||
Notice: Uninitialized string offset: 4 in %s on line 46
|
||||
|
||||
Notice: Uninitialized string offset: 4 in %s on line %d
|
||||
Notice: Uninitialized string offset: 12 in %s on line 50
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
|
||||
Notice: Uninitialized string offset: 12 in %s on line %d
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
|
||||
Notice: Uninitialized string offset: 12 in %s on line %d
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
Notice: Uninitialized string offset: 12 in %s on line 52
|
||||
b
|
||||
Done
|
||||
@@ -7,10 +7,10 @@ Bug #39304 (Segmentation fault with list unpacking of string offset)
|
||||
echo "I am alive";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Uninitialized string offset: 0 in %sbug39304.php on line %d
|
||||
Notice: Uninitialized string offset: 0 in %sbug39304.php on line 3
|
||||
|
||||
Notice: Uninitialized string offset: 1 in %sbug39304.php on line %d
|
||||
Notice: Uninitialized string offset: 1 in %sbug39304.php on line 3
|
||||
|
||||
Notice: Uninitialized string offset: 0 in %sbug39304.php on line %d
|
||||
Notice: Uninitialized string offset: 0 in %sbug39304.php on line 3
|
||||
I am alive
|
||||
|
||||
@@ -9,10 +9,10 @@ Bug #39304 (Segmentation fault with list unpacking of string offset)
|
||||
var_dump($a,$b);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Uninitialized string offset: 0 in %sbug39304_2_4.php on line %d
|
||||
Notice: Uninitialized string offset: 0 in %sbug39304_2_4.php on line 3
|
||||
|
||||
Notice: Uninitialized string offset: 1 in %sbug39304_2_4.php on line %d
|
||||
Notice: Uninitialized string offset: 1 in %sbug39304_2_4.php on line 3
|
||||
|
||||
Notice: Uninitialized string offset: 0 in %sbug39304_2_4.php on line %d
|
||||
Notice: Uninitialized string offset: 0 in %sbug39304_2_4.php on line 3
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
@@ -9,7 +9,7 @@ $simpleString["wrong"] = "f";
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(true)
|
||||
|
||||
Warning: Attempt to modify property of non-object in %sbug54262.php on line 4
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60350 No string escape code for ESC (ascii 27), normally \e
|
||||
--FILE--
|
||||
<?php
|
||||
$str = "\e";
|
||||
if (ord($str) == 27) {
|
||||
echo "Works";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Works
|
||||
@@ -1,74 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60362: non-existent sub-sub keys should not have values
|
||||
--FILE--
|
||||
<?php
|
||||
$arr = array('exists' => 'foz');
|
||||
|
||||
if (isset($arr['exists']['non_existent'])) {
|
||||
echo "sub-key 'non_existent' is set: ";
|
||||
var_dump($arr['exists']['non_existent']);
|
||||
} else {
|
||||
echo "sub-key 'non_existent' is not set.\n";
|
||||
}
|
||||
if (isset($arr['exists'][1])) {
|
||||
echo "sub-key 1 is set: ";
|
||||
var_dump($arr['exists'][1]);
|
||||
} else {
|
||||
echo "sub-key 1 is not set.\n";
|
||||
}
|
||||
|
||||
echo "-------------------\n";
|
||||
if (isset($arr['exists']['non_existent']['sub_sub'])) {
|
||||
echo "sub-key 'sub_sub' is set: ";
|
||||
var_dump($arr['exists']['non_existent']['sub_sub']);
|
||||
} else {
|
||||
echo "sub-sub-key 'sub_sub' is not set.\n";
|
||||
}
|
||||
if (isset($arr['exists'][1][0])) {
|
||||
echo "sub-sub-key 0 is set: ";
|
||||
var_dump($arr['exists'][1][0]);
|
||||
} else {
|
||||
echo "sub-sub-key 0 is not set.\n";
|
||||
}
|
||||
|
||||
echo "-------------------\n";
|
||||
if (empty($arr['exists']['non_existent'])) {
|
||||
echo "sub-key 'non_existent' is empty.\n";
|
||||
} else {
|
||||
echo "sub-key 'non_existent' is not empty: ";
|
||||
var_dump($arr['exists']['non_existent']);
|
||||
}
|
||||
if (empty($arr['exists'][1])) {
|
||||
echo "sub-key 1 is empty.\n";
|
||||
} else {
|
||||
echo "sub-key 1 is not empty: ";
|
||||
var_dump($arr['exists'][1]);
|
||||
}
|
||||
|
||||
echo "-------------------\n";
|
||||
if (empty($arr['exists']['non_existent']['sub_sub'])) {
|
||||
echo "sub-sub-key 'sub_sub' is empty.\n";
|
||||
} else {
|
||||
echo "sub-sub-key 'sub_sub' is not empty: ";
|
||||
var_dump($arr['exists']['non_existent']['sub_sub']);
|
||||
}
|
||||
if (empty($arr['exists'][1][0])) {
|
||||
echo "sub-sub-key 0 is empty.\n";
|
||||
} else {
|
||||
echo "sub-sub-key 0 is not empty: ";
|
||||
var_dump($arr['exists'][1][0]);
|
||||
}
|
||||
echo "DONE";
|
||||
--EXPECT--
|
||||
sub-key 'non_existent' is not set.
|
||||
sub-key 1 is set: string(1) "o"
|
||||
-------------------
|
||||
sub-sub-key 'sub_sub' is not set.
|
||||
sub-sub-key 0 is set: string(1) "o"
|
||||
-------------------
|
||||
sub-key 'non_existent' is empty.
|
||||
sub-key 1 is not empty: string(1) "o"
|
||||
-------------------
|
||||
sub-sub-key 'sub_sub' is empty.
|
||||
sub-sub-key 0 is not empty: string(1) "o"
|
||||
DONE
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60444 (Segmentation fault with include & class extending)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
public function __construct() {
|
||||
eval("class Bar extends Foo {}");
|
||||
Some::foo($this);
|
||||
}
|
||||
}
|
||||
class Some {
|
||||
public static function foo(Foo $foo) {
|
||||
}
|
||||
}
|
||||
new Foo;
|
||||
echo "done\n";
|
||||
--EXPECT--
|
||||
done
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60536 (Traits Segfault)
|
||||
--FILE--
|
||||
<?php
|
||||
trait T { private $x = 0; }
|
||||
class X {
|
||||
use T;
|
||||
}
|
||||
class Y extends X {
|
||||
use T;
|
||||
function x() {
|
||||
return ++$this->x;
|
||||
}
|
||||
}
|
||||
class Z extends Y {
|
||||
function z() {
|
||||
return ++$this->x;
|
||||
}
|
||||
}
|
||||
$a = new Z();
|
||||
$a->x();
|
||||
echo "DONE";
|
||||
?>
|
||||
--EXPECTF--
|
||||
DONE
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
The same rules are applied for properties that are defined in the class hierarchy. Thus, if the properties are compatible, a notice is issued, if not a fatal error occures. (relevant with #60536)
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
|
||||
class Base {
|
||||
private $hello;
|
||||
}
|
||||
|
||||
trait THello1 {
|
||||
private $hello;
|
||||
}
|
||||
|
||||
echo "PRE-CLASS-GUARD\n";
|
||||
class Notice extends Base {
|
||||
use THello1;
|
||||
private $hello;
|
||||
}
|
||||
echo "POST-CLASS-GUARD\n";
|
||||
|
||||
// now we do the test for a fatal error
|
||||
|
||||
class TraitsTest {
|
||||
use THello1;
|
||||
public $hello;
|
||||
}
|
||||
|
||||
echo "POST-CLASS-GUARD2\n";
|
||||
|
||||
$t = new TraitsTest;
|
||||
$t->hello = "foo";
|
||||
?>
|
||||
--EXPECTF--
|
||||
PRE-CLASS-GUARD
|
||||
|
||||
Strict Standards: Notice and THello1 define the same property ($hello) in the composition of Notice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in %s on line %d
|
||||
POST-CLASS-GUARD
|
||||
|
||||
Fatal error: TraitsTest and THello1 define the same property ($hello) in the composition of TraitsTest. However, the definition differs and is considered incompatible. Class was composed in %s on line %d
|
||||
@@ -1,46 +0,0 @@
|
||||
--TEST--
|
||||
Properties should be initialized correctly (relevant to #60536)
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
|
||||
class BaseWithPropA {
|
||||
private $hello = 0;
|
||||
}
|
||||
|
||||
trait AHelloProperty {
|
||||
private $hello = 0;
|
||||
}
|
||||
|
||||
class BaseWithTPropB {
|
||||
use AHelloProperty;
|
||||
}
|
||||
|
||||
class SubclassA extends BaseWithPropA {
|
||||
use AHelloProperty;
|
||||
}
|
||||
|
||||
class SubclassB extends BaseWithTPropB {
|
||||
use AHelloProperty;
|
||||
}
|
||||
|
||||
$a = new SubclassA;
|
||||
var_dump($a);
|
||||
|
||||
$b = new SubclassB;
|
||||
var_dump($b);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(SubclassA)#%d (2) {
|
||||
["hello":"SubclassA":private]=>
|
||||
int(0)
|
||||
["hello":"BaseWithPropA":private]=>
|
||||
int(0)
|
||||
}
|
||||
object(SubclassB)#%d (2) {
|
||||
["hello":"SubclassB":private]=>
|
||||
int(0)
|
||||
["hello":"BaseWithTPropB":private]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Introducing new private variables of the same name in a subclass is ok, and does not lead to any output. That is consitent with normal inheritance handling. (relevant to #60536)
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
|
||||
class Base {
|
||||
private $hello;
|
||||
}
|
||||
|
||||
trait THello1 {
|
||||
private $hello;
|
||||
}
|
||||
|
||||
// Now we use the trait, which happens to introduce another private variable
|
||||
// but they are distinct, and not related to each other, so no warning.
|
||||
echo "PRE-CLASS-GUARD\n";
|
||||
class SameNameInSubClassNoNotice extends Base {
|
||||
use THello1;
|
||||
}
|
||||
echo "POST-CLASS-GUARD\n";
|
||||
|
||||
// now the same with a class that defines the property itself,
|
||||
// that should give the expected strict warning.
|
||||
|
||||
class Notice extends Base {
|
||||
use THello1;
|
||||
private $hello;
|
||||
}
|
||||
echo "POST-CLASS-GUARD2\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
PRE-CLASS-GUARD
|
||||
POST-CLASS-GUARD
|
||||
|
||||
Strict Standards: Notice and THello1 define the same property ($hello) in the composition of Notice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in %sbug60536_004.php on line %d
|
||||
POST-CLASS-GUARD2
|
||||
@@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
Introducing new private variables of the same name in a subclass is ok, and does not lead to any output. That is consitent with normal inheritance handling. (relevant to #60536)
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
|
||||
class Base {
|
||||
protected $hello;
|
||||
}
|
||||
|
||||
trait THello1 {
|
||||
protected $hello;
|
||||
}
|
||||
|
||||
// Protected and public are handle more strict with a warning then what is
|
||||
// expected from normal inheritance since they can have easier coliding semantics
|
||||
echo "PRE-CLASS-GUARD\n";
|
||||
class SameNameInSubClassProducesNotice extends Base {
|
||||
use THello1;
|
||||
}
|
||||
echo "POST-CLASS-GUARD\n";
|
||||
|
||||
// now the same with a class that defines the property itself, too.
|
||||
|
||||
class Notice extends Base {
|
||||
use THello1;
|
||||
protected $hello;
|
||||
}
|
||||
echo "POST-CLASS-GUARD2\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
PRE-CLASS-GUARD
|
||||
|
||||
Strict Standards: Base and THello1 define the same property ($hello) in the composition of SameNameInSubClassProducesNotice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in %s on line %d
|
||||
POST-CLASS-GUARD
|
||||
|
||||
Strict Standards: Notice and THello1 define the same property ($hello) in the composition of Notice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in %s on line %d
|
||||
POST-CLASS-GUARD2
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60611 (Segmentation fault with Cls::{expr}() syntax)
|
||||
--FILE--
|
||||
<?php
|
||||
class Cls {
|
||||
function __call($name, $arg) {
|
||||
}
|
||||
static function __callStatic($name, $arg) {
|
||||
}
|
||||
}
|
||||
|
||||
$cls = new Cls;
|
||||
$cls->{0}();
|
||||
$cls->{1.0}();
|
||||
$cls->{true}();
|
||||
$cls->{false}();
|
||||
$cls->{null}();
|
||||
|
||||
Cls::{0}();
|
||||
Cls::{1.0}();
|
||||
Cls::{true}();
|
||||
Cls::{false}();
|
||||
Cls::{null}();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Method name must be a string in %sbug60611.php on line %d
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60613 (Segmentation fault with $cls->{expr}() syntax)
|
||||
--FILE--
|
||||
<?php
|
||||
class Cls {
|
||||
function __call($name, $arg) {
|
||||
}
|
||||
}
|
||||
|
||||
$cls = new Cls();
|
||||
$cls->{0}();
|
||||
$cls->{1.0}();
|
||||
$cls->{true}();
|
||||
$cls->{false}();
|
||||
$cls->{null}();
|
||||
echo "ok\n";
|
||||
--EXPECTF--
|
||||
Fatal error: Method name must be a string in %sbug60613.php on line %d
|
||||
@@ -1,9 +0,0 @@
|
||||
--TEST--
|
||||
test of larger than 8kb text file being parsed by require statement
|
||||
--FILE--
|
||||
<?php
|
||||
file_put_contents('test.php',str_repeat('passed, ',1024));
|
||||
require('test.php');
|
||||
?>
|
||||
--EXPECT--
|
||||
passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed,Line truncated
|
||||
@@ -1,89 +0,0 @@
|
||||
--TEST--
|
||||
Testing empty() with string offsets
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
print "- empty ---\n";
|
||||
|
||||
$str = "test0123";
|
||||
|
||||
var_dump(empty($str[-1]));
|
||||
var_dump(empty($str[0]));
|
||||
var_dump(empty($str[1]));
|
||||
var_dump(empty($str[4])); // 0
|
||||
var_dump(empty($str[5])); // 1
|
||||
var_dump(empty($str[8]));
|
||||
var_dump(empty($str[10000]));
|
||||
// non-numeric offsets
|
||||
print "- string ---\n";
|
||||
var_dump(empty($str['-1']));
|
||||
var_dump(empty($str['0']));
|
||||
var_dump(empty($str['1']));
|
||||
var_dump(empty($str['4'])); // 0
|
||||
var_dump(empty($str['1.5']));
|
||||
var_dump(empty($str['good']));
|
||||
var_dump(empty($str['3 and a half']));
|
||||
print "- bool ---\n";
|
||||
var_dump(empty($str[true]));
|
||||
var_dump(empty($str[false]));
|
||||
var_dump(empty($str[false][true]));
|
||||
print "- null ---\n";
|
||||
var_dump(empty($str[null]));
|
||||
print "- double ---\n";
|
||||
var_dump(empty($str[-1.1]));
|
||||
var_dump(empty($str[-0.8]));
|
||||
var_dump(empty($str[-0.1]));
|
||||
var_dump(empty($str[0.2]));
|
||||
var_dump(empty($str[0.9]));
|
||||
var_dump(empty($str[M_PI]));
|
||||
var_dump(empty($str[100.5001]));
|
||||
print "- array ---\n";
|
||||
var_dump(empty($str[array()]));
|
||||
var_dump(empty($str[array(1,2,3)]));
|
||||
print "- object ---\n";
|
||||
var_dump(empty($str[new stdClass()]));
|
||||
print "- resource ---\n";
|
||||
$f = fopen(__FILE__, 'r');
|
||||
var_dump(empty($str[$f]));
|
||||
print "done\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
- empty ---
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
- string ---
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
- bool ---
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
- null ---
|
||||
bool(false)
|
||||
- double ---
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
- array ---
|
||||
bool(true)
|
||||
bool(true)
|
||||
- object ---
|
||||
bool(true)
|
||||
- resource ---
|
||||
bool(true)
|
||||
done
|
||||
@@ -71,8 +71,6 @@ array(1) {
|
||||
}
|
||||
}
|
||||
|
||||
Warning: Illegal string offset 'foo' in %s on line %d
|
||||
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
string(1) "A"
|
||||
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
--TEST--
|
||||
Testing isset with string offsets
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
print "- isset ---\n";
|
||||
|
||||
$str = "test0123";
|
||||
|
||||
var_dump(isset($str[-1]));
|
||||
var_dump(isset($str[0]));
|
||||
var_dump(isset($str[1]));
|
||||
var_dump(isset($str[4])); // 0
|
||||
var_dump(isset($str[5])); // 1
|
||||
var_dump(isset($str[8]));
|
||||
var_dump(isset($str[10000]));
|
||||
// non-numeric offsets
|
||||
print "- string ---\n";
|
||||
var_dump(isset($str['-1']));
|
||||
var_dump(isset($str['0']));
|
||||
var_dump(isset($str['1']));
|
||||
var_dump(isset($str['4'])); // 0
|
||||
var_dump(isset($str['1.5']));
|
||||
var_dump(isset($str['good']));
|
||||
var_dump(isset($str['3 and a half']));
|
||||
print "- bool ---\n";
|
||||
var_dump(isset($str[true]));
|
||||
var_dump(isset($str[false]));
|
||||
var_dump(isset($str[false][true]));
|
||||
print "- null ---\n";
|
||||
var_dump(isset($str[null]));
|
||||
print "- double ---\n";
|
||||
var_dump(isset($str[-1.1]));
|
||||
var_dump(isset($str[-0.8]));
|
||||
var_dump(isset($str[-0.1]));
|
||||
var_dump(isset($str[0.2]));
|
||||
var_dump(isset($str[0.9]));
|
||||
var_dump(isset($str[M_PI]));
|
||||
var_dump(isset($str[100.5001]));
|
||||
print "- array ---\n";
|
||||
var_dump(isset($str[array()]));
|
||||
var_dump(isset($str[array(1,2,3)]));
|
||||
print "- object ---\n";
|
||||
var_dump(isset($str[new stdClass()]));
|
||||
print "- resource ---\n";
|
||||
$f = fopen(__FILE__, 'r');
|
||||
var_dump(isset($str[$f]));
|
||||
print "done\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
- isset ---
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
- string ---
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
- bool ---
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
- null ---
|
||||
bool(true)
|
||||
- double ---
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
- array ---
|
||||
bool(false)
|
||||
bool(false)
|
||||
- object ---
|
||||
bool(false)
|
||||
- resource ---
|
||||
bool(false)
|
||||
done
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Initial value of static var in method depends on the include time of the class definition
|
||||
--XFAIL--
|
||||
Maybe not a bug
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
public function __construct() {
|
||||
eval("class Bar extends Foo {}");
|
||||
}
|
||||
public static function test() {
|
||||
static $i = 0;
|
||||
var_dump(++$i);
|
||||
}
|
||||
}
|
||||
|
||||
foo::test();
|
||||
new Foo;
|
||||
foo::test();
|
||||
|
||||
/**
|
||||
* function_add_ref() makes a clone of static variables for inherited functions, so $i in Bar::test gets initial value 1
|
||||
*/
|
||||
Bar::test();
|
||||
Bar::test();
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(2)
|
||||
int(1)
|
||||
int(2)
|
||||
@@ -3,11 +3,9 @@ Crash on $x['x']['y'] += 1 when $x is string
|
||||
--FILE--
|
||||
<?php
|
||||
$x = "a";
|
||||
$x['x']['y'] += 1;
|
||||
$x['x']['y'] += 1;
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Illegal string offset 'x' in %soffset_assign.php on line %d
|
||||
|
||||
Fatal error: Cannot use string offset as an array in %soffset_assign.php on line %d
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use string offset as an array in %s on line %d
|
||||
@@ -9,9 +9,6 @@ var_dump($str[1]);
|
||||
var_dump($str[0.0836]);
|
||||
var_dump($str[NULL]);
|
||||
var_dump($str["run away"]);
|
||||
var_dump($str["13"]);
|
||||
var_dump($str["14.5"]);
|
||||
var_dump($str["15 and then some"]);
|
||||
|
||||
var_dump($str[TRUE]);
|
||||
var_dump($str[FALSE]);
|
||||
@@ -27,29 +24,12 @@ var_dump($str[$arr]);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
--EXPECTF--
|
||||
string(1) "i"
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
string(1) "S"
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
string(1) "S"
|
||||
|
||||
Warning: Illegal string offset 'run away' in %s on line %d
|
||||
string(1) "S"
|
||||
string(1) "c"
|
||||
|
||||
Warning: Illegal string offset '14.5' in %s on line %d
|
||||
string(1) "o"
|
||||
|
||||
Notice: A non well formed numeric value encountered in %s on line %d
|
||||
string(1) "r"
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
string(1) "i"
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
string(1) "S"
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
@@ -62,4 +42,4 @@ string(1) "%s"
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
string(1) "i"
|
||||
Done
|
||||
Done
|
||||
@@ -24,6 +24,6 @@ $x->prop;
|
||||
$x->y;
|
||||
echo "ok\n";
|
||||
--EXPECTF--
|
||||
Notice: Uninitialized string offset: 3 in %sresult_unused.php on line %d
|
||||
Notice: Uninitialized string offset: 3 in %sresult_unused.php on line 11
|
||||
ok
|
||||
|
||||
@@ -24,28 +24,28 @@ foo($str[1][0]);
|
||||
foo($str[2][1]);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Uninitialized string offset: -1 in %sstr_offset_001.php on line %d
|
||||
Notice: Uninitialized string offset: -1 in %sstr_offset_001.php on line 7
|
||||
string(0) ""
|
||||
string(1) "a"
|
||||
string(1) "b"
|
||||
string(1) "c"
|
||||
|
||||
Notice: Uninitialized string offset: 3 in %sstr_offset_001.php on line %d
|
||||
Notice: Uninitialized string offset: 3 in %sstr_offset_001.php on line 11
|
||||
string(0) ""
|
||||
string(1) "b"
|
||||
|
||||
Notice: Uninitialized string offset: 1 in %sstr_offset_001.php on line %d
|
||||
Notice: Uninitialized string offset: 1 in %sstr_offset_001.php on line 13
|
||||
string(0) ""
|
||||
|
||||
Notice: Uninitialized string offset: -1 in %sstr_offset_001.php on line %d
|
||||
Notice: Uninitialized string offset: -1 in %sstr_offset_001.php on line 15
|
||||
string(0) ""
|
||||
string(1) "a"
|
||||
string(1) "b"
|
||||
string(1) "c"
|
||||
|
||||
Notice: Uninitialized string offset: 3 in %sstr_offset_001.php on line %d
|
||||
Notice: Uninitialized string offset: 3 in %sstr_offset_001.php on line 19
|
||||
string(0) ""
|
||||
string(1) "b"
|
||||
|
||||
Notice: Uninitialized string offset: 1 in %sstr_offset_001.php on line %d
|
||||
Notice: Uninitialized string offset: 1 in %sstr_offset_001.php on line 21
|
||||
string(0) ""
|
||||
@@ -4,9 +4,6 @@ Bug #55214 (Use of __CLASS__ within trait returns trait name not class name)
|
||||
<?php
|
||||
|
||||
trait ATrait {
|
||||
public static $static_var = __CLASS__;
|
||||
public $var = __CLASS__;
|
||||
|
||||
public static function get_class_name() {
|
||||
return __CLASS__;
|
||||
}
|
||||
@@ -14,14 +11,6 @@ trait ATrait {
|
||||
public function get_class_name_obj() {
|
||||
return __CLASS__;
|
||||
}
|
||||
|
||||
public static function get_class_name2() {
|
||||
return self::$static_var;
|
||||
}
|
||||
|
||||
public function get_class_name_obj2() {
|
||||
return $this->var;
|
||||
}
|
||||
}
|
||||
|
||||
trait Indirect {
|
||||
@@ -38,34 +27,22 @@ class UsingIndirect {
|
||||
|
||||
$r = SomeClass::get_class_name();
|
||||
var_dump($r);
|
||||
$r = SomeClass::get_class_name2();
|
||||
var_dump($r);
|
||||
|
||||
$o = new SomeClass();
|
||||
$r = $o->get_class_name_obj();
|
||||
var_dump($r);
|
||||
$r = $o->get_class_name_obj2();
|
||||
var_dump($r);
|
||||
|
||||
$r = UsingIndirect::get_class_name();
|
||||
var_dump($r);
|
||||
$r = UsingIndirect::get_class_name2();
|
||||
var_dump($r);
|
||||
|
||||
$o = new UsingIndirect();
|
||||
$r = $o->get_class_name_obj();
|
||||
var_dump($r);
|
||||
$r = $o->get_class_name_obj2();
|
||||
var_dump($r);
|
||||
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(9) "SomeClass"
|
||||
string(9) "SomeClass"
|
||||
string(9) "SomeClass"
|
||||
string(9) "SomeClass"
|
||||
string(13) "UsingIndirect"
|
||||
string(13) "UsingIndirect"
|
||||
string(13) "UsingIndirect"
|
||||
string(13) "UsingIndirect"
|
||||
@@ -13,11 +13,18 @@ trait THello1 {
|
||||
}
|
||||
|
||||
echo "PRE-CLASS-GUARD\n";
|
||||
class NoticeForBase extends Base {
|
||||
use THello1;
|
||||
}
|
||||
echo "POST-CLASS-GUARD\n";
|
||||
|
||||
// now the same with a class that defines the property itself
|
||||
|
||||
class Notice extends Base {
|
||||
use THello1;
|
||||
private $hello;
|
||||
}
|
||||
echo "POST-CLASS-GUARD\n";
|
||||
echo "POST-CLASS-GUARD2\n";
|
||||
|
||||
// now we do the test for a fatal error
|
||||
|
||||
@@ -26,7 +33,7 @@ class TraitsTest {
|
||||
public $hello;
|
||||
}
|
||||
|
||||
echo "POST-CLASS-GUARD2\n";
|
||||
echo "POST-CLASS-GUARD\n";
|
||||
|
||||
$t = new TraitsTest;
|
||||
$t->hello = "foo";
|
||||
@@ -34,7 +41,10 @@ $t->hello = "foo";
|
||||
--EXPECTF--
|
||||
PRE-CLASS-GUARD
|
||||
|
||||
Strict Standards: Notice and THello1 define the same property ($hello) in the composition of Notice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in %s on line %d
|
||||
Strict Standards: Base and THello1 define the same property ($hello) in the composition of NoticeForBase. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in %s on line %d
|
||||
POST-CLASS-GUARD
|
||||
|
||||
Strict Standards: Notice and THello1 define the same property ($hello) in the composition of Notice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in %s on line %d
|
||||
POST-CLASS-GUARD2
|
||||
|
||||
Fatal error: TraitsTest and THello1 define the same property ($hello) in the composition of TraitsTest. However, the definition differs and is considered incompatible. Class was composed in %s on line %d
|
||||
@@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Introducing new private variables of the same name in a subclass is ok, and does not lead to any output. That is consitent with normal inheritance handling.
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
|
||||
class Base {
|
||||
private $hello;
|
||||
}
|
||||
|
||||
trait THello1 {
|
||||
private $hello;
|
||||
}
|
||||
|
||||
// Now we use the trait, which happens to introduce another private variable
|
||||
// but they are distinct, and not related to each other, so no warning.
|
||||
echo "PRE-CLASS-GUARD\n";
|
||||
class SameNameInSubClassNoNotice extends Base {
|
||||
use THello1;
|
||||
}
|
||||
echo "POST-CLASS-GUARD\n";
|
||||
|
||||
// now the same with a class that defines the property itself,
|
||||
// that should give the expected strict warning.
|
||||
|
||||
class Notice extends Base {
|
||||
use THello1;
|
||||
private $hello;
|
||||
}
|
||||
echo "POST-CLASS-GUARD2\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
PRE-CLASS-GUARD
|
||||
POST-CLASS-GUARD
|
||||
|
||||
Strict Standards: Notice and THello1 define the same property ($hello) in the composition of Notice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in %s on line %d
|
||||
POST-CLASS-GUARD2
|
||||
@@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
Introducing new private variables of the same name in a subclass is ok, and does not lead to any output. That is consitent with normal inheritance handling.
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
|
||||
class Base {
|
||||
protected $hello;
|
||||
}
|
||||
|
||||
trait THello1 {
|
||||
protected $hello;
|
||||
}
|
||||
|
||||
// Protected and public are handle more strict with a warning then what is
|
||||
// expected from normal inheritance since they can have easier coliding semantics
|
||||
echo "PRE-CLASS-GUARD\n";
|
||||
class SameNameInSubClassProducesNotice extends Base {
|
||||
use THello1;
|
||||
}
|
||||
echo "POST-CLASS-GUARD\n";
|
||||
|
||||
// now the same with a class that defines the property itself, too.
|
||||
|
||||
class Notice extends Base {
|
||||
use THello1;
|
||||
protected $hello;
|
||||
}
|
||||
echo "POST-CLASS-GUARD2\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
PRE-CLASS-GUARD
|
||||
|
||||
Strict Standards: Base and THello1 define the same property ($hello) in the composition of SameNameInSubClassProducesNotice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in %s on line %d
|
||||
POST-CLASS-GUARD
|
||||
|
||||
Strict Standards: Notice and THello1 define the same property ($hello) in the composition of Notice. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in %s on line %d
|
||||
POST-CLASS-GUARD2
|
||||
@@ -1,62 +0,0 @@
|
||||
--TEST--
|
||||
Handling of private fields with traits needs to have same semantics as with normal inheritance.
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
|
||||
class BaseWithPropA {
|
||||
private $hello = 0;
|
||||
}
|
||||
|
||||
// This is how privates are handled in normal inheritance
|
||||
class SubclassClassicInheritance extends BaseWithPropA {
|
||||
private $hello = 0;
|
||||
}
|
||||
|
||||
// And here, we need to make sure, that the traits behave the same
|
||||
|
||||
trait AHelloProperty {
|
||||
private $hello = 0;
|
||||
}
|
||||
|
||||
class BaseWithTPropB {
|
||||
use AHelloProperty;
|
||||
}
|
||||
|
||||
class SubclassA extends BaseWithPropA {
|
||||
use AHelloProperty;
|
||||
}
|
||||
|
||||
class SubclassB extends BaseWithTPropB {
|
||||
use AHelloProperty;
|
||||
}
|
||||
|
||||
$classic = new SubclassClassicInheritance;
|
||||
var_dump($classic);
|
||||
|
||||
$a = new SubclassA;
|
||||
var_dump($a);
|
||||
|
||||
$b = new SubclassB;
|
||||
var_dump($b);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(SubclassClassicInheritance)#1 (2) {
|
||||
["hello":"SubclassClassicInheritance":private]=>
|
||||
int(0)
|
||||
["hello":"BaseWithPropA":private]=>
|
||||
int(0)
|
||||
}
|
||||
object(SubclassA)#2 (2) {
|
||||
["hello":"SubclassA":private]=>
|
||||
int(0)
|
||||
["hello":"BaseWithPropA":private]=>
|
||||
int(0)
|
||||
}
|
||||
object(SubclassB)#3 (2) {
|
||||
["hello":"SubclassB":private]=>
|
||||
int(0)
|
||||
["hello":"BaseWithTPropB":private]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
--TEST--
|
||||
Handling of public fields with traits needs to have same semantics as with normal inheritance, however, we do add strict warnings since it is easier to run into something unexpeted with changing traits.
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
|
||||
class BaseWithPropA {
|
||||
public $hello = 0;
|
||||
}
|
||||
|
||||
// This is how publics are handled in normal inheritance
|
||||
class SubclassClassicInheritance extends BaseWithPropA {
|
||||
public $hello = 0;
|
||||
}
|
||||
|
||||
// And here, we need to make sure, that the traits behave the same
|
||||
|
||||
trait AHelloProperty {
|
||||
public $hello = 0;
|
||||
}
|
||||
|
||||
class BaseWithTPropB {
|
||||
use AHelloProperty;
|
||||
}
|
||||
|
||||
class SubclassA extends BaseWithPropA {
|
||||
use AHelloProperty;
|
||||
}
|
||||
|
||||
class SubclassB extends BaseWithTPropB {
|
||||
use AHelloProperty;
|
||||
}
|
||||
|
||||
$classic = new SubclassClassicInheritance;
|
||||
var_dump($classic);
|
||||
|
||||
$a = new SubclassA;
|
||||
var_dump($a);
|
||||
|
||||
$b = new SubclassB;
|
||||
var_dump($b);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: BaseWithPropA and AHelloProperty define the same property ($hello) in the composition of SubclassA. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in %s on line %d
|
||||
|
||||
Strict Standards: BaseWithTPropB and AHelloProperty define the same property ($hello) in the composition of SubclassB. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in %s on line %d
|
||||
object(SubclassClassicInheritance)#1 (1) {
|
||||
["hello"]=>
|
||||
int(0)
|
||||
}
|
||||
object(SubclassA)#2 (1) {
|
||||
["hello"]=>
|
||||
int(0)
|
||||
}
|
||||
object(SubclassB)#3 (1) {
|
||||
["hello"]=>
|
||||
int(0)
|
||||
}
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
@@ -131,7 +131,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-2012 Zend Technologies\n"
|
||||
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2011 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) /* {{{ */
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
@@ -709,8 +709,8 @@ END_EXTERN_C()
|
||||
#else
|
||||
#include "zend_signal.h"
|
||||
|
||||
#define HANDLE_BLOCK_INTERRUPTIONS() ZEND_SIGNAL_BLOCK_INTERRUPUTIONS()
|
||||
#define HANDLE_UNBLOCK_INTERRUPTIONS() ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS()
|
||||
#define HANDLE_BLOCK_INTERRUPTIONS() SIGG(depth)++;
|
||||
#define HANDLE_UNBLOCK_INTERRUPTIONS() if (UNEXPECTED((--SIGG(depth))==SIGG(blocked))) { zend_signal_handler_unblock(TSRMLS_C); }
|
||||
#endif
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
|
||||
+217
-134
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
@@ -89,8 +89,7 @@
|
||||
} while (0)
|
||||
|
||||
#define FREE_POLYMORPHIC_CACHE_SLOT(literal) do { \
|
||||
if (CG(active_op_array)->literals[literal].cache_slot != -1 && \
|
||||
CG(active_op_array)->literals[literal].cache_slot == \
|
||||
if (CG(active_op_array)->literals[literal].cache_slot == \
|
||||
CG(active_op_array)->last_cache_slot - POLYMORPHIC_CACHE_SLOT_SIZE) { \
|
||||
CG(active_op_array)->literals[literal].cache_slot = -1; \
|
||||
CG(active_op_array)->last_cache_slot -= POLYMORPHIC_CACHE_SLOT_SIZE; \
|
||||
@@ -116,6 +115,7 @@ static void zend_duplicate_property_info(zend_property_info *property_info) /* {
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
static void zend_duplicate_property_info_internal(zend_property_info *property_info) /* {{{ */
|
||||
{
|
||||
if (!IS_INTERNED(property_info->name)) {
|
||||
@@ -124,6 +124,7 @@ static void zend_duplicate_property_info_internal(zend_property_info *property_i
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
static void zend_destroy_property_info(zend_property_info *property_info) /* {{{ */
|
||||
{
|
||||
str_efree(property_info->name);
|
||||
@@ -133,6 +134,7 @@ static void zend_destroy_property_info(zend_property_info *property_info) /* {{{
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
static void zend_destroy_property_info_internal(zend_property_info *property_info) /* {{{ */
|
||||
{
|
||||
str_free((char*)property_info->name);
|
||||
@@ -165,6 +167,7 @@ static void build_runtime_defined_function_key(zval *result, const char *name, i
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
static void init_compiler_declarables(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
Z_TYPE(CG(declarables).ticks) = IS_LONG;
|
||||
@@ -208,6 +211,7 @@ void zend_init_compiler_data_structures(TSRMLS_D) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
ZEND_API void file_handle_dtor(zend_file_handle *fh) /* {{{ */
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
@@ -216,6 +220,7 @@ ZEND_API void file_handle_dtor(zend_file_handle *fh) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
void init_compiler(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
CG(active_op_array) = NULL;
|
||||
@@ -227,6 +232,7 @@ void init_compiler(TSRMLS_D) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
void shutdown_compiler(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
zend_stack_destroy(&CG(bp_stack));
|
||||
@@ -242,6 +248,7 @@ void shutdown_compiler(TSRMLS_D) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
ZEND_API char *zend_set_compiled_filename(const char *new_compiled_filename TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
char **pp, *p;
|
||||
@@ -258,30 +265,35 @@ ZEND_API char *zend_set_compiled_filename(const char *new_compiled_filename TSRM
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
CG(compiled_filename) = original_compiled_filename;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
ZEND_API char *zend_get_compiled_filename(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
return CG(compiled_filename);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
ZEND_API int zend_get_compiled_lineno(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
return CG(zend_lineno);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
ZEND_API zend_bool zend_is_compiling(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
return CG(in_compilation);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
static zend_uint get_temporary_variable(zend_op_array *op_array) /* {{{ */
|
||||
{
|
||||
return (op_array->T)++ * ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable));
|
||||
@@ -597,6 +609,7 @@ void zend_do_unary_op(zend_uchar op, znode *result, const znode *op1 TSRMLS_DC)
|
||||
|
||||
#define MAKE_NOP(opline) { opline->opcode = ZEND_NOP; memset(&opline->result,0,sizeof(opline->result)); memset(&opline->op1,0,sizeof(opline->op1)); memset(&opline->op2,0,sizeof(opline->op2)); opline->result_type=opline->op1_type=opline->op2_type=IS_UNUSED; }
|
||||
|
||||
|
||||
static void zend_do_op_data(zend_op *data_op, const znode *value TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
data_op->opcode = ZEND_OP_DATA;
|
||||
@@ -1974,10 +1987,8 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */
|
||||
if (last_op->opcode == ZEND_FETCH_OBJ_R) {
|
||||
if (last_op->op2_type == IS_CONST) {
|
||||
zval name;
|
||||
|
||||
name = CONSTANT(last_op->op2.constant);
|
||||
if (Z_TYPE(name) != IS_STRING) {
|
||||
zend_error(E_COMPILE_ERROR, "Method name must be a string");
|
||||
}
|
||||
if (!IS_INTERNED(Z_STRVAL(name))) {
|
||||
Z_STRVAL(name) = estrndup(Z_STRVAL(name), Z_STRLEN(name));
|
||||
}
|
||||
@@ -2370,11 +2381,7 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na
|
||||
zend_op *opline;
|
||||
|
||||
if (method_name->op_type == IS_CONST) {
|
||||
char *lcname;
|
||||
if (Z_TYPE(method_name->u.constant) != IS_STRING) {
|
||||
zend_error(E_COMPILE_ERROR, "Method name must be a string");
|
||||
}
|
||||
lcname = zend_str_tolower_dup(Z_STRVAL(method_name->u.constant), Z_STRLEN(method_name->u.constant));
|
||||
char *lcname = zend_str_tolower_dup(Z_STRVAL(method_name->u.constant), Z_STRLEN(method_name->u.constant));
|
||||
if ((sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == Z_STRLEN(method_name->u.constant) &&
|
||||
memcmp(lcname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == 0) {
|
||||
zval_dtor(&method_name->u.constant);
|
||||
@@ -2802,7 +2809,7 @@ ZEND_API void function_add_ref(zend_function *function) /* {{{ */
|
||||
|
||||
static void do_inherit_parent_constructor(zend_class_entry *ce) /* {{{ */
|
||||
{
|
||||
zend_function *function, *new_function;
|
||||
zend_function *function;
|
||||
|
||||
if (!ce->parent) {
|
||||
return;
|
||||
@@ -2863,8 +2870,8 @@ static void do_inherit_parent_constructor(zend_class_entry *ce) /* {{{ */
|
||||
|
||||
if (zend_hash_find(&ce->parent->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), (void **)&function)==SUCCESS) {
|
||||
/* inherit parent's constructor */
|
||||
zend_hash_update(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), function, sizeof(zend_function), (void**)&new_function);
|
||||
function_add_ref(new_function);
|
||||
zend_hash_update(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), function, sizeof(zend_function), NULL);
|
||||
function_add_ref(function);
|
||||
} else {
|
||||
/* Don't inherit the old style constructor if we already have the new style constructor */
|
||||
char *lc_class_name;
|
||||
@@ -2877,8 +2884,8 @@ static void do_inherit_parent_constructor(zend_class_entry *ce) /* {{{ */
|
||||
zend_hash_find(&ce->parent->function_table, lc_parent_class_name, ce->parent->name_length+1, (void **)&function)==SUCCESS) {
|
||||
if (function->common.fn_flags & ZEND_ACC_CTOR) {
|
||||
/* inherit parent's constructor */
|
||||
zend_hash_update(&ce->function_table, lc_parent_class_name, ce->parent->name_length+1, function, sizeof(zend_function), (void**)&new_function);
|
||||
function_add_ref(new_function);
|
||||
zend_hash_update(&ce->function_table, lc_parent_class_name, ce->parent->name_length+1, function, sizeof(zend_function), NULL);
|
||||
function_add_ref(function);
|
||||
}
|
||||
}
|
||||
efree(lc_parent_class_name);
|
||||
@@ -3670,6 +3677,143 @@ static int zend_traits_merge_functions(zend_function *fn TSRMLS_DC, int num_args
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ Originates from php_runkit_function_copy_ctor
|
||||
Duplicate structures in an op_array where necessary to make an outright duplicate */
|
||||
static void zend_traits_duplicate_function(zend_function *fe, zend_class_entry *target_ce, char *newname TSRMLS_DC)
|
||||
{
|
||||
zend_literal *literals_copy;
|
||||
zend_compiled_variable *dupvars;
|
||||
zend_op *opcode_copy;
|
||||
zval class_name_zv;
|
||||
int class_name_literal;
|
||||
int i;
|
||||
int number_of_literals;
|
||||
|
||||
if (fe->op_array.static_variables) {
|
||||
HashTable *tmpHash;
|
||||
|
||||
ALLOC_HASHTABLE(tmpHash);
|
||||
zend_hash_init(tmpHash, zend_hash_num_elements(fe->op_array.static_variables), NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_apply_with_arguments(fe->op_array.static_variables TSRMLS_CC, (apply_func_args_t)zval_copy_static_var, 1, tmpHash);
|
||||
|
||||
fe->op_array.static_variables = tmpHash;
|
||||
}
|
||||
|
||||
number_of_literals = fe->op_array.last_literal;
|
||||
literals_copy = (zend_literal*)emalloc(number_of_literals * sizeof(zend_literal));
|
||||
|
||||
for (i = 0; i < number_of_literals; i++) {
|
||||
literals_copy[i] = fe->op_array.literals[i];
|
||||
zval_copy_ctor(&literals_copy[i].constant);
|
||||
}
|
||||
fe->op_array.literals = literals_copy;
|
||||
|
||||
|
||||
fe->op_array.refcount = emalloc(sizeof(zend_uint));
|
||||
*(fe->op_array.refcount) = 1;
|
||||
|
||||
if (fe->op_array.vars) {
|
||||
i = fe->op_array.last_var;
|
||||
dupvars = safe_emalloc(fe->op_array.last_var, sizeof(zend_compiled_variable), 0);
|
||||
while (i > 0) {
|
||||
i--;
|
||||
dupvars[i].name = estrndup(fe->op_array.vars[i].name, fe->op_array.vars[i].name_len);
|
||||
dupvars[i].name_len = fe->op_array.vars[i].name_len;
|
||||
dupvars[i].hash_value = fe->op_array.vars[i].hash_value;
|
||||
}
|
||||
fe->op_array.vars = dupvars;
|
||||
} else {
|
||||
fe->op_array.vars = NULL;
|
||||
}
|
||||
|
||||
opcode_copy = safe_emalloc(sizeof(zend_op), fe->op_array.last, 0);
|
||||
for(i = 0; i < fe->op_array.last; i++) {
|
||||
opcode_copy[i] = fe->op_array.opcodes[i];
|
||||
if (opcode_copy[i].op1_type != IS_CONST) {
|
||||
switch (opcode_copy[i].opcode) {
|
||||
case ZEND_GOTO:
|
||||
case ZEND_JMP:
|
||||
if (opcode_copy[i].op1.jmp_addr && opcode_copy[i].op1.jmp_addr >= fe->op_array.opcodes &&
|
||||
opcode_copy[i].op1.jmp_addr < fe->op_array.opcodes + fe->op_array.last) {
|
||||
opcode_copy[i].op1.jmp_addr = opcode_copy + (fe->op_array.opcodes[i].op1.jmp_addr - fe->op_array.opcodes);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
/* if __CLASS__ i.e. T_CLASS_C was used, we need to fix it up here */
|
||||
if (target_ce
|
||||
/* REM: used a IS_NULL place holder with a special marker LVAL */
|
||||
&& Z_TYPE_P(opcode_copy[i].op1.zv) == IS_NULL
|
||||
&& Z_LVAL_P(opcode_copy[i].op1.zv) == ZEND_ACC_TRAIT
|
||||
/* Only on merge into an actual class */
|
||||
&& (ZEND_ACC_TRAIT != (target_ce->ce_flags & ZEND_ACC_TRAIT)))
|
||||
{
|
||||
INIT_ZVAL(class_name_zv);
|
||||
ZVAL_STRINGL(&class_name_zv, target_ce->name, target_ce->name_length, 1);
|
||||
class_name_literal = zend_append_individual_literal(&fe->op_array, &class_name_zv TSRMLS_CC);
|
||||
opcode_copy[i].op1.zv = &fe->op_array.literals[class_name_literal].constant;
|
||||
}
|
||||
}
|
||||
|
||||
if (opcode_copy[i].op2_type != IS_CONST) {
|
||||
switch (opcode_copy[i].opcode) {
|
||||
case ZEND_JMPZ:
|
||||
case ZEND_JMPNZ:
|
||||
case ZEND_JMPZ_EX:
|
||||
case ZEND_JMPNZ_EX:
|
||||
case ZEND_JMP_SET:
|
||||
case ZEND_JMP_SET_VAR:
|
||||
if (opcode_copy[i].op2.jmp_addr && opcode_copy[i].op2.jmp_addr >= fe->op_array.opcodes &&
|
||||
opcode_copy[i].op2.jmp_addr < fe->op_array.opcodes + fe->op_array.last) {
|
||||
opcode_copy[i].op2.jmp_addr = opcode_copy + (fe->op_array.opcodes[i].op2.jmp_addr - fe->op_array.opcodes);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
/* if __CLASS__ i.e. T_CLASS_C was used, we need to fix it up here */
|
||||
if (target_ce
|
||||
/* REM: used a IS_NULL place holder with a special marker LVAL */
|
||||
&& Z_TYPE_P(opcode_copy[i].op2.zv) == IS_NULL
|
||||
&& Z_LVAL_P(opcode_copy[i].op2.zv) == ZEND_ACC_TRAIT
|
||||
/* Only on merge into an actual class */
|
||||
&& (ZEND_ACC_TRAIT != (target_ce->ce_flags & ZEND_ACC_TRAIT)))
|
||||
{
|
||||
INIT_ZVAL(class_name_zv);
|
||||
ZVAL_STRINGL(&class_name_zv, target_ce->name, target_ce->name_length, 1);
|
||||
class_name_literal = zend_append_individual_literal(&fe->op_array, &class_name_zv TSRMLS_CC);
|
||||
opcode_copy[i].op2.zv = &fe->op_array.literals[class_name_literal].constant;
|
||||
}
|
||||
}
|
||||
}
|
||||
fe->op_array.opcodes = opcode_copy;
|
||||
fe->op_array.function_name = newname;
|
||||
|
||||
/* was setting it to fe which does not work since fe is stack allocated and not a stable address */
|
||||
/* fe->op_array.prototype = fe->op_array.prototype; */
|
||||
if (fe->op_array.arg_info) {
|
||||
zend_arg_info *tmpArginfo;
|
||||
|
||||
tmpArginfo = safe_emalloc(sizeof(zend_arg_info), fe->op_array.num_args, 0);
|
||||
for(i = 0; i < fe->op_array.num_args; i++) {
|
||||
tmpArginfo[i] = fe->op_array.arg_info[i];
|
||||
|
||||
tmpArginfo[i].name = estrndup(tmpArginfo[i].name, tmpArginfo[i].name_len);
|
||||
if (tmpArginfo[i].class_name) {
|
||||
tmpArginfo[i].class_name = estrndup(tmpArginfo[i].class_name, tmpArginfo[i].class_name_len);
|
||||
}
|
||||
}
|
||||
fe->op_array.arg_info = tmpArginfo;
|
||||
}
|
||||
|
||||
fe->op_array.doc_comment = estrndup(fe->op_array.doc_comment, fe->op_array.doc_comment_len);
|
||||
fe->op_array.try_catch_array = (zend_try_catch_element*)estrndup((char*)fe->op_array.try_catch_array, sizeof(zend_try_catch_element) * fe->op_array.last_try_catch);
|
||||
|
||||
fe->op_array.brk_cont_array = (zend_brk_cont_element*)estrndup((char*)fe->op_array.brk_cont_array, sizeof(zend_brk_cont_element) * fe->op_array.last_brk_cont);
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint mname_len, zend_function* fe TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if (!strncmp(mname, ZEND_CLONE_FUNC_NAME, mname_len)) {
|
||||
@@ -3724,32 +3868,32 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int
|
||||
} else if (existing_fn->common.scope != ce) {
|
||||
add = 1; /* or inherited from other class or interface */
|
||||
}
|
||||
|
||||
|
||||
if (add) {
|
||||
zend_function* parent_function;
|
||||
if (ce->parent && zend_hash_quick_find(&ce->parent->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void**) &parent_function) != FAILURE) {
|
||||
prototype = parent_function; /* ->common.fn_flags |= ZEND_ACC_ABSTRACT; */
|
||||
|
||||
/* we got that method in the parent class, and are going to override it,
|
||||
except, if the trait is just asking to have an abstract method implemented. */
|
||||
except, if the trait is just asking to have an abstract method implemented. */
|
||||
if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
/* then we clean up an skip this method */
|
||||
zend_function_dtor(fn);
|
||||
return ZEND_HASH_APPLY_REMOVE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fn->common.scope = ce;
|
||||
fn->common.prototype = prototype;
|
||||
|
||||
|
||||
if (prototype
|
||||
&& (prototype->common.fn_flags & ZEND_ACC_IMPLEMENTED_ABSTRACT
|
||||
|| prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||
fn->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
|
||||
} else if (fn->common.fn_flags & ZEND_ACC_IMPLEMENTED_ABSTRACT) {
|
||||
/* remove ZEND_ACC_IMPLEMENTED_ABSTRACT flag, think it shouldn't be copied to class */
|
||||
fn->common.fn_flags = fn->common.fn_flags - ZEND_ACC_IMPLEMENTED_ABSTRACT;
|
||||
}
|
||||
|| prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||
fn->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
|
||||
} else if (fn->common.fn_flags & ZEND_ACC_IMPLEMENTED_ABSTRACT) {
|
||||
/* remove ZEND_ACC_IMPLEMENTED_ABSTRACT flag, think it shouldn't be copied to class */
|
||||
fn->common.fn_flags = fn->common.fn_flags - ZEND_ACC_IMPLEMENTED_ABSTRACT;
|
||||
}
|
||||
|
||||
/* check whether the trait method fullfills the inheritance requirements */
|
||||
if (prototype) {
|
||||
@@ -3780,14 +3924,14 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int
|
||||
ce->ce_flags |= ZEND_HAS_STATIC_IN_METHODS;
|
||||
}
|
||||
fn_copy = *fn;
|
||||
function_add_ref(&fn_copy);
|
||||
zend_traits_duplicate_function(&fn_copy, ce, estrdup(fn->common.function_name) TSRMLS_CC);
|
||||
|
||||
if (zend_hash_quick_update(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, &fn_copy, sizeof(zend_function), (void**)&fn_copy_p)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occured during updating class method table", hash_key->arKey);
|
||||
}
|
||||
|
||||
|
||||
zend_add_magic_methods(ce, hash_key->arKey, hash_key->nKeyLength, fn_copy_p TSRMLS_CC);
|
||||
|
||||
|
||||
zend_function_dtor(fn);
|
||||
} else {
|
||||
zend_function_dtor(fn);
|
||||
@@ -3808,7 +3952,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
zend_function fn_copy;
|
||||
void* dummy;
|
||||
size_t i = 0;
|
||||
|
||||
|
||||
target = va_arg(args, HashTable*);
|
||||
target_ce = va_arg(args, zend_class_entry*);
|
||||
aliases = va_arg(args, zend_trait_alias**);
|
||||
@@ -3825,11 +3969,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
&& aliases[i]->trait_method->mname_len == fnname_len
|
||||
&& (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) {
|
||||
fn_copy = *fn;
|
||||
function_add_ref(&fn_copy);
|
||||
/* this function_name is never destroyed, because its refcount
|
||||
greater than 1, classes are always destoyed in reverse order
|
||||
and trait is declared early than this class */
|
||||
fn_copy.common.function_name = aliases[i]->alias;
|
||||
zend_traits_duplicate_function(&fn_copy, NULL, estrndup(aliases[i]->alias, aliases[i]->alias_len) TSRMLS_CC);
|
||||
|
||||
/* if it is 0, no modifieres has been changed */
|
||||
if (aliases[i]->modifiers) {
|
||||
@@ -3861,7 +4001,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
if (exclude_table == NULL || zend_hash_find(exclude_table, lcname, fnname_len, &dummy) == FAILURE) {
|
||||
/* is not in hashtable, thus, function is not to be excluded */
|
||||
fn_copy = *fn;
|
||||
function_add_ref(&fn_copy);
|
||||
zend_traits_duplicate_function(&fn_copy, NULL, estrndup(fn->common.function_name, fnname_len) TSRMLS_CC);
|
||||
|
||||
/* apply aliases which are not qualified by a class name, or which have not
|
||||
* alias name, just setting visibility */
|
||||
@@ -4083,50 +4223,6 @@ static zend_class_entry* find_first_definition(zend_class_entry *ce, size_t curr
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_traits_register_private_property(zend_class_entry *ce, const char *name, int name_len, zend_property_info *old_info, zval *property TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
char *priv_name;
|
||||
int priv_name_length;
|
||||
const char *interned_name;
|
||||
zend_property_info property_info;
|
||||
ulong h = zend_get_hash_value(name, name_len+1);
|
||||
property_info = *old_info;
|
||||
|
||||
if (old_info->flags & ZEND_ACC_STATIC) {
|
||||
property_info.offset = ce->default_static_members_count++;
|
||||
ce->default_static_members_table = perealloc(ce->default_static_members_table, sizeof(zval*) * ce->default_static_members_count, ce->type == ZEND_INTERNAL_CLASS);
|
||||
ce->default_static_members_table[property_info.offset] = property;
|
||||
if (ce->type == ZEND_USER_CLASS) {
|
||||
ce->static_members_table = ce->default_static_members_table;
|
||||
}
|
||||
} else {
|
||||
property_info.offset = ce->default_properties_count++;
|
||||
ce->default_properties_table = perealloc(ce->default_properties_table, sizeof(zval*) * ce->default_properties_count, ce->type == ZEND_INTERNAL_CLASS);
|
||||
ce->default_properties_table[property_info.offset] = property;
|
||||
}
|
||||
|
||||
zend_mangle_property_name(&priv_name, &priv_name_length, ce->name, ce->name_length, name, name_len, ce->type & ZEND_INTERNAL_CLASS);
|
||||
property_info.name = priv_name;
|
||||
property_info.name_length = priv_name_length;
|
||||
|
||||
interned_name = zend_new_interned_string(property_info.name, property_info.name_length+1, 0 TSRMLS_CC);
|
||||
if (interned_name != property_info.name) {
|
||||
if (ce->type == ZEND_USER_CLASS) {
|
||||
efree((char*)property_info.name);
|
||||
} else {
|
||||
free((char*)property_info.name);
|
||||
}
|
||||
property_info.name = interned_name;
|
||||
}
|
||||
|
||||
property_info.h = zend_get_hash_value(property_info.name, property_info.name_length+1);
|
||||
|
||||
property_info.ce = ce;
|
||||
|
||||
zend_hash_quick_update(&ce->properties_info, name, name_len+1, h, &property_info, sizeof(zend_property_info), NULL);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
size_t i;
|
||||
@@ -4138,11 +4234,10 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {
|
||||
ulong prop_hash;
|
||||
const char* class_name_unused;
|
||||
zend_bool prop_found;
|
||||
zend_bool parent_prop_is_private = 0;
|
||||
zend_bool not_compatible;
|
||||
zval* prop_value;
|
||||
|
||||
|
||||
|
||||
|
||||
/* In the following steps the properties are inserted into the property table
|
||||
* for that, a very strict approach is applied:
|
||||
* - check for compatibility, if not compatible with any property in class -> fatal
|
||||
@@ -4176,55 +4271,40 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {
|
||||
if (coliding_prop->flags & ZEND_ACC_SHADOW) {
|
||||
/* this one is inherited, lets look it up in its own class */
|
||||
zend_hash_quick_find(&coliding_prop->ce->properties_info, prop_name, prop_name_length+1, prop_hash, (void **) &coliding_prop);
|
||||
parent_prop_is_private = (coliding_prop->flags & ZEND_ACC_PRIVATE) == ZEND_ACC_PRIVATE;
|
||||
}
|
||||
|
||||
if (!parent_prop_is_private) {
|
||||
if ((coliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))
|
||||
== (property_info->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))) {
|
||||
/* flags are identical, now the value needs to be checked */
|
||||
if (property_info->flags & ZEND_ACC_STATIC) {
|
||||
not_compatible = (FAILURE == compare_function(&compare_result,
|
||||
ce->default_static_members_table[coliding_prop->offset],
|
||||
ce->traits[i]->default_static_members_table[property_info->offset] TSRMLS_CC))
|
||||
|| (Z_LVAL(compare_result) != 0);
|
||||
} else {
|
||||
not_compatible = (FAILURE == compare_function(&compare_result,
|
||||
ce->default_properties_table[coliding_prop->offset],
|
||||
ce->traits[i]->default_properties_table[property_info->offset] TSRMLS_CC))
|
||||
|| (Z_LVAL(compare_result) != 0);
|
||||
}
|
||||
if ( (coliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))
|
||||
== (property_info->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))) {
|
||||
/* flags are identical, now the value needs to be checked */
|
||||
if (property_info->flags & ZEND_ACC_STATIC) {
|
||||
not_compatible = (FAILURE == compare_function(&compare_result,
|
||||
ce->default_static_members_table[coliding_prop->offset],
|
||||
ce->traits[i]->default_static_members_table[property_info->offset] TSRMLS_CC))
|
||||
|| (Z_LVAL(compare_result) != 0);
|
||||
} else {
|
||||
/* the flags are not identical, thus, we assume properties are not compatible */
|
||||
not_compatible = 1;
|
||||
}
|
||||
|
||||
if (not_compatible) {
|
||||
zend_error(E_COMPILE_ERROR,
|
||||
"%s and %s define the same property ($%s) in the composition of %s. However, the definition differs and is considered incompatible. Class was composed",
|
||||
find_first_definition(ce, i, prop_name, prop_name_length, prop_hash, coliding_prop->ce)->name,
|
||||
property_info->ce->name,
|
||||
prop_name,
|
||||
ce->name);
|
||||
} else {
|
||||
zend_error(E_STRICT,
|
||||
"%s and %s define the same property ($%s) in the composition of %s. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed",
|
||||
find_first_definition(ce, i, prop_name, prop_name_length, prop_hash, coliding_prop->ce)->name,
|
||||
property_info->ce->name,
|
||||
prop_name,
|
||||
ce->name);
|
||||
not_compatible = (FAILURE == compare_function(&compare_result,
|
||||
ce->default_properties_table[coliding_prop->offset],
|
||||
ce->traits[i]->default_properties_table[property_info->offset] TSRMLS_CC))
|
||||
|| (Z_LVAL(compare_result) != 0);
|
||||
}
|
||||
} else {
|
||||
/* private property, make the property_info.offset indenpended */
|
||||
if (property_info->flags & ZEND_ACC_STATIC) {
|
||||
prop_value = ce->traits[i]->default_static_members_table[property_info->offset];
|
||||
} else {
|
||||
prop_value = ce->traits[i]->default_properties_table[property_info->offset];
|
||||
}
|
||||
Z_ADDREF_P(prop_value);
|
||||
/* the flags are not identical, thus, we assume properties are not compatible */
|
||||
not_compatible = 1;
|
||||
}
|
||||
|
||||
zend_traits_register_private_property(ce, prop_name, prop_name_length, property_info, prop_value TSRMLS_CC);
|
||||
return;
|
||||
if (not_compatible) {
|
||||
zend_error(E_COMPILE_ERROR,
|
||||
"%s and %s define the same property ($%s) in the composition of %s. However, the definition differs and is considered incompatible. Class was composed",
|
||||
find_first_definition(ce, i, prop_name, prop_name_length, prop_hash, coliding_prop->ce)->name,
|
||||
property_info->ce->name,
|
||||
prop_name,
|
||||
ce->name);
|
||||
} else {
|
||||
zend_error(E_STRICT,
|
||||
"%s and %s define the same property ($%s) in the composition of %s. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed",
|
||||
find_first_definition(ce, i, prop_name, prop_name_length, prop_hash, coliding_prop->ce)->name,
|
||||
property_info->ce->name,
|
||||
prop_name,
|
||||
ce->name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4316,7 +4396,7 @@ ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC) /* {{{ */
|
||||
|
||||
/* verify that all abstract methods from traits have been implemented */
|
||||
zend_verify_abstract_class(ce TSRMLS_CC);
|
||||
|
||||
|
||||
/* now everything should be fine and an added ZEND_ACC_IMPLICIT_ABSTRACT_CLASS should be removed */
|
||||
if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS) {
|
||||
ce->ce_flags -= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
|
||||
@@ -4324,6 +4404,7 @@ ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
ZEND_API int do_bind_function(const zend_op_array *op_array, zend_op *opline, HashTable *function_table, zend_bool compile_time) /* {{{ */
|
||||
{
|
||||
zend_function *function;
|
||||
@@ -4361,6 +4442,7 @@ ZEND_API int do_bind_function(const zend_op_array *op_array, zend_op *opline, Ha
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
void zend_add_trait_precedence(znode *precedence_znode TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_class_entry *ce = CG(active_class_entry);
|
||||
@@ -4399,6 +4481,7 @@ void zend_prepare_reference(znode *result, znode *class_name, znode *method_name
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
void zend_prepare_trait_alias(znode *result, znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_trait_alias *trait_alias = emalloc(sizeof(zend_trait_alias));
|
||||
@@ -5090,11 +5173,11 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC) /* {{{ */
|
||||
void zend_do_implements_trait(znode *trait_name TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_op *opline;
|
||||
if ((CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
zend_error(E_COMPILE_ERROR,
|
||||
"Cannot use traits inside of interfaces. %s is used in %s",
|
||||
Z_STRVAL(trait_name->u.constant), CG(active_class_entry)->name);
|
||||
}
|
||||
if ((CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
zend_error(E_COMPILE_ERROR,
|
||||
"Cannot use traits inside of interfaces. %s is used in %s",
|
||||
Z_STRVAL(trait_name->u.constant), CG(active_class_entry)->name);
|
||||
}
|
||||
|
||||
|
||||
switch (zend_get_class_fetch_type(Z_STRVAL(trait_name->u.constant), Z_STRLEN(trait_name->u.constant))) {
|
||||
@@ -6403,7 +6486,7 @@ void zend_do_jmp_set(const znode *value, znode *jmp_token, znode *colon_token TS
|
||||
|
||||
GET_NODE(colon_token, opline->result);
|
||||
|
||||
jmp_token->u.op.opline_num = op_number;
|
||||
jmp_token->u.op .opline_num = op_number;
|
||||
|
||||
INC_BPC(CG(active_op_array));
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
|
||||
+5
-37
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
@@ -224,45 +224,13 @@ ZEND_API void zend_register_string_constant(const char *name, uint name_len, cha
|
||||
zend_register_stringl_constant(name, name_len, strval, strlen(strval), flags, module_number TSRMLS_CC);
|
||||
}
|
||||
|
||||
static int zend_get_special_constant(const char *name, uint name_len, zend_constant **c TSRMLS_DC)
|
||||
static int zend_get_halt_offset_constant(const char *name, uint name_len, zend_constant **c TSRMLS_DC)
|
||||
{
|
||||
int ret;
|
||||
static char haltoff[] = "__COMPILER_HALT_OFFSET__";
|
||||
|
||||
if (!EG(in_execution)) {
|
||||
return 0;
|
||||
} else if (name_len == sizeof("__CLASS__")-1 &&
|
||||
!memcmp(name, "__CLASS__", sizeof("__CLASS__")-1)) {
|
||||
zend_constant tmp;
|
||||
|
||||
/* Returned constants may be cached, so they have to be stored */
|
||||
if (EG(scope) && EG(scope)->name) {
|
||||
int const_name_len;
|
||||
char *const_name;
|
||||
ALLOCA_FLAG(use_heap)
|
||||
|
||||
const_name_len = sizeof("\0__CLASS__") + EG(scope)->name_length;
|
||||
const_name = do_alloca(const_name_len, use_heap);
|
||||
memcpy(const_name, "\0__CLASS__", sizeof("\0__CLASS__")-1);
|
||||
zend_str_tolower_copy(const_name + sizeof("\0__CLASS__")-1, EG(scope)->name, EG(scope)->name_length);
|
||||
if (zend_hash_find(EG(zend_constants), const_name, const_name_len, (void**)c) == FAILURE) {
|
||||
zend_hash_add(EG(zend_constants), const_name, const_name_len, (void*)&tmp, sizeof(zend_constant), (void**)c);
|
||||
memset(*c, 0, sizeof(zend_constant));
|
||||
Z_STRVAL((**c).value) = estrndup(EG(scope)->name, EG(scope)->name_length);
|
||||
Z_STRLEN((**c).value) = EG(scope)->name_length;
|
||||
Z_TYPE((**c).value) = IS_STRING;
|
||||
}
|
||||
free_alloca(const_name, use_heap);
|
||||
} else {
|
||||
if (zend_hash_find(EG(zend_constants), "\0__CLASS__", sizeof("\0__CLASS__"), (void**)c) == FAILURE) {
|
||||
zend_hash_add(EG(zend_constants), "\0__CLASS__", sizeof("\0__CLASS__"), (void*)&tmp, sizeof(zend_constant), (void**)c);
|
||||
memset(*c, 0, sizeof(zend_constant));
|
||||
Z_STRVAL((**c).value) = estrndup("", 0);
|
||||
Z_STRLEN((**c).value) = 0;
|
||||
Z_TYPE((**c).value) = IS_STRING;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
} else if (name_len == sizeof("__COMPILER_HALT_OFFSET__")-1 &&
|
||||
!memcmp(name, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) {
|
||||
const char *cfilename;
|
||||
@@ -297,7 +265,7 @@ ZEND_API int zend_get_constant(const char *name, uint name_len, zval *result TSR
|
||||
retval=0;
|
||||
}
|
||||
} else {
|
||||
retval = zend_get_special_constant(name, name_len, &c TSRMLS_CC);
|
||||
retval = zend_get_halt_offset_constant(name, name_len, &c TSRMLS_CC);
|
||||
}
|
||||
efree(lookup_name);
|
||||
}
|
||||
@@ -464,14 +432,14 @@ zend_constant *zend_quick_get_constant(const zend_literal *key, ulong flags TSRM
|
||||
(c->flags & CONST_CS) != 0) {
|
||||
|
||||
key--;
|
||||
if (!zend_get_special_constant(Z_STRVAL(key->constant), Z_STRLEN(key->constant), &c TSRMLS_CC)) {
|
||||
if (!zend_get_halt_offset_constant(Z_STRVAL(key->constant), Z_STRLEN(key->constant), &c TSRMLS_CC)) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
key--;
|
||||
if (!zend_get_special_constant(Z_STRVAL(key->constant), Z_STRLEN(key->constant), &c TSRMLS_CC)) {
|
||||
if (!zend_get_halt_offset_constant(Z_STRVAL(key->constant), Z_STRLEN(key->constant), &c TSRMLS_CC)) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
|
||||
+3
-21
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
@@ -1147,22 +1147,13 @@ convert_to_array:
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(dim) != IS_LONG) {
|
||||
|
||||
switch(Z_TYPE_P(dim)) {
|
||||
/* case IS_LONG: */
|
||||
case IS_STRING:
|
||||
if (IS_LONG == is_numeric_string(Z_STRVAL_P(dim), Z_STRLEN_P(dim), NULL, NULL, -1)) {
|
||||
break;
|
||||
}
|
||||
if (type != BP_VAR_UNSET) {
|
||||
zend_error(E_WARNING, "Illegal string offset '%s'", dim->value.str.val);
|
||||
}
|
||||
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
case IS_NULL:
|
||||
case IS_BOOL:
|
||||
zend_error(E_NOTICE, "String offset cast occured");
|
||||
/* do nothing */
|
||||
break;
|
||||
default:
|
||||
zend_error(E_WARNING, "Illegal offset type");
|
||||
@@ -1274,19 +1265,10 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval **cont
|
||||
switch(Z_TYPE_P(dim)) {
|
||||
/* case IS_LONG: */
|
||||
case IS_STRING:
|
||||
if (IS_LONG == is_numeric_string(Z_STRVAL_P(dim), Z_STRLEN_P(dim), NULL, NULL, -1)) {
|
||||
break;
|
||||
}
|
||||
if (type != BP_VAR_IS) {
|
||||
zend_error(E_WARNING, "Illegal string offset '%s'", dim->value.str.val);
|
||||
}
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
case IS_NULL:
|
||||
case IS_BOOL:
|
||||
if (type != BP_VAR_IS) {
|
||||
zend_error(E_NOTICE, "String offset cast occured");
|
||||
}
|
||||
/* do nothing */
|
||||
break;
|
||||
default:
|
||||
zend_error(E_WARNING, "Illegal offset type");
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
@@ -110,7 +110,7 @@ static int clean_non_persistent_function(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;
|
||||
return (function->type != ZEND_INTERNAL_FUNCTION);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -122,7 +122,7 @@ static int clean_non_persistent_class(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;
|
||||
return ((*ce)->type != ZEND_INTERNAL_CLASS);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -298,8 +298,8 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
|
||||
|
||||
/* Destroy all op arrays */
|
||||
if (EG(full_tables_cleanup)) {
|
||||
zend_hash_reverse_apply(EG(function_table), (apply_func_t) clean_non_persistent_function_full TSRMLS_CC);
|
||||
zend_hash_reverse_apply(EG(class_table), (apply_func_t) clean_non_persistent_class_full TSRMLS_CC);
|
||||
zend_hash_apply(EG(function_table), (apply_func_t) clean_non_persistent_function_full TSRMLS_CC);
|
||||
zend_hash_apply(EG(class_table), (apply_func_t) clean_non_persistent_class_full TSRMLS_CC);
|
||||
} else {
|
||||
zend_hash_reverse_apply(EG(function_table), (apply_func_t) clean_non_persistent_function TSRMLS_CC);
|
||||
zend_hash_reverse_apply(EG(class_table), (apply_func_t) clean_non_persistent_class TSRMLS_CC);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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
-2
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
@@ -1399,7 +1399,6 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
|
||||
p->h = num_index;
|
||||
} else {
|
||||
p->h = h;
|
||||
p->nKeyLength = str_length;
|
||||
if (IS_INTERNED(str_index)) {
|
||||
p->arKey = str_index;
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
@@ -907,6 +907,7 @@ common_scalar:
|
||||
| T_LINE { $$ = $1; }
|
||||
| T_FILE { $$ = $1; }
|
||||
| T_DIR { $$ = $1; }
|
||||
| T_CLASS_C { $$ = $1; }
|
||||
| T_TRAIT_C { $$ = $1; }
|
||||
| T_METHOD_C { $$ = $1; }
|
||||
| T_FUNC_C { $$ = $1; }
|
||||
@@ -926,7 +927,6 @@ static_scalar: /* compile-time evaluated scalars */
|
||||
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; }
|
||||
| '[' static_array_pair_list ']' { $$ = $2; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; }
|
||||
| static_class_constant { $$ = $1; }
|
||||
| T_CLASS_C { $$ = $1; }
|
||||
;
|
||||
|
||||
static_class_constant:
|
||||
@@ -942,7 +942,6 @@ scalar:
|
||||
| common_scalar { $$ = $1; }
|
||||
| '"' encaps_list '"' { $$ = $2; }
|
||||
| T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; CG(heredoc) = Z_STRVAL($1.u.constant); CG(heredoc_len) = Z_STRLEN($1.u.constant); }
|
||||
| T_CLASS_C { if (Z_TYPE($1.u.constant) == IS_CONSTANT) {zend_do_fetch_constant(&$$, NULL, &$1, ZEND_RT, 1 TSRMLS_CC);} else {$$ = $1;} }
|
||||
;
|
||||
|
||||
|
||||
|
||||
+347
-353
File diff suppressed because it is too large.
Load diff
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
@@ -756,8 +756,6 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
|
||||
if (compiler_result==1) {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
CG(unclean_shutdown)=1;
|
||||
destroy_op_array(op_array TSRMLS_CC);
|
||||
efree(op_array);
|
||||
retval = NULL;
|
||||
} else {
|
||||
zend_do_return(NULL, 0 TSRMLS_CC);
|
||||
@@ -904,10 +902,6 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
|
||||
*t++ = '\v';
|
||||
zendlval->value.str.len--;
|
||||
break;
|
||||
case 'e':
|
||||
*t++ = '\e';
|
||||
zendlval->value.str.len--;
|
||||
break;
|
||||
case '"':
|
||||
case '`':
|
||||
if (*s != quote_type) {
|
||||
@@ -1564,11 +1558,11 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
if (CG(active_class_entry)
|
||||
&& (ZEND_ACC_TRAIT ==
|
||||
(CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT))) {
|
||||
/* We create a special __CLASS__ constant that is going to be resolved
|
||||
at run-time */
|
||||
zendlval->value.str.len = sizeof("__CLASS__")-1;
|
||||
zendlval->value.str.val = estrndup("__CLASS__", zendlval->value.str.len);
|
||||
zendlval->type = IS_CONSTANT;
|
||||
// This is a hack, we abuse IS_NULL to indicate an invalid value
|
||||
// if __CLASS__ is encountered in a trait, however, we also not that we
|
||||
// should fix it up when we copy the method into an actual class
|
||||
zendlval->value.lval = ZEND_ACC_TRAIT;
|
||||
zendlval->type = IS_NULL;
|
||||
} else {
|
||||
if (CG(active_class_entry)) {
|
||||
class_name = CG(active_class_entry)->name;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Mon Jan 16 14:45:55 2012 */
|
||||
/* Generated by re2c 0.13.5 on Tue Sep 13 17:29:46 2011 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
| Copyright (c) 1998-2011 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 |
|
||||
|
||||
Loaded 100 of 971 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user