Commit Graph

7619 Commits

Author SHA1 Message Date
Nikita Popov
86434be946 Fix bug #65051: count() off by one inside unset()
nNumOfElements was incremented after the pDestructor code, so any
code in the dtor would get a wrong number of elements.

Right now the bucket deletion code is replicated in four places,
it should probably be moved off into one function (or rather,
zend_hash_apply_deleter should be used everywhere). The codes are
subtly different though in that the HANDLE_UNBLOCK_INTERRUPTIONS()
happens in different places. In particular it seems odd that in
some cases interruptions stay blocked during the destructor call.
2013-06-17 23:44:13 +02:00
Stanislav Malyshev
ac343d5c1f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #64936 - clean doc comment state at the beginning and end of the scan
  ws fix

Conflicts:
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner.l
	Zend/zend_language_scanner_defs.h
2013-06-16 15:29:25 -07:00
Stanislav Malyshev
2208447d42 Fix bug #64936 - clean doc comment state at the beginning and end of the scan 2013-06-16 15:22:23 -07:00
Stanislav Malyshev
4427d1dcfd Merge branch 'pull-request/341'
* pull-request/341: (23 commits)
  typofixes
2013-06-10 14:30:59 -07: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
Stanislav Malyshev
84e35fb2e0 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  typo fixes (argument)
  typo fixes (accommodate, parameter)
2013-06-10 13:36:41 -07:00
Veres Lajos
04145dc2aa typo fixes (argument) 2013-06-10 13:36:17 -07:00
Xinchen Hui
a9d005c04e Merge branch 'PHP-5.4' into PHP-5.5
Conflicts:
	Zend/zend_compile.c
2013-06-10 21:31:25 +08:00
Xinchen Hui
d8792d87cf Fixed bug #64988 (Class loading order affects E_STRICT warning) 2013-06-10 21:26:11 +08:00
Dmitry Stogov
53c39e2b4e Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
* 'PHP-5.4' of git.php.net:php-src:
  PHPTests for the DOMDocument::loadHTMLfile method. They cover - The basic behaviour - When the method receives as argument a file which doesn't exist - When the argument is an empty string - When an empty file is loaded - When a not-well formed html file is loaded
  Fix spelling and correct typo.
2013-06-10 12:59:28 +04:00
Dmitry Stogov
ed0767f5d4 Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:php-src:
  PHPTests for the DOMDocument::loadHTMLfile method. They cover - The basic behaviour - When the method receives as argument a file which doesn't exist - When the argument is an empty string - When an empty file is loaded - When a not-well formed html file is loaded
  Fix spelling and correct typo.
  Fix spelling and correct typo.
2013-06-10 12:59:09 +04:00
Dmitry Stogov
ef20fdb338 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed test script
2013-06-10 12:55:51 +04:00
Dmitry Stogov
f68b8a5e74 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed test script
2013-06-10 12:54:54 +04:00
Dmitry Stogov
f5f6404260 Fixed test script 2013-06-10 12:53:19 +04:00
Carson McDonald
f4e3c7ab7c Fix spelling and correct typo. 2013-06-10 01:42:27 -07:00
Stanislav Malyshev
de1688d16e Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix spelling and correct typo.
2013-06-10 01:41:16 -07:00
Carson McDonald
b8cf17635e Fix spelling and correct typo. 2013-06-10 01:40:41 -07:00
Xinchen Hui
e14800dd46 Fixed merge wrongly 2013-06-09 14:24:05 +08:00
Xinchen Hui
f372e00332 Merge branch 'PHP-5.4' into PHP-5.5
Conflicts:
	Zend/zend_vm_def.h
2013-06-09 13:49:26 +08:00
Xinchen Hui
ab22fda7e5 Merge branch 'PHP-5.3' into PHP-5.4 2013-06-09 13:35:45 +08:00
Xinchen Hui
e8f004d542 Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC) 2013-06-09 13:20:40 +08:00
Xinchen Hui
e89537f2a3 Merge branch 'PHP-5.4' into PHP-5.5 2013-06-05 17:30:09 +08:00
Xinchen Hui
f597f5561e Merge branch 'PHP-5.3' into PHP-5.4 2013-06-05 17:26:10 +08:00
Xinchen Hui
3c87945c95 Fixed bug #64960 (Segfault in gc_zval_possible_root) 2013-06-05 17:25:00 +08:00
Dmitry Stogov
7e00d0994f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed incorrect argument number
2013-05-29 11:14:15 +04:00
Dmitry Stogov
8b515fa00a Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed incorrect argument number

