Commit Graph

8185 Commits

Author SHA1 Message Date
Anatol Belski
65fce7f950 Fixed bug #55541 errors spawn MessageBox, which blocks test automation
With that, also fixed bug #68297 (Application Popup provides too few
information) as a better error message is provided to the event log.

In the second case, the condition for display_startup_error was removed. The
condition was added as a fix for bug #30760 which was preventing the
MessageBox to appear. When display_startup_error=on, the error will be seen
on the console. But when running under a webserver it'll probably get lost,
so we need to log it other way into the event log (would be done automatically
when message box was used, but that would eventually cause issues of blocked
execution).

Generally speaking - any MessageBox or other graphical element is a potential
issue and that was repeatedly reported. Graphical elements shouldn't be used
in the core. Even being a rare one it can cause a bad situation where the
server is blocked. Yet some places have to cleaned up.
2014-12-03 16:33:05 +01:00
Julien Pauli
b248a7a95c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
  Fix #65419 - Inside trait, self::class != __CLASS__
2014-11-28 13:26:53 +01:00
Julien Pauli
7c77ca38b1 Fix #65419 - Inside trait, self::class != __CLASS__ 2014-11-28 13:24:25 +01:00
Ferenc Kovacs
543ad4b2d3 #68446 is fixed 2014-11-26 23:12:49 +01:00
Anatol Belski
4576b4d58a fix dir separator in test 2014-11-25 18:16:26 +01:00
Anatol Belski
2c8aee0bb8 fix TS build 2014-11-25 17:56:28 +01:00
Dmitry Stogov
e116595e63 Better fix for bug #68446 2014-11-25 18:09:08 +03:00
Bob Weinand
0ca47ba8d8 Revert NEWS and set test to XFAIL 2014-11-25 12:27:17 +01:00
Bob Weinand
aba95c2399 Revert "Fix bug #68446 (bug with constant defaults and type hints)"
This reverts commit 5ef138b0c7.
2014-11-25 12:24:29 +01:00
Stanislav Malyshev
faee48506d Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  Update the VM generation script, per Bob.
  Update NEWS after rebase.
  Add BEGIN_EXTERN_C() and END_EXTERN_C() to .h files missing them.
2014-11-23 16:18:52 -08:00
Stanislav Malyshev
9ef264504d Merge branch 'pull-request/840' into PHP-5.5
* pull-request/840:
  Update the VM generation script, per Bob.
  Update NEWS after rebase.
  Add BEGIN_EXTERN_C() and END_EXTERN_C() to .h files missing them.
2014-11-23 16:17:17 -08:00
Bob Weinand
dd70a2c7ae Added NEWS entry and test for bug 68446 2014-11-24 00:08:45 +01:00
Bob Weinand
5ef138b0c7 Fix bug #68446 (bug with constant defaults and type hints) 2014-11-23 21:10:41 +01:00
Julien Pauli
ab3525c401 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix #68185 - Inconsistent insteadof definition

Conflicts:
	Zend/zend_compile.c
2014-11-21 15:50:27 +01:00
Julien Pauli
cd3b46f28a Fix #68185 - Inconsistent insteadof definition 2014-11-21 15:37:33 +01:00
Anatol Belski
873a460c7c fix incompatible pointer types 2014-11-17 09:33:58 +01:00
Anatol Belski
1504e9c9df fix incompatible pointer types 2014-11-17 09:33:37 +01:00
Xinchen Hui
7d69fa7179 Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into PHP-5.5 2014-11-10 13:52:07 +08:00
Xinchen Hui
b9e44888c0 Merge branch 'PHP-5.5' into PHP-5.6 2014-11-10 13:47:14 +08:00
Xinchen Hui
ab84939254 Fixed bug #68370 ("unset($this)" can make the program crash) 2014-11-10 13:46:47 +08:00
Dmitry Stogov
e120438c8c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Partial fix for bug #68365 (zend_mm_heap corrupted after memory overflow in zend_hash_copy)
  Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving)
