Commit Graph

536 Commits

Author SHA1 Message Date
Xinchen Hui
a9c503bc27 Merge branch 'PHP-5.6' 2013-12-17 15:10:56 +08:00
Xinchen Hui
eeb37c40e6 Save one char compare 2013-12-17 15:09:52 +08:00
Kalle Sommer Nielsen
0fc8e6af0a Eliminate another straight forward TSRMLS_FETCH() in zend_startup_module()
# For THTTPD:
# The code that uses a call to this function is for older versions of PHP anyway so its not covered

# For Zend OpCache:
# Added a new define for 5.6 and wrapped the code around that so its still compatible with older version
2013-12-12 20:30:45 +01:00
Dmitry Stogov
5d25762646 Removed unused "pHashFunction" argument in _zend_hash_init() and family (must be 99% source compatible) 2013-11-28 18:40:46 +04:00
Bob Weinand
d36cf90291 Merge branch 'const_scalar_exprs' into PHP-5.6
Conflicts:
	Zend/zend_extensions.h
2013-11-28 13:41:42 +01:00
Dmitry Stogov
57c1335fec Don't check argument types for internal functions without type hinting 2013-11-28 11:44:14 +04:00
krakjoe
1a1e83a5d9 export more Zend API 2013-11-20 16:24:22 +00:00
Bob Weinand
82cd3779f4 Whitespace fix 2013-11-01 16:49:23 +01:00
Bob Weinand
b45043a1b7 converted several switches to ifs and made more opcache friendly 2013-11-01 16:16:58 +01:00
Bob Weinand
2361745806 Working commit for constant scalar expressions (with constants).
Tests will follow.
2013-10-31 08:57:12 +01:00
Nikita Popov
0d7a638866 Implement variadic function syntax
As per RFC: https://wiki.php.net/rfc/variadics
2013-09-26 18:39:17 +02:00
Nikita Popov
96b1c2145c Provide more macros for handling of interned strings
* str_erealloc behaves like erealloc for normal strings, but will
   use emalloc+memcpy for interned strings.
 * str_estrndup behaves like estrndup for normal strings, but will
   not copy interned strings.
 * str_strndup behaves like zend_strndup for normal strings, but
   will not copy interned strings.
 * str_efree_rel behaves like efree_rel for normal strings, but
   will not free interned strings.
 * str_hash will return INTERNED_HASH for interned strings and
   compute it using zend_hash_func for normal strings.
2013-09-13 19:42:10 +02:00
Dmitry Stogov
0f3977bc0f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #61759 (class_alias() should accept classes with leading backslashes). (Julien)
  Fixed bug #61759 (class_alias() should accept classes with leading backslashes). (Julien)

Conflicts:
	NEWS
2013-08-29 11:19:02 +04:00
Dmitry Stogov
dfc6feb6e8 Fixed bug #61759 (class_alias() should accept classes with leading backslashes). (Julien) 2013-08-29 11:16:56 +04:00
Xinchen Hui
e356d790cc Merge branch 'PHP-5.4' into PHP-5.5 2013-08-29 14:02:34 +08:00
Xinchen Hui
747daa5354 Avoid compiler warning 2013-08-29 14:02:15 +08:00
Xinchen Hui
f0cb67402f Merge branch 'PHP-5.4' into PHP-5.5 2013-08-29 14:01:54 +08:00
Adam Harvey
72027cd084 Fix bug #65579 (Using traits with get_class_methods causes segfault).
Specifically, this checks if there are trait aliases defined in the class scope
before attempting to dereference the first trait alias. This handles the case
where a trait alias was used in a child trait but no aliases exist in the
concrete class.
2013-08-28 20:33:42 -07:00
Xinchen Hui
a6a3aa5d49 Merge branch 'PHP-5.4' into PHP-5.5
Conflicts:
	Zend/zend_API.c
2013-06-24 23:49:30 +08:00
Xinchen Hui
9cf3e65391 Fixed bug (is_callable() triggers Fatal Error)
This bug is also exists in 5.4, and previous fix by dsp is not complete
for __callStatic stituation, see test script
2013-06-24 23:45:08 +08:00
David Soria Parra
ecd9d76250 Fix #65108 (is_callable() triggers Fatal Error)
We have to check if the fcall info cache contains a pointer if we
use __call, otherwise we endup in a static lookup.
2013-06-24 15:55:10 +02:00
Stanislav Malyshev
02e4d7a290 Merge branch 'pull-request/341'
* pull-request/341: (23 commits)
  typofixes
2013-06-10 14:30:59 -07:00
Stanislav Malyshev
ac40c0b562 Merge branch 'pull-request/341'
* pull-request/341: (23 commits)
  typofixes
2013-06-10 14:20:18 -07:00
Xinchen Hui
79925094c4 Merge branch 'PHP-5.4' into PHP-5.5 2013-03-21 21:10:32 +08:00
Xinchen Hui
7dce0194c8 Fixed bug #64239 (Debug backtrace changed behavior since 5.4.10 or 5.4.11) 2013-03-21 21:09:30 +08:00
Anatol Belski
6f0f5d5281 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix C90 compat
2013-03-19 14:44:20 +01:00
Anatol Belski
7687b8b81c fix C90 compat 2013-03-19 14:42:18 +01:00
Dmitry Stogov
4837bdb910 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #63976 (Parent class incorrectly using child constant in class property)

Conflicts:
	NEWS