Conflicts:
	Zend/zend_compile.c
2013-05-29 11:12:43 +04:00
Dmitry Stogov
13e5c97ffd Fixed incorrect argument number 2013-05-29 11:09:55 +04:00
Sara Golemon
4f46a40b9d Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Don't double-quote name of namespaced function.
2013-05-19 13:35:03 -07:00
Dmitry Stogov
a2d6d27458 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #64720 (SegFault on zend_deactivate)

Conflicts:
	NEWS
2013-05-21 10:15:37 +04:00
Dmitry Stogov
77fffff157 Fixed bug #64720 (SegFault on zend_deactivate) 2013-05-21 09:58:11 +04:00
Stanislav Malyshev
ac0aa5737e Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix bug #64660 - yyparse can return 2, not only 1

Conflicts:
	Zend/zend_language_scanner.c
2013-05-20 00:57:34 -07:00
Stanislav Malyshev
fb58e69a84 fix bug #64660 - yyparse can return 2, not only 1 2013-05-20 00:52:38 -07:00
Sara Golemon
2d7415a4af Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Don't double-quote name of namespaced function.
2013-05-19 13:34:57 -07:00
Sara Golemon
2d5695cbc5 Don't double-quote name of namespaced function.
ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info)

was resulting in a function declaration of:

ns\"zend_name"()

including the errant quotes.

This diff corrects that.  There are currently no uses of ZEND_NS_NAMED_FE
in core and reason to believe that there are no uses in the wild either.
2013-05-19 13:32:17 -07:00
Anatol Belski
2d8ce75f39 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  updated NEWS
  Fixed bug #64821 Custom Exceptions crash when internal properties overridden
2013-05-12 14:09:16 +02:00
Anatol Belski
dd188e9538 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #64821 Custom Exceptions crash when internal properties overridden
2013-05-12 14:06:59 +02:00
Anatol Belski
d6505acbf5 Fixed bug #64821 Custom Exceptions crash when internal properties overridden
If user inherits Exception and overrides the properties to arbitrary data types,
or simply doesn't run parent::__construct(), here we go. Just convert everything
to the appropriate data type, like Exception::__toString() does.
2013-05-12 14:00:32 +02:00
Ard Biesheuvel
5b121eb04d Fix #64780 (PHP 5.5 builds are broken with GCC 3)
A recent change (by me) introduced a call to __builtin_offsetof()
into zend_operators.h which is not defined by GCC prior to
version 4.

Changed the code to use offsetof() instead: this is defined in
<stddef.h>, so #include this header conditionally (#ifdef GNUC)
2013-05-07 20:37:04 +02:00
Xinchen Hui
9155d17fef Fix #64749 (warning: cast from pointer to integer of different size) 2013-05-04 20:43:42 +08:00
Gustavo Lopes
865cc3a800 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #64729: compilation failure on x32

Conflicts:
	Zend/zend_alloc.c