2014-11-07 09:54:05 +03:00
Dmitry Stogov
ed4c0245c7 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Partial fix for bug #68365 (zend_mm_heap corrupted after memory overflow in zend_hash_copy)
2014-11-07 09:48:26 +03:00
Dmitry Stogov
9dfa843a38 Partial fix for bug #68365 (zend_mm_heap corrupted after memory overflow in zend_hash_copy) 2014-11-07 09:46:49 +03:00
Adam Harvey
4bb836be20 Update the VM generation script, per Bob. 2014-10-31 10:10:49 -07:00
Adam Harvey
5b5f99ef18 Add BEGIN_EXTERN_C() and END_EXTERN_C() to .h files missing them. 2014-10-31 10:08:17 -07:00
Xinchen Hui
d9d181e5ad Fixed Bug #68104 (Segfault while pre-evaluating a disabled function) 2014-10-31 17:32:23 +08:00
Anatol Belski
c96a6b4493 DLL export several APIs needed for phpdbg 2014-10-12 19:22:03 +02:00
Nikita Popov
8617f2fa8d Merge branch 'PHP-5.5' into PHP-5.6 2014-10-03 21:27:07 +02:00
Nikita Popov
93288d0095 Fix bug #68188 2014-10-03 21:26:39 +02:00
Nikita Popov
308c0a727e Merge branch 'PHP-5.5' into PHP-5.6 2014-09-20 21:47:59 +02:00
Nikita Popov
5e977e69e1 Fixed bug #67633 2014-09-20 21:46:25 +02:00
Tjerk Meesters
7e9daf60c1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed #67985 - Incorrect last used array index copied to new array after unset
2014-09-09 18:03:10 +08:00
Tjerk Meesters
aca474fa14 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed #67985 - Incorrect last used array index copied to new array after unset
2014-09-09 18:00:49 +08:00
Tjerk Meesters
99f0760bfb Fixed #67985 - Incorrect last used array index copied to new array after unset
In master zend_array_dup() is used to do this properly; this is a workaround.
2014-09-09 17:58:45 +08:00
Stanislav Malyshev
57f82819e9 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
  Fix typo from commit 32314f6b6
  Fix destruction order in zend_shutdown (bug #65463, #66036)
2014-09-01 12:20:34 -07:00
Stanislav Malyshev
4b9fcc01d4 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  update NEWS
  Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
  Fix typo from commit 32314f6b6
  Fix destruction order in zend_shutdown (bug #65463, #66036)
2014-09-01 12:15:54 -07:00
Stanislav Malyshev
197095c29e Merge branch 'pull-request/770' into PHP-5.4
* pull-request/770:
  Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
  Fix typo from commit 32314f6b6
  Fix destruction order in zend_shutdown (bug #65463, #66036)
2014-09-01 12:11:42 -07:00
Tjerk Meesters
5270ee1aef Making ini parser typed
- Added ZEND_INI_SCANNER_TYPED mode for parse_ini_string() and parse_ini_file()
- Added NULL_NULL token to separate it from BOOL_FALSE and BOOL_TRUE
- Added zend_ini_copy_typed_value() function for zval initialisation
- Updated RETURN_TOKEN() to observe scanner_mode
2014-09-01 22:04:06 +08:00
Nikita Popov
d7368c2531 Fix bug #67938: Segfault when extending interface method with variadic
We only want to check extra optional args if the proto function is
variadic, not when we're adding extra variadic args.
2014-08-30 20:43:34 +02:00
Ferenc Kovacs
86b2d7b523 remove the -dev suffix from the Zend version 2014-08-27 03:52:46 +02:00
Keyur Govande
437612f656 Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036) 2014-08-23 14:17:37 +00:00
Keyur Govande
5e338836ff Fix typo from commit 32314f6b6 2014-08-14 01:14:11 +00:00
Keyur Govande
32314f6b67 Fix destruction order in zend_shutdown (bug #65463, #66036)
If Apache or a similar SAPI receives a signal during PHP processing
it calls zend_shutdown() without calling shutdown_executor().
	#65463: If a module like Gearman or Memcached is loaded,
in the unfixed version it is unloaded by zend_destroy_modules() before the
CG(CLASS_TABLE) is destructed. When CG(CLASS_TABLE) is destructed,
any pointers to methods (specifically around destruction) in the unloaded
module's .so are now dangling and the process segfaults.
	#66036: Any subclasses of an internal class like ArrayObject need
to be destructed in order: subclass first and then the internal class. In the
unfixed version zend_shutdown() clears the CG(CLASS_TABLE) from the head
of the list onwards, so internal classes are destructed first and user-defined
classes last. Internal classes are alloc/deallocated with malloc/free while
user-defined classes with emalloc/efree. If there's shared data between them
then efree() could be called instead of free() leading to a seg-fault.
2014-08-14 00:55:14 +00:00
Bob Weinand
d5ddd2dbb2 Disable restrictions regarding arrays in constants at run-time.
For the discussion around it, see the thread on the mailing list:
http://www.mail-archive.com/internals@lists.php.net/msg68245.html
2014-07-30 17:57:07 +02:00
Dmitry Stogov
ea1d5dcacb Removed second zval_copy_ctor() 2014-07-24 01:16:00 +04:00
Dmitry Stogov
d909b6330e Fixed crash on self-referencing constant expression (part of a constant AST) 2014-07-24 00:37:15 +04:00
Dmitry Stogov
c49a06168e Fixed support for constant arrays in context of "const" statement (Zend/tests/constant_expressions_arrays.phpt failed when opcache.protect_memort was set) 2014-07-23 22:47:58 +04:00
Xinchen Hui
1d2f232bd2 Merge branch 'PHP-5.5' into PHP-5.6 2014-07-19 17:19:39 +08:00
Xinchen Hui
8ff00e6e85 Improve fix for #66608 2014-07-19 17:19:01 +08:00
Xinchen Hui
9ce1a36af2 Fixed segfault with empty break 2014-07-19 15:30:50 +08:00
Xinchen Hui
9bef96d96e Merge branch 'PHP-5.5' into PHP-5.6 2014-07-19 13:12:36 +08:00
Xinchen Hui
f604b61e39 New added opcodes don't need to be resloved 2014-07-19 12:53:34 +08:00
Xinchen Hui
550b3e4306 Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2014-07-18 15:48:56 +08:00
Xinchen Hui
de433d4c47 Fixed bug #66608 (Incorrect behavior with nested "finally" blocks) 2014-07-18 15:45:31 +08:00
Stanislav Malyshev
c291033469 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Make sure the generator script also creates a newline at the end of file
  Add newline at end of file to prevent compilation warning
2014-07-06 22:15:35 -07:00
Lior Kaplan
716d2a3937 Make sure the generator script also creates a newline at the end of file
Similar to commit d6713f39 in master
2014-07-06 22:15:09 -07:00
Lior Kaplan
c5fec9e09d Add newline at end of file to prevent compilation warning
The newline was removed at commit 50d50c2f
2014-07-06 22:15:00 -07:00
Nikita Popov
1ea4b17af2 Merge branch 'PHP-5.5' into PHP-5.6 2014-07-02 17:36:27 +02:00
Nikita Popov
d9ebd0f3d6 Fix bug #67497: eval with parse error causes segfault in generator 2014-07-02 17:33:31 +02:00
Bob Weinand
1163a7ce24 Mark test as XFAIL until fixed 2014-07-02 17:25:47 +02:00
Bob Weinand
33699a4dab Messed up syntax of tests 2014-07-02 12:43:27 +02:00
Bob Weinand
09d1a8aaab Add tests for constant expression arrays
Adding one failing (!) test for now about circular constant references embedded in a constant AST, must be fixed before PHP 5.6 release.
2014-07-02 12:33:46 +02:00
Dmitry Stogov
2330be5641 Fixed possible crash because of race conditions on modifying constants in shared memory 2014-07-01 00:13:34 +04:00
Xinchen Hui
9d49492fd6 Fixed bug #67368 (Memory leak with immediately dereferenced array in class constant) 2014-06-24 13:53:05 +08:00
Ferenc Kovacs
53158f2c32 testcase for 67468 (only for debug build, as I could not create a stable segfault without loading other exts like pgsql) 2014-06-23 10:10:17 +02:00
Andreas Ferber
c5e6c2a5f5 Fix Bug #67468 Segfault in highlight_file()/highlight_string() when pgsql.so module is loaded
str_efree() must be used in zend_highlight() and zend_indent() to free
string data assigned to a zval to account for interned strings.
2014-06-23 09:51:44 +02:00
Bob Weinand
3c2b42ac41 Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	Zend/zend_compile.c
2014-06-16 11:18:45 +02:00
Bob Weinand
e93f8e74d4 Merge branch 'PHP-5.4' into PHP-5.5 2014-06-16 11:16:33 +02:00
Bob Weinand
0a3979e08b Fix patch for bug #67436 2014-06-16 11:10:50 +02:00
Bob Weinand
7cef3a57ad Merge branch 'PHP-5.5' into PHP-5.6 2014-06-16 00:42:50 +02:00
Bob Weinand
03ee0ddc5f Merge branch 'PHP-5.4' into PHP-5.5 2014-06-16 00:41:46 +02:00
Levi Morrison
6c9c44905e Added tests for bug 67436 2014-06-15 16:31:39 -06:00
Bob Weinand
f92143f740 Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	NEWS
	Zend/zend_compile.c
2014-06-15 23:06:15 +02:00
Bob Weinand
f5f1c702cd Merge branch 'PHP-5.4' into PHP-5.5 2014-06-15 22:24:44 +02:00
Bob Weinand
ca29063da5 Fix bug #67436 2014-06-15 22:18:25 +02:00
Xinchen Hui
ebe6854dbc Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	Zend/zend_execute_API.c
2014-06-10 21:58:16 +08:00
Xinchen Hui
e8699d75da Remove unused included file 2014-06-10 21:56:30 +08:00
Boro Sitnikovski
cfccdc6362 Bug 64744
Show the type of the non-object for more descriptive errors
2014-06-08 19:14:58 -07:00
Stanislav Malyshev
8f527fbf14 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug 666222
  Fix bug 666222
2014-06-08 19:02:24 -07:00
Levi Morrison
f47976dd9b Fix bug 666222
This also adds some smaller, isolated tests related to bug 66622.
2014-06-08 18:59:44 -07:00
Levi Morrison
e030efa4f6 Fix bug 666222
This also adds some smaller, isolated tests related to bug 66622.

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2014-06-08 18:59:23 -07:00
Stanislav Malyshev
19edbc9720 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed identation on file
  Fix align indentation
2014-06-08 15:54:32 -07:00
Stanislav Malyshev
38343856e1 Merge branch 'PHp-5.4' into PHP-5.5
* PHp-5.4:
  Fixed identation on file
  Fix align indentation
2014-06-08 15:53:26 -07:00
Jefersson Nathan
e51eaaf665 Fix align indentation 2014-06-08 14:28:51 -07:00
Nikita Popov
6d1885342c Fix bug #67392: dtrace breaks argument unpack 2014-06-06 17:09:49 +02:00
Xinchen Hui
666197b8cc Added folder mark 2014-05-24 21:11:13 +08:00
Bob Weinand
5bc4eb714a Merge branch 'PHP-5.4' into PHP-5.5 2014-05-11 15:15:27 +02:00
Bob Weinand
5bf6a093ad Fix Linux specific fail in error traces (cherry-picked and fix for bug #67245)
Linux apparently does not like memcpy in overlapping regions...
2014-05-11 15:11:03 +02:00
Anatol Belski
0d5121a3c7 fixed ZEND_DEBUG usage 2014-05-05 00:50:51 +02:00
Nikita Popov
69b5ee61d0 Fixed bug #67169: []= after_array_splice incorrect
This fixes a regression I introduced in beta 1.
2014-05-02 12:49:51 +02:00
Anatol Belski
cfd20c90a5 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  refixed the test related to bug #67072
  Improved the fix for bug #67072, thanks Nikita
2014-04-18 15:17:12 +02:00
Anatol Belski
d963cf94a5 refixed the test related to bug #67072 2014-04-18 15:16:09 +02:00
Stanislav Malyshev
ce4c78dd07 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed test case for 5328d42
2014-04-17 17:36:26 -07:00
Tjerk Meesters
5e988a888a Fixed test case for 5328d42 2014-04-17 17:36:03 -07:00
Ferenc Kovacs
20036525e2 Fix bug #66660: use str_efree instead of efree to handle interned empty strings correctly 2014-04-13 10:45:46 +02:00
Bob Weinand
096e40a027 Fixed tests for recent constant array changes 2014-04-11 20:13:24 +02:00
Bob Weinand
99d1a1bb3f Shut up, my lovely compiler; I do not like your warnings 2014-04-11 19:33:56 +02:00
Bob Weinand
35b895fdf0 Removed useless void* parameter and replaced with zend_bool on zval_update_constant* functions 2014-04-11 19:18:58 +02:00
Bob Weinand
ee2a7c7d41 Fixed disallowal of array usage in constants at run-time
Added at the same time the possibility of array dereferencing
to complete the set of features (useful application of arrays in constants)
2014-04-11 18:21:46 +02:00
Bob Weinand
ad05d3898e Updated zend_vm_execute.h 2014-04-11 16:18:42 +02:00
Bob Weinand
f614fc6898 Fix bug #66015 by reverting "Removed operations on constant arrays." 2014-04-11 10:08:44 +02:00
Nikita Popov
ad2ef3d97e Add only_integer_keys option to zend_hash_reindex
This allows to either do a full reindex, or only reindex the integer
keys.
2014-04-09 12:31:21 +02:00
Nikita Popov
22d3eb3117 Add zend_hash_splice
This implements the original functionality of php_splice, but
as an in-place operation, thus avoiding copying the HT.

This is much faster (~10x) if the splice removes a small portion
of the array and doesn't insert many elements.
2014-04-09 12:31:21 +02:00
Nikita Popov
1aa8719e32 Add zend_hash_reindex
The implementation differs from the original in array.c in that it
rehashes the hashtable in the same loop. This is approximately two
times faster (not counting the rare case of a purely associative
array).
2014-04-09 12:31:21 +02:00
Bob Weinand
0e273217cf Fix Linux specific fail in error traces
Linux apparently does not like memcpy in overlapping regions...
2014-04-07 17:14:38 +02:00
Anatol Belski
9d4001f1c8 fix C89 compat 2014-03-22 10:44:01 +01:00
Nikita Popov
f331ed1414 Revert "Add helper function for updating bucket contents"
Reverting this for now, because it would require further changes
thanks to the zend signals tsrms-but-only-sometimes awesomeness.
2014-03-21 01:32:49 +01:00
Nikita Popov
4e7e301dda Rename+move zend_hash_apply_deleter and reuse it
The interruption handling was normalized to wrap the entire deletion
operation (instead of leaving out the destructor call and/or the
deallocation) per the recommendation of somebody (don't remember who)
familiar with zend signals.

There is an always-inlined variant of the function for use in
the main deletion function, to ensure there is no performance
impact.
2014-03-21 00:14:52 +01:00
Nikita Popov
4efa58dd59 Make zend_hash_apply_deleter() void, to allow reuse
Also remove lies in the comment above the function. apply_deleter
is not safe against modification, if the modification involves
removing the next bucket.

Also modified the implementation of zend_hash_graceful_destroy()
to be fully graceful (the reverse variant already was).
2014-03-21 00:14:51 +01:00
Nikita Popov
c3a317117a Add helper function for updating bucket contents 2014-03-21 00:14:46 +01:00
Nikita Popov
994fcfcff9 Remove unnecessary check
In case of an update the key already existed, so the next free
element can not change.
2014-03-20 22:58:10 +01:00
Pierre Joye
eef2978afc Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  fix #66872, invalid argument crashes gmp_testbit
  fix #66872, invalid argument crashes gmp_testbit
  add vc12 (2013)

Conflicts:
	ext/gmp/gmp.c
2014-03-10 12:18:57 +01:00
Tjerk Meesters
3d1fa4cb17 Allow T_POW in constant expressions 2014-03-07 09:14:27 +08:00
Ferenc Kovacs
bfbdc032b6 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  typo spotted by Lajos Veres
2014-02-27 11:30:23 +01:00
Ferenc Kovacs
561843c973 typo spotted by Lajos Veres 2014-02-27 11:29:08 +01:00
Nikita Popov
95c73f99d3 Don't add num_additional_args in SEND opcodes
Now that trailing positional args are disallowed,
num_additional_args will always be zero in SEND opcodes (and
FUNC_ARG fetches).
2014-02-26 16:40:25 +01:00
Nikita Popov
d3b484df82 Disallow use of positional args after unpacking
This commit disallows the use of trailing positional arguments
after argument unpacking was used. The following calls are no
longer valid:

    fn(...$array, $var);
    fn(...$array1, $var, ...$array2);

However, all of the following continue to be valid:

    fn($var, ...$array);
    fn(...$array1, ...$array2);
    fn($var, ...$array1, ...$array2);

The reason behind this change is a stack allocation issue pointed
out by Dmitry: As of PHP 5.5 the stack necessary for pushing
arguments is precomputed and preallocated, as such the individual
SEND opcodes no longer verify that there is enough stack space.
The unpacked arguments will occupy some of that preallocated
space and as such following positional arguments could write past
a stack page boundary.

An alternative resolution for this issue is to ensure that there
is enough space for the remaining arguments in the UNPACK opcode.
However making this allocation precise (rather than using a
conversative over-estimate) would require some effort. Given that
this particular aspect of the feature wasn't very popular in the
first place, it doesn't seem worth the effort.
2014-02-26 16:40:25 +01:00
Nikita Popov
2eae187949 Store arg_num in fcall entry
Instead of storing the argument number in the znode of the parameter
list, store it in fcall->arg_num. This mainly cleans up the parameter
parsing code, which previously had to duplicate all rules (this
becomes more excessive as more features are added, e.g. named params
would already require a minimum of 14 rules...)
2014-02-26 16:40:25 +01:00
Nikita Popov
cefa7f8d08 Introduce zend_function_call_entry structure
Instead of directly pushing the zend_function* onto the
function_call_stack, push this structure. This allows us to store
additional data on this stack.
2014-02-26 16:40:25 +01:00
Johannes Schlüter
5c8a0c92d1 Merge branch 'PHP-5.5' into PHP-5.6 2014-02-23 14:57:21 +01:00
Johannes Schlüter
2198bbce86 Merge branch 'PHP-5.4' into PHP-5.5 2014-02-23 14:56:32 +01:00
Johannes Schlüter
3f258e6b46 Make sure value is initialized 2014-02-23 14:55:29 +01:00
Anatol Belski
5d0d88d1f2 fixed path separator in the tests 2014-02-21 00:23:01 +01:00
Sara Golemon
14c08ea362 Add more tests for __debugInfo() and fix leak 2014-02-20 12:10:00 -08:00
Bob Weinand
fe3c8de9d5 Merge branch 'PHP-5.5' into PHP-5.6 2014-02-20 17:49:45 +01:00
Bob Weinand
ca313caa4b Merge branch 'PHP-5.4' into PHP-5.5 2014-02-20 17:48:38 +01:00
Bob Weinand
afa03a470e Use nicer output for characters < 32 and > 126 in exception strings
Using question marks might confuse more than it helps.
Users are wondering what happened to their string...
2014-02-20 17:39:58 +01:00
Anatol Belski
47204c6341 some missing pieces for __debugInfo 2014-02-20 02:07:34 +01:00
Sara Golemon
1e752ce9c5 Add __debugInfo() magic method
class Foo {
  private $val = 'Random, meaningless data';

  public function count() { return 42; }

  public function __debugInfo() {
    return ['count' => $this->count()];
  }
}

$f = new Foo;
var_dump($f);
2014-02-17 19:33:56 -08:00
Bob Weinand
363ff60475 Fixed memory leak in pow operator 2014-02-06 21:31:40 +01:00
datibbaw
aff56f3c45 add T_POW (**) operator
Fixed recognition of the operator

Added opcode, still doing multiply instead of pow()

opcode now always returns int(42)

The right answer, but always a float

Yanked code from pow() implementation.

Should not handle negative long as exponent ourselves

Added test cases from pow()

Moved precedence higher than '~'

Added GMP operator overloading

Added ZEND_ASSIGN_POW (**=) operator.

Added pow() as a language construct.

Adjusted test cases for changed precedence.

Reduced pow() to shell function around ZEND_API pow_function()

Reduced test case to only contain edge cases
Added overloading test case

Moved unary minus above T_POW

Revert "Added pow() as a language construct."

Bad bad bad idea.

This reverts commit f60b98cf7a8371233d800a6faa286ddba4432d02.

Reverted unary minus behaviour due to previous revert.
Convert arrays to int(0)
Exponent with array as a base becomes int(0)

Rebase against master

Fixed tokenizer test case
2014-02-06 14:41:21 +01:00
Anatol Belski
07f3bac6ca fix *.dsp files related to bug #50333 2014-01-28 13:09:29 +01:00
Rouven Weßling
aee6344e24 Add ZEND_ARG_CALLABLE_INFO to allow internal function to type hint against callable. 2014-01-25 00:04:50 +01:00
Xinchen Hui
aba775fd34 Fixed warning "No new line at end of file" 2014-01-24 10:50:41 +08:00
Nikita Popov
31a2ac470c Fix argument unpacking across stack pages
If multiple unpacks were used (or mixed with normal arguments)
parts of the arguments could land on different stack pages. If
this occurs the arguments will now be copied to a new stack page.

The code used to do this is copied verbatim from the PHP 5.4 branch
and only modified to reduce the amount of inlined code.
2014-01-18 14:41:33 +01:00
Bob Weinand
69edad213a Fixed build (making zend_is_by_ref_func_arg_fetch function static) 2014-01-12 01:59:22 +01:00
Nikita Popov
2c47dfbaeb Implement argument unpacking
RFC: https://wiki.php.net/rfc/argument_unpacking
2014-01-11 12:42:08 +01:00
Nikita Popov
c7bb283338 Minor cleanup in zend_do_pass_param() 2014-01-11 12:40:16 +01:00
Anatol Belski
4e7c9ea896 Fixed bug #66009 Failed compilation of PHP extension with C++ std library using VS 2012
Visual Studio 2012 includes sanity checks for C++11 features, see
http://msdn.microsoft.com/en-us/library/vstudio/bb531344(v=vs.110).aspx
To fix the 'inline' keyword redefinition for C++ in debug mode, the
new macros ZEND_WIN32_KEEP_INLINE is introduced, ZEND_WIN32_FORCE_INLINE is
automatically appended in release mode.
2014-01-04 01:41:27 +01:00
Anatol Belski
ae1cc83f98 Fixed bug #66009 Failed compilation of PHP extension with C++ std library using VS 2012
Visual Studio 2012 includes sanity checks for C++11 features, see
http://msdn.microsoft.com/en-us/library/vstudio/bb531344(v=vs.110).aspx
To fix the 'inline' keyword redefinition for C++ in debug mode, the
new macros ZEND_WIN32_KEEP_INLINE is introduced, ZEND_WIN32_FORCE_INLINE is
automatically appended in release mode.
2014-01-04 01:41:01 +01:00
Nikita Popov
72a16851f4 Merge branch 'PHP-5.5' into PHP-5.6 2014-01-04 01:29:15 +01:00
Nikita Popov
d992a972c0 Merge branch 'PHP-5.4' into PHP-5.5 2014-01-04 01:24:54 +01:00
Nikita Popov
7e8e21df0c Fix bug #66286: Incorrect object comparison with inheritance
std_compare_objects immidiately returned 0 if the property tables
of both objects contain NULL at some index. Thus it would report
objects as equal even though properties following after that
differ.
2014-01-04 01:22:14 +01:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui
47c9027772 Bump year 2014-01-03 11:06:16 +08:00
Xinchen Hui
c0d060f5c0 Bump year 2014-01-03 11:04:26 +08:00
Dmitry Stogov
03a37de9b3 Improved empty string handling. Now ZE uses an interned string instead of allocation new empty string each time. (Some extensions might need to be fixed using str_efree() instead of efree() to support interned strings). 2013-12-26 14:47:13 +04:00
Dmitry Stogov
0ff0e82f26 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed ZEND_MM_MEM_TYPE=mmap_zero

Conflicts:
	NEWS
2013-12-26 11:52:39 +04:00
Dmitry Stogov
6414fe283e Fixed ZEND_MM_MEM_TYPE=mmap_zero 2013-12-26 11:51:32 +04:00
Anatol Belski
19039984e2 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  removed outdated IsDebuggerPresent declaration
2013-12-23 12:01:10 +01:00
Anatol Belski
3f7a145b5a Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  removed outdated IsDebuggerPresent declaration
2013-12-23 12:00:49 +01:00
Anatol Belski
f156e684ac removed outdated IsDebuggerPresent declaration
This piece of code seems to retain compatibility with some windows
versions before 2000. Today it's not relevant anymore and only
produces a warning C4273 because of the conflicting prototype. In
VC9 the declaration is present in winbase.h:4142, but available
is it already in winxp. Here's the doc link
http://msdn.microsoft.com/en-us/library/windows/desktop/ms680345(v=vs.85).aspx
2013-12-23 11:53:47 +01:00
krakjoe
704866d6fd opcodes 2013-12-22 13:20:41 +00:00
krakjoe
d455377fad opcodes 2013-12-22 13:20:17 +00:00
krakjoe
df9f2ad2e9 Merge branch 'PHP-5.6' of https://github.com/php/php-src into PHP-5.6 2013-12-22 13:17:21 +00:00
krakjoe
2a1b60569f Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  stop warnings from unused opcode map
  - BFN
  - Fixed bug #66311 (Stack smashing protection kills PDO/ODBC queries) patch by: michael at orlitzky dot com
  Included new .c file in build too
  Fixed little typo in zend_vm_gen.php
  Moved to new file, killing a lot of warnings
2013-12-22 13:11:20 +00:00
krakjoe
247ec0d81f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  stop warnings from unused opcode map
  - BFN
2013-12-22 13:07:41 +00:00
krakjoe
b1df00a7c9 stop warnings from unused opcode map 2013-12-22 13:00:51 +00:00
Bob Weinand
129fb22b37 Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	Zend/zend_vm_opcodes.c
2013-12-22 00:55:46 +01:00
Bob Weinand
7e3af096b3 Merge branch 'PHP-5.4' into PHP-5.5
Conflicts:
	Zend/zend_vm_opcodes.c
2013-12-22 00:54:59 +01:00
Bob Weinand
97bf254385 Included new .c file in build too 2013-12-22 00:52:05 +01:00
Bob Weinand
2874eba714 Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	Zend/zend_vm_opcodes.h
2013-12-21 23:54:38 +01:00
Bob Weinand
00cc4dccb8 Fixed little typo in zend_vm_gen.php 2013-12-21 23:52:48 +01:00
Bob Weinand
0dd2765687 Merge branch 'PHP-5.4' into PHP-5.5
Conflicts:
	Zend/zend_vm_opcodes.h
2013-12-21 23:49:28 +01:00
Bob Weinand
61199be02f Moved to new file, killing a lot of warnings 2013-12-21 23:45:34 +01:00
Bob Weinand
b14f31872b Merge branch 'PHP-5.5' into PHP-5.6 2013-12-21 21:32:42 +01:00
Bob Weinand
560f90e511 Merge branch 'PHP-5.4' into PHP-5.5
Conflicts:
	Zend/zend_vm_gen.php
	Zend/zend_vm_opcodes.h
2013-12-21 21:31:48 +01:00
Bob Weinand
7894e397d8 Fixed build... 2013-12-21 21:29:08 +01:00
Bob Weinand
9b4b5fa737 Merge branch 'PHP-5.5' into PHP-5.6 2013-12-21 19:31:27 +01:00
Bob Weinand
b52c300eca Merge branch 'PHP-5.4' into PHP-5.5 2013-12-21 19:27:58 +01:00
Bob Weinand
50d50c2f04 Added an opcode to opcode name map
That way extensions etc. don't have to maintain their own lists anymore.
Also as phpdbg is included and needs such a map, it'd be counterproductive to need to change two things on every new opcode.
2013-12-21 19:22:47 +01:00
Xinchen Hui
b331a219be Use memcmp here is better 2013-12-17 15:37:10 +08:00
Xinchen Hui
eeb37c40e6 Save one char compare 2013-12-17 15:09:52 +08:00
Xinchen Hui
5eb8d9d700 Merge branch 'PHP-5.6' of https://git.php.net/push/php-src into PHP-5.6 2013-12-15 16:55:29 +08:00
Eric Stenson
330168a247 Fix tests expecting specific resource IDs
When Wincache or APC are installed, the resource IDs are not the same.
This is because Wincache takes a few resource objects for itself.  As a
result, these tests become false positives.

On Windows boxes, the microtime precision is not granular enough
to reliably register a difference if two calls to uniqid() are made
concurrently.  This is a fix to the uniqid() test to avoid the false
positive when run on Windows machines.  Also, added a test to exercise
the 'more_entropy' variant of uniqid().
2013-12-15 16:51:21 +08:00
Xinchen Hui
6f95a07c41 Merge branch 'PHP-5.5' into PHP-5.6 2013-12-13 11:37:43 +08:00
Xinchen Hui
ef73f85079 Use zend_error_noreturn here 2013-12-13 10:56:35 +08:00
Xinchen Hui
dde552f2ee Add Tests for #65784 in 5.5 2013-12-13 01:45:45 +08:00
Xinchen Hui
54213b462d Disallowed JMP into a finally block. 2013-12-13 01:44:54 +08:00
Xinchen Hui
794a888a48 Fixed bug #65784 (Segfault with finally). 2013-12-13 00:16:08 +08:00
Bob Weinand
324291ebf2 Added one more test for constant scalar expressions 2013-12-11 19:17:07 +01:00
Remi Collet
45d8802441 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
  Fixed Bug #66218 zend_register_functions breaks reflection
2013-12-10 16:10:20 +01:00
Remi Collet
9f4d1ee51c Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed Bug #66218 zend_register_functions breaks reflection
2013-12-10 16:09:41 +01:00
Remi Collet
3e963f8eb4 Fixed Bug #66218 zend_register_functions breaks reflection
Functions registered using zend_register_functions instead of zend_module_entry.functions are not seen on reflection.

Ex: additional_functions from api_module_entry.
Ex: in CLI, dl, cli_set_process_title and cli_get_process_title

Note:
- also affects functions overrided in extension
  (should be be reported in extension, where overrided, not in original extension)
- also allow extension to call zend_register_functions for various list
  (instead of having a single bug list)
2013-12-10 16:07:16 +01:00
Dmitry Stogov
a46f644b3a Revered func_get_args() changes, because they were not completly transparent and broke some tricky PHP code that worked because of luck before php-5.5.6 (see Bug #66107). The changes are going to be kept in PHP-5.6. 2013-12-10 16:02:59 +04:00
Dmitry Stogov
4c3492b050 Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6
* 'PHP-5.6' of git.php.net:php-src:
  Zend: fix overflow handling bug in non-x86 fast_add_function()
2013-12-10 15:16:30 +04:00
Dmitry Stogov
49d7e98025 Fixed memory leaks introdused by:
commit 611da37617
	Author: Igor Wiedler <igor@wiedler.ch>
	Date:   Sat Nov 9 13:48:23 2013 -0500
2013-12-10 15:13:53 +04:00
Ard Biesheuvel
60d2e70c06 Zend: fix overflow handling bug in non-x86 fast_add_function()
The 'result' argument of fast_add_function() may alias with either
of its operands (or both). Take care not to write to 'result' before
reading op1 and op2.
2013-12-10 12:12:14 +01:00
Dmitry Stogov
5a87b7ff39 Fixed bug #66252 (Problems in AST evaluation invalidating valid parent:: reference. Constant expessions have to be evaluated in context of defining class). 2013-12-10 14:19:17 +04:00
Stanislav Malyshev
cfd5ea4301 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Replace invalid code with a proper #error
2013-12-08 15:53:41 -08:00
Stanislav Malyshev
744f35d2ab Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Replace invalid code with a proper #error
2013-12-08 15:52:56 -08:00
Lior Kaplan
c062c18d42 Replace invalid code with a proper #error
This code creates a nasty error as mentioned in bugs #31131, #37062
Patch taken from Debian's PHP package: 044-strtod_arm_fix
2013-12-08 15:49:22 -08:00
Ard Biesheuvel
bec62af141 Merge branch 'PHP-5.4' into PHP-5.5 2013-12-11 08:50:53 +01:00
Ard Biesheuvel
8f1fee61e2 Zend: fix overflow handling bug in non-x86 fast_add_function()
The 'result' argument of fast_add_function() may alias with either
of its operands (or both). Take care not to write to 'result' before
reading op1 and op2.
2013-12-11 08:50:20 +01:00
Ferenc Kovacs
562fa252ad Merge branch 'use-function' of git://github.com/igorw/php-src into igorw-use-function 2013-12-06 05:39:49 +01:00
Dmitry Stogov
9447181d0c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed ability to build non-specialized GOTO VM
2013-12-02 11:03:17 +04:00
Dmitry Stogov
7efcbecda9 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed ability to build non-specialized GOTO VM

Conflicts:
	Zend/zend_vm_gen.php
2013-12-02 11:02:40 +04:00
Dmitry Stogov
9ed605892d Fixed ability to build non-specialized GOTO VM 2013-12-02 10:59:32 +04:00
Nikita Popov
b3546e64bd Merge branch 'PHP-5.5' into PHP-5.6 2013-12-01 13:45:22 +01:00
Nikita Popov
02dca18b90 Fix bug #65764
I'm not exactly sure whether this is the right way to fix it. The
question is whether Generator::throw() on a newborn generator (i.e.
a generator that is not yet at yield expression) should first advance to
the first yield and throw the exception there or whether it should
instead throw the exception in the caller's context.

The old behavior was to throw it at the start of the function (i.e.
the very first opcode), which causes issues like the one in #65764.
Effectively it's impossible to properly handle the exceptions in this
case.

For now I choose the variant where the generator advances to the
first yield before throwing, as that's consistent with how all other
methods on the Generator object currently behave. This does not
necessarily match the behavior in other languages, e.g. Python would throw
the exception in the caller's context. But then our send() method already
has this kind of deviation, so it stays internally consistent at least.
2013-12-01 13:37:56 +01:00