2013-03-19 17:04:35 +04:00
Dmitry Stogov
7b0993bfb4 Fixed bug #63976 (Parent class incorrectly using child constant in class property) 2013-03-19 16:59:01 +04:00
Nikita Popov
b7788c52f1 Fix wrong macro usage and add missing NEWS entry 2013-03-15 13:48:33 +01:00
Nikita Popov
fcc6611de9 Add support for non-scalar Iterator keys in foreach
RFC: https://wiki.php.net/rfc/foreach-non-scalar-keys
2013-03-12 17:27:31 +01:00
Gustavo Lopes
b8603035d0 Merge remote-tracking branch 'cataphract/zpp_improv' into PHP-5.5
See https://wiki.php.net/rfc/zpp_improv

* cataphract/zpp_improv:
  Update README.PARAMETER_PARSING_API
  Export zend_parse_parameter()
  Expose zend_parse_arg() as zend_parse_parameter()
  zend_parse_parameters: allow ! for non pointers
2013-01-16 23:37:06 +01:00
Gustavo Lopes
07590e6e45 Export zend_parse_parameter() 2013-01-09 17:00:04 +01:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Xinchen Hui
0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Xinchen Hui
3d86e6d881 Fixed bug #63726 (Memleak with static properties and internal/user classes)
No test scripts provided (will try to find one)
2012-12-10 20:29:51 +08:00
Dmitry Stogov
111aa9fd2e Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #63468 (wrong called method as callback with inheritance)

Conflicts:
	NEWS
2012-11-20 12:54:40 +04:00
Dmitry Stogov
396c1e990a Fixed bug #63468 (wrong called method as callback with inheritance) 2012-11-20 12:51:55 +04:00
Dmitry Stogov
ed3a2eec9c Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #63111 (is_callable() lies for abstract static method)

Conflicts:
	NEWS
2012-09-21 14:18:37 +04:00
Dmitry Stogov
4db74b7f19 Fixed bug #63111 (is_callable() lies for abstract static method) 2012-09-21 13:07:14 +04:00
Xinchen Hui
ee620e9673 Merge branch 'PHP-5.3' into PHP-5.4 2012-09-15 11:51:25 +08:00
Xinchen Hui
4c6678d605 Fixed bug #63093 (Segfault while load extension failed in zts-build). 2012-09-15 11:50:16 +08:00
Anatoliy Belsky
22f55d5665 Fixed bug #62313 Zend\tests\errmsg_021.phpt fails 2012-08-22 11:43:12 +02:00
Felipe Pena
7a72405171 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  - Value stored to var is never used
2012-08-19 12:44:49 -03:00
Felipe Pena
001966c754 - Value stored to var is never used 2012-08-19 12:44:44 -03:00
Xinchen Hui
d289efb457 Merge branch 'PHP-5.3' into PHP-5.4
Conflicts:
	Zend/zend_API.h
2012-08-04 11:14:03 +08:00
Xinchen Hui
f4a315fce2 This becomes useless, since we have set that in the INIT macro 2012-08-04 11:03:21 +08:00
Xinchen Hui
03a1fcabf3 Fixed bug #62744 (dangling pointers made by zend_disable_class)
the test will be added while commit the fix for #62737
2012-08-04 10:41:26 +08:00
Gustavo André dos Santos Lopes
13f1d53b68 Expose zend_parse_arg() as zend_parse_parameter()
Sometimes, one wants to accept several types for a given parameter. zpp
has special functionality for detecting the NULL type, since the NULL
type is frequently used to skip parameters.

However, supporting several types is otherwise very tedious. There are
many cases where this situation arises -- for instance one may want
to accept an arbitrary number of integer and expect them in an array,
but allow a bare integer too; one may want to accept something that
will be used as an array key (which can be either and int or a string);
one may want to accept integer and double numbers. A search for IS_LONG
reveals many situations where this need arises.

The usual solution is to fetch the argument with 'z'/'Z', check its
type, and then convert the argument, e.g. with convert_to_long_ex().
As explain in the last commit, this has different behavior and
generates inconsistency.

Another -- even more flawed strategy --, is to try zpp with a specific
format, forcing it quiet, and if it fails retrying with another form.
But because zpp changes the arguments directly in the stack (for
instance, using "l" converts the zval in the stack to IS_LONG), the
arguments may look different after the first zpp, leaving subtle bugs.

This commit also allows more complex scenarios, for instance where the
expected type of one parameter depends on other parameters.
2012-07-18 23:30:03 +02:00
Gustavo André dos Santos Lopes
980dc7111b zend_parse_parameters: allow ! for non pointers
This commit allows getting information about whether a certain value
was a NULL value by using the ! modifier together with the l/L, d and
b.

Example:
long l;
zend_bool is_null;
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l!", &l, &is_null)

For the specifiers l/L, d and b, NULL values are reported as 0, 0., or
false. But sometimes one wants to distinguish NULL from those other
values -- for instance, to give NULL the same effect as the argument
not having been passed.

The usual way this problem is handled is by fetching the parameter
with 'z' or 'Z', check if it is NULL and if not use
convert_to_long_ex()/convert_to_double_ex(), etc. Unfortunately, this
is not equivalent. convert_to_long_ex() does a cast, while zpp() is
stricter. For instance, zpp will not accept 'foo' for a long argument,
and it will emit a notice when encountering '5foo'.

In fact, the only way to otherwise zpp semantics (without duplicating
its logic) is to fetch the raw zval from the stack and check whether
it's NULL (with zpp itself or its relatives) and then run zpp again.
That is not an elegant solution.
2012-07-18 23:30:03 +02:00