2013-04-30 19:36:08 +02:00
Gustavo Lopes
514afd67b6 Fix bug #64729: compilation failure on x32 2013-04-30 19:28:24 +02:00
David Soria Parra
3411fbbc51 Fix implicit uint* to int* conversion warning 2013-04-26 10:57:55 +02:00
Anatol Belski
30802dbc55 Fixed float precision change under Windows x64
otherwise we'll have asserts in debug builds and void runs of the
error handlers in non debug builds.
2013-04-25 22:44:29 +02:00
Dmitry Stogov
758b666c0a Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed incorrect check. SEND_REF may be executed before DO_FCALL when EX(function_state).function is not yet set to the calling function.

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-04-23 23:59:00 +04:00
Dmitry Stogov
43ab915b41 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed incorrect check. SEND_REF may be executed before DO_FCALL when EX(function_state).function is not yet set to the calling function.

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-04-23 23:55:47 +04:00
Dmitry Stogov
4cf0647399 Fixed incorrect check. SEND_REF may be executed before DO_FCALL when EX(function_state).function is not yet set to the calling function. 2013-04-23 23:43:23 +04:00
Dmitry Stogov
13b039ff9a Fixed linkage with C++ 2013-04-22 15:39:50 +04:00
Xinchen Hui
6ed16753c1 Fixed bug #64677 (execution operator `` stealing surrounding arguments) 2013-04-20 15:23:49 +08:00
Xinchen Hui
a5cfe57e08 Merge branch 'PHP-5.4' into PHP-5.5 2013-04-11 14:29:09 +08:00
Xinchen Hui
ba292b037f Fixed bug (Wrong ce cached) 2013-04-11 14:28:42 +08:00
Michael Moravec
70668fd88a Fixed typo - inconsistent notice for undefined property (introduced by fix for #49348) 2013-04-10 13:36:47 +08:00
Xinchen Hui
5c4d9123fa Drop support for bison < 2.4 when building PHP from GIT source 2013-04-05 21:35:09 +08:00
Xinchen Hui
aac43c9ee8 Merge branch 'PHP-5.4' into PHP-5.5 2013-04-04 14:56:00 +08:00
Xinchen Hui
4f2acd8cde Update test script to make sure the error occurred 2013-04-04 14:55:17 +08:00
Xinchen Hui
65e368debd Merge branch 'PHP-5.4' into PHP-5.5 2013-04-04 14:48:53 +08:00
Xinchen Hui
82ac3106e0 Use 5.4 specifical warnnig & Update NEWs 2013-04-04 14:47:49 +08:00
Xinchen Hui
f4f8b5a94b Merge branch 'PHP-5.3' into PHP-5.4 2013-04-04 14:44:28 +08:00
Xinchen Hui
c96a5bc6be Fixed bug #64578 (debug_backtrace in set_error_handler corrupts zend heap: segfault) 2013-04-04 14:34:11 +08:00
Xinchen Hui
db3d629f05 Merge branch 'PHP-5.3' into PHP-5.4 2013-04-04 13:40:46 +08:00
Xinchen Hui
7fc8077e4c Fixed Bug #64578 2013-04-04 13:40:21 +08:00
Nikita Popov
1f34ccbe34 Fix bug #64555: foreach no longer copies keys if they are interned 2013-04-03 20:29:19 +02:00
Xinchen Hui
42f94aa978 Fix test due to opcache 2013-04-03 19:52:09 +08:00
Xinchen Hui
bbb4a44f98 Merge branch 'PHP-5.4' into PHP-5.5 2013-04-03 18:51:19 +08:00
ptarjan
e8d80b770b Fix #64572: Clean up after the test
Lets not leave stuff lying around.
2013-04-03 18:50:18 +08:00
Nikita Popov
8345abcabb Remove support for cloning generators 2013-03-29 11:42:10 +01:00
Dmitry Stogov
aa791a4d72 Removed deprecated check 2013-03-29 03:18:04 +04:00
Lars Strojny
25b3c94944 Added XOR support for expressions in INI parser: NEWS and zend_language_scanner.c 2013-03-27 21:30:56 +01:00
Dejan Marjanovic
05016b7e96 Added XOR support for expressions in INI parser 2013-03-27 21:28:53 +01:00
Dmitry Stogov
6e8aa09696 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #64529 (Ran out of opcode space)

Conflicts:
	NEWS
	Zend/zend_execute_API.c
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner_defs.h
2013-03-28 00:08:11 +04:00
Dmitry Stogov
85e5e60777 Fixed bug #64529 (Ran out of opcode space) 2013-03-28 00:03:40 +04:00
Xinchen Hui
ed31582301 Fixed bug #64515 (Memoryleak when using the same variablename 2times in function declaration) 2013-03-26 12:02:48 +08:00
Xinchen Hui
1182a3356c Update test script 2013-03-26 11:50:47 +08:00
Xinchen Hui
5e9377ebd5 Fixed bug #64515 (Memoryleak when using the same variablename 2times in function declaration) 2013-03-26 11:44:57 +08:00
Xinchen Hui
975d26667b Fixed bug #64503 (Compilation fails with error: conflicting types for 'zendparse'). 2013-03-25 23:48:21 +08:00
Dmitry Stogov
96e5f5eb05 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #63914 (zend_do_fcall_common_helper_SPEC does not handle exceptions properly). (Jeff Welch)

Conflicts:
	NEWS
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-03-25 15:47:45 +04:00
Dmitry Stogov
e9f996c00d Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #63914 (zend_do_fcall_common_helper_SPEC does not handle exceptions properly). (Jeff Welch)

Conflicts:
	NEWS
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-03-25 15:23:49 +04:00
Dmitry Stogov
c4686b4de9 Fixed bug #63914 (zend_do_fcall_common_helper_SPEC does not handle exceptions properly). (Jeff Welch) 2013-03-25 15:07:27 +04: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
Dmitry Stogov
960d5be528 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Partial fix for bug #64239
2013-03-19 15:47:43 +04:00
Dmitry Stogov
984561cfa8 Partial fix for bug #64239 2013-03-19 15:45:48 +04:00
Dmitry Stogov
74e11fb14c Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #62343 (Show class_alias In get_declared_classes())

Conflicts:
	NEWS
2013-03-19 15:00:24 +04:00
Dmitry Stogov
84630a1109 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #62343 (Show class_alias In get_declared_classes())
2013-03-19 14:59:08 +04:00
Dmitry Stogov
4a6291508d Fixed bug #62343 (Show class_alias In get_declared_classes()) 2013-03-19 14:56:53 +04:00
Dmitry Stogov
ef8c8eaa95 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #64417 (ArrayAccess::&offsetGet() in a trait causes fatal error)

Conflicts:
	NEWS
	Zend/zend_compile.c
2013-03-19 13:07:32 +04:00
Dmitry Stogov
e62bb03257 Fixed bug #64417 (ArrayAccess::&offsetGet() in a trait causes fatal error) 2013-03-19 12:48:23 +04:00
Dmitry Stogov
e9641141aa Made test compatible with O+ 2013-03-16 16:11:00 +04:00
Nikita Popov
b7788c52f1 Fix wrong macro usage and add missing NEWS entry 2013-03-15 13:48:33 +01:00
Dmitry Stogov
dd1c358d1b Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:php-src:
  fix the fix
  fix for bug  #63530 	mysqlnd_stmt::bind_one_parameter uses wrong alloc for stmt->param_bind
  Forgot to remove some now unused variables
  Add support for non-scalar Iterator keys in foreach
  fixed headers order
  - Updated to version 2013.2 (2013b)
  fixed the test
  Fixed bug #64370 (microtime(true) less than $_SERVER['REQUEST_TIME_FLOAT'])
  Disable zend_always_inline in debug build
2013-03-14 14:19:41 +04:00
Dmitry Stogov
d77c865aff Removed redundand code 2013-03-13 17:51:10 +04: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
Xinchen Hui
4573405c5d Merge branch 'PHP-5.4' into PHP-5.5 2013-03-11 15:16:47 +08:00
Xinchen Hui
0444708c5c Disable zend_always_inline in debug build
it will be much more easier for debuging
2013-03-11 15:15:22 +08:00
Nikita Popov
9490118fdb Fix tests after laruence unserialize change 2013-03-09 20:21:33 +01:00
Xinchen Hui
1be745ce1b Merge branch 'PHP-5.4' into PHP-5.5
Conflicts:
	ext/standard/var_unserializer.c
2013-03-09 23:10:48 +08:00
Xinchen Hui
7197f0ffcc Fixed confused exception message while user threw exception 2013-03-09 23:08:14 +08:00
Xinchen Hui
01049ca7ae Fixed bug #61025 (__invoke() visibility not honored) 2013-03-08 10:34:17 +08:00
Gustavo Lopes
a86fcfbc1d Fix rounding of zend_dval_to_lval
Now rounding is always towards zero; the rounding can be though as if
occurring on the original double. Only relevant for the 32-bit long
variant.
2013-02-23 16:55:50 +00:00
Gustavo Lopes
77566edbaf Fix zend_dval_to_lval outside 64bit integers range
PHP should preserve the least significant bits when casting from double
to long. Zend.m4 contains this:

AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])

If ZEND_DVAL_TO_LVAL_CAST_OK is not defined, zend_operators.h had an
inline implementation of zend_dval_to_lval() that would do a cast to an
int64_t (when sizeof(long) == 4), then a cast to unsigned long and
finally the cast to long.

While this works well for doubles inside the range of values of the type
used in the first cast (int64_t in the 32-bit version and unsigned long
in the 64-bit version), if outside the range, it is undefined behavior
that WILL give varying and not particularly useful results.

This commit uses fmod() to first put the double in a range that can
safely be cast to unsigned long and then casts this unsigned long to
long. This last cast is implementation defined, but it's very likely
that this gives the expected result (i.e. the internal 2's complement
representation is unchanged) on all platforms that PHP supports. In any
case, the previous implementationa already had this assumption.

This alternative code path is indeed significantly slower than simply
casting the double (almost an order of magnitude), but that should not
matter because casting doubles with a very high absolute value is a
rare event.
2013-02-23 17:23:49 +01:00
Xinchen Hui
f39d12c821 Merge branch 'PHP-5.4' into PHP-5.5 2013-02-21 18:20:48 +08:00
Xinchen Hui
9a44a9806c Fixed bug #64235 (Insteadof not work for class method in 5.4.11)
As we discussed with stefan, we think previous of allowing use with
classes is a bug, should be forbided, anyway, the error message should
be improved.
2013-02-21 18:18:41 +08:00
Stanislav Malyshev
d39554ac08 Merge branch 'bug49348' into PHP-5.5
* bug49348:
  fix tests
  fix bug #49348 - issue notice on get_property_ptr_ptr when used for read
2013-02-21 00:52:46 -08:00
Stanislav Malyshev
dc6f073ce9 fix tests 2013-02-18 23:01:42 -08:00
Stanislav Malyshev
0c6d903ce7 fix bug #49348 - issue notice on get_property_ptr_ptr when used for read 2013-02-18 20:56:02 -08:00
Dmitry Stogov
d77eb411ea Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #64070 (Inheritance with Traits failed with error)

Conflicts:
	NEWS
	Zend/zend_compile.c
2013-02-18 16:20:49 +04:00
Dmitry Stogov
42437dd870 Fixed bug #64070 (Inheritance with Traits failed with error) 2013-02-18 16:07:51 +04:00
Xinchen Hui
75742d57eb Exceptions triggered by undefined variable should be handled before FATAL error
this is a enhancement of the fix for bug #64135
2013-02-16 22:22:22 +08:00
Ard Biesheuvel
65fa9f2c4b Merge branch 'PHP-5.4' into PHP-5.5 2013-02-13 13:50:53 +01:00
Ard Biesheuvel
050aae2860 Fixed bug #64197 (_Offsetof() macro used but not defined on ARM/Clang)
Updated the code to test for __ARMCC_VERSION instead of __arm, as
that is a more reliable indicator of whether the ARMCC compiler is
being used.
2013-02-13 12:22:50 +01:00
Ard Biesheuvel
e2453276e9 Low-level ARM optimizations
- added ARM versions of zend_mm_high_bit()/zend_mm_low_bit()
- improved safe_address()
2013-02-11 14:36:58 +01:00
Ard Biesheuvel
aa12cdc361 Improve x86 inline assembler
- added cc annotation to inline asm that clobbers the condition
  flags
- remove hardcoded constants (IS_LONG,IS_DOUBLE)
- remove hardcoded offsets (zval->value, zval->type)
2013-02-11 13:53:27 +01:00
Remi Collet
dc47ec0490 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #64142 (dval to lval different behavior on ppc64)
2013-02-11 09:13:27 +01:00
Remi Collet
e67a2b9e47 Fixed bug #64142 (dval to lval different behavior on ppc64)
See discussion on internals
http://marc.info/?t=136042277700003&r=1&w=2
2013-02-11 09:10:51 +01:00
Xinchen Hui
7948eea6f9 Forgot test script 2013-02-07 23:49:35 +08:00
Xinchen Hui
290509755a Fixed bug #64135 (Exceptions from set_error_handler are not always propagated) 2013-02-07 23:44:46 +08:00
Remi Collet
7b75a941ef Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  revert
2013-02-05 12:29:01 +01:00
Remi Collet
e7ce002c01 revert 2013-02-05 12:28:47 +01:00
Remi Collet
79956330fe Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #64142 (dval to lval different behavior on ppc64)
2013-02-04 15:27:07 +01:00
Remi Collet
6533094d9e Fixed bug #64142 (dval to lval different behavior on ppc64)
On x86_64:
(long)(double)9223372036854775807+1 = -9223372036854775808
On ppc64
(long)(double)9223372036854775807-1 = 9223372036854775807
2013-02-04 15:19:32 +01:00
Nikita Popov
114245c1b9 Fix bug #63830: Segfault on undefined function call in nested generator
This also reverses the destruction order of the pushed arguments to
align with how it is done everywhere else.

I'm not exactly sure whether this is the right way to fix it, but it
seems to work fine.
2013-02-01 19:53:04 +01:00
Nikita Popov
3ee20e450f Fix segfault when cloning generator with properties
Rule of thumb: Always implement the object clone handler rather
than the object storage clone handler. Actually I think we should
drop the latter. It's nearly never usable.
2013-02-01 18:33:26 +01:00
Nikita Popov
8b972efe5f Fix potential segfault when finally in a generator is run during shutdown
If a generator is destroyed in a finally block it will resume the generator to run that finally
block before freeing the generator. This was done in the object storage free handler.

Running user code in the free handler isn't safe though because the free handlers may be run
during request shutdown, already after several key components have been shut down.

This is avoided by doing the finally handling in the dtor handler. These handlers are run at the
start of the shutdown sequence.
2013-01-30 23:52:02 +01:00
Jelle Zijlstra
86b3643807 Fix build problem in C++11 2013-01-30 19:08:24 +01:00
Jelle Zijlstra
31468401b7 Fix build problem in C++11 2013-01-30 19:07:52 +01:00
Johannes Schlüter
78d3e66f3a Merge branch 'PHP-5.4' into PHP-5.5 2013-01-29 19:50:14 +01:00
Johannes Schlüter
1433854681 Merge branch 'PHP-5.3' into PHP-5.4 2013-01-29 19:49:43 +01:00
Johannes Schlüter
ec53b60072 Merge branch 'PHP-5.3' of git.php.net:/php-src into PHP-5.3 2013-01-29 19:49:13 +01:00
Johannes Schlüter
93fd9c704b Fix bug #64099 (Wrong TSRM usage in zend_register_class_alias) 2013-01-29 19:47:45 +01:00
Stanislav Malyshev
184db665eb fix bug #60833 - self, parent, static behave inconsistently case-sensitive 2013-01-27 18:02:51 -08:00
Gustavo Lopes
fc7b054c2d Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #64023 (__toString() & SplFileInfo)
2013-01-23 13:24:50 +01:00
Gustavo Lopes
b8b3bb08b2 Merge branch 'bug64023' into PHP-5.4
* bug64023:
  Fix bug #64023 (__toString() & SplFileInfo)

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

Using echo() directly would actually use __toString(), but this was a
bug: the ECHO handler would try zend_std_cast_object_tostring() before
cast_object(), but cast_object() should have priority as
zend_std_cast_object_tostring() assumes an object with a
zend_class_entry.
2013-01-22 11:33:29 +01:00
Felipe Pena
e23fca8910 - Fixed ZTS build 2013-01-18 22:15:08 -02:00
Lars Strojny
087a188702 Merge branch 'PHP-5.5' of git://github.com/php/php-src into PHP-5.5 2013-01-19 01:06:13 +01:00
Lars Strojny
8991ed016f Class Name Resolution As Scalar Via "class" Keyword 2013-01-19 01:00:47 +01:00
Stanislav Malyshev
cd619b47f3 Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:php-src:
  Fixed bug #63988 (Two Date tests fail) only for PHP-5.5
  - Fixed ZTS build
  Dereferencing process-handles no longer waits on those processes.
  revert change. now it doesn't compile again...someone should fix ext/date...
  Use two dtors thus allow allocation based on the alloc model of the connection.
  plug a leak - forgot ot use the dtor already written
  Revert "Apply the fputcsv test fix to SplFileObject_fputcsv.phpt. Mea culpa."
  Revert "Update fputcsv() to escape all characters equally."
  Add support for connect attributes, as of MySQL 5.6
  Bug #62489: dba_insert not working as expected
  UPGRADING.INTERNALS: document zend_qsort_r
  Add zend_qsort_r & use it in strtr
  NEWS for bug #63893
  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-18 13:42:19 -08:00
Stanislav Malyshev
deeacc7106 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix bug #63462 (Magic methods called twice for unset protected properties)
  NEWS for bug #64011. See 77ee200
  Fix bug #64011 (get_html_translation_table())
  Fix News
  Update the arguments in the prototype of fpm_socket_unix_test_connect().
  fixed build
  NEWS for bug #63893
  Fixed inconsequential bug in strtr()
  Revert "Apply the fputcsv test fix to SplFileObject_fputcsv.phpt. Mea culpa."
  Revert "Update fputcsv() to escape all characters equally."
  Remove _GNU_SOURCE, add local heap sort
  The compiler can figure this out
  Remove unused block
  strtr() with 2nd param array - optimization
  Refactoring, bugs & leaks
  Optimize strtr w/ 2nd arg array
2013-01-18 13:42:04 -08:00
Stanislav Malyshev
9e7c2e5906 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  fix bug #63462 (Magic methods called twice for unset protected properties)
2013-01-18 13:35:09 -08:00
Stanislav Malyshev
33b104c778 fix bug #63462 (Magic methods called twice for unset protected properties) 2013-01-18 13:29:43 -08: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
1bd193ed36 Merge remote-tracking branch 'remotes/cataphract/strtr_wu94_55' into PHP-5.5
* remotes/cataphract/strtr_wu94_55:
  Fixed inconsequential bug in strtr()
  UPGRADING.INTERNALS: document zend_qsort_r
  Add zend_qsort_r & use it in strtr
  NEWS for bug #63893
  Remove _GNU_SOURCE, add local heap sort
  The compiler can figure this out
  Remove unused block
  strtr() with 2nd param array - optimization
  Refactoring, bugs & leaks
  Optimize strtr w/ 2nd arg array
2013-01-15 21:45:22 +01:00
Adam Harvey
be1700d467 Fix compile failure introduced by the fix for bug #46408. 2013-01-15 10:08:26 +08:00
Lars Strojny
92965b033a Bug #46408: Fix double formatting for PostgreSQL bound parameters 2013-01-14 21:23:52 +01:00
Gustavo Lopes
22390d3393 Add zend_qsort_r & use it in strtr 2013-01-14 17:24:16 +01:00
Xinchen Hui
be07f815f2 Use zend_unmangle_property_name_ex to save strlen 2013-01-14 17:08:21 +08:00
Xinchen Hui
62059c16ee Fixed bug #63980 (object members get trimmed by zero bytes) 2013-01-14 16:23:22 +08:00
Stanislav Malyshev
30fd25bb49 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix bug #63982: isset() inconsistently produces a fatal error on protected property
  different OSes have different messages, and that's not what the test is about anyway
2013-01-13 17:27:05 -08:00
Stanislav Malyshev
1a96fe0b32 fix bug #63982: isset() inconsistently produces a fatal error on protected property 2013-01-13 17:08:52 -08:00
Stanislav Malyshev
c6203da6c2 different OSes have different messages, and that's not what the test is about anyway 2013-01-13 16:58:27 -08:00
Gustavo Lopes
07590e6e45 Export zend_parse_parameter() 2013-01-09 17:00:04 +01:00
Dmitry Stogov
c3ebd6305e Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed compilator bug that might cause jump depended on unitialized value
2013-01-09 17:52:48 +04:00
Dmitry Stogov
625000ab44 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed compilator bug that might cause jump depended on unitialized value
2013-01-09 17:36:44 +04:00
Dmitry Stogov
d4650c5d69 Fixed compilator bug that might cause jump depended on unitialized value 2013-01-09 17:16:47 +04:00
Dmitry Stogov
326f896739 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #63882 (zend_std_compare_objects crash on recursion)

Conflicts:
	NEWS
2013-01-09 11:32:40 +04:00
Dmitry Stogov
f9e8678dd3 Fixed bug #63882 (zend_std_compare_objects crash on recursion) 2013-01-09 11:30:50 +04:00
Xinchen Hui
c4f2a20f15 Merge branch 'PHP-5.4' into PHP-5.5 2013-01-04 11:05:53 +08:00
Xinchen Hui
aff5d084a5 Merge branch 'PHP-5.3' into PHP-5.4 2013-01-04 11:03:52 +08:00
Xinchen Hui
c3e6de2227 Fixed bug #63899 (Use after scope error in zend_compile) 2013-01-04 11:02:21 +08:00
Stanislav Malyshev
80a9a80a52 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Bug #43177: If an eval() has a parse error, the overall exit status and return code should not be affected.
  fix NEWS

Conflicts:
	main/main.c
2013-01-01 21:20:35 -08:00
Stanislav Malyshev
36e19c9cab Bug #43177: If an eval() has a parse error, the overall exit status and return code should not be affected.
Without this fix, a webpage using eval() may return code 500.  That might display
fine and the 500 go unnoticed, but using AJAX or wget, the 500 will cause problems.
2013-01-01 21:18:59 -08: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
831fbcf385 Happy New Year 2013-01-01 16:23:31 +08:00
Pierrick Charron
8228597ecc Fixed bug #63874 (Segfaul if php_strip_whitespace has heredoc)
T_END_HEREDOC don't carry a token value anymore since commit 4cf90e06c
Bugfix by Nikita for bug #60097
2012-12-29 23:11:37 -05:00
Pierrick Charron
663434cd76 Merge branch 'PHP-5.3' into PHP-5.4 2012-12-26 10:17:37 -05:00
Pierrick Charron
b35ffdeae1 Revert "Remove a useless memory write in zend_llist_del_element"
This reverts commit fad960a404 as
required by Stas and Christopher
2012-12-26 10:13:56 -05:00
Pierrick Charron
5a97c30efe Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Remove a useless memory write in zend_llist_del_element
2012-12-25 20:59:20 -05:00
Pierrick Charron
c12ab5c306 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Remove a useless memory write in zend_llist_del_element
2012-12-25 20:57:21 -05:00
Pierrick Charron
fad960a404 Remove a useless memory write in zend_llist_del_element
The zend_llist_element *next pointer is not necessary and removing
it will also remove a write on memory
2012-12-25 20:45:24 -05:00
Dmitry Stogov
8e6bf9e5e5 spelling 2012-12-25 16:23:52 +04:00
Dmitry Stogov
7625a3b3b4 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  spelling
2012-12-25 16:22:07 +04:00
Dmitry Stogov
7e2629635b spelling 2012-12-25 16:21:25 +04:00
Dmitry Stogov
016f3c8610 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed ZTS build
2012-12-25 13:39:02 +04:00
Dmitry Stogov
f0b459b7c4 Fixed ZTS build 2012-12-25 13:38:14 +04:00
Dmitry Stogov
bc0425c025 Removed deprecated fields 2012-12-25 10:47:43 +04:00
Dmitry Stogov
b8c719c068 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Traits refactoring
2012-12-25 10:33:01 +04:00
Dmitry Stogov
3f8c729e69 Traits refactoring 2012-12-25 10:23:08 +04:00
Nikita Popov
be7b0bc3ec Implement Generator::throw() method
Generator::throw($exception) throws an exception into the generator. The
exception is thrown at the current point of suspension within the generator.
It basically behaves as if the current yield statement were replaced with
a throw statement and the generator subsequently resumed.
2012-12-24 00:27:55 +01:00
Nikita Popov
14f133036c Fix crash when last yielded value is a closure
If zend_generator_close is called from within zend_generator_resume (e.g.
due to a return statement) then all the EGs will still be using the values
from the generator. That's why the stack frame has to be the last thing
that is dtored, otherwise some other dtor that is using
EG(current_execute_data) might access the already freed memory segment.
This was the case with the closure dtor.

The fix is to move the dtors for key and value to the start of the handler.
This way the stack frame is the last thing that is freed.
2012-12-21 17:28:20 +01:00
Nikita Popov
ffb848b275 Fix bug #63822: Crash when using closures with ArrayAccess
op_array->T was used after the closure's op_array was already freed. This just
swaps the freeing order.
2012-12-21 01:56:37 +01:00
Nikita Popov
3e78c6ad25 Do not add a ref to EX(object) on generator clone
If a ref has to be added it will be already added while walking the call
slots.
2012-12-20 20:33:18 +01:00
Nikita Popov
2768315856 Add missing zend_do_free call
This is a followup to d53f1bf8ab. When the yield *statement* is used its
return value still needs to be freed.
2012-12-19 15:21:34 +01:00
Nikita Popov
d53f1bf8ab Fix leak when generator ignores sent value
When the return value of yield wasn't used it was leaked.

This is fixed by using a TMP_VAR return value instead of VAR. TMP_VARs are
automatically freed when they aren't used.
2012-12-18 21:39:02 +01:00
Xinchen Hui
a73a6be764 Fix warning of no return in non-void function 2012-12-14 17:26:42 +08:00
Xinchen Hui
9fb5cfdeb1 Fixed warning of no return in non-void funciton 2012-12-14 17:21:43 +08:00
Xinchen Hui
359d91a807 Add test for bug #63741 2012-12-14 16:52:56 +08:00
Dmitry Stogov
e65b966aac Fixed uninitialized EX(call)->called_scope 2012-12-14 12:10:29 +04:00
Johannes Schlüter
2098cc7e9d Merge branch 'PHP-5.4' into PHP-5.5 2012-12-13 22:45:47 +01:00
Johannes Schlüter
ef37055c34 Merge branch 'PHP-5.3' into PHP-5.4 2012-12-13 22:40:23 +01:00
Johannes Schlüter
a11606b18f Fix Bug #63762 Sigsegv when Exception::$trace is changed by user 2012-12-13 22:39:35 +01:00
Dmitry Stogov
d5c2da5756 Removed unreachable code 2012-12-13 17:51:04 +04:00
Dmitry Stogov
438cd86378 Removed unnecessary checks 2012-12-13 17:29:30 +04:00
Dmitry Stogov
ff1e1d7a8e Removed redundand checks from release build 2012-12-13 14:46:44 +04:00
Dmitry Stogov
6b0b4bf8eb An exception thrown in try or catch block is disacarded by return statement in finally block. 2012-12-13 02:48:51 +04:00
Dmitry Stogov
9c96fe52d9 Restored proper generators behaviour in conjunction with "finally". (Nikita) 2012-12-12 17:47:55 +04:00