Commit Graph

632 Commits

Author SHA1 Message Date
Sara Golemon
79f9ed9b6f Merge branch 'PHP-7.2'
* PHP-7.2:
  Use Z_EXPECTED_LONG to initialize FAST_ZPP parsing loop
2018-01-23 09:24:54 -05:00
Sara Golemon
0067420049 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Use Z_EXPECTED_LONG to initialize FAST_ZPP parsing loop
2018-01-23 09:24:47 -05:00
Sara Golemon
e954bafc28 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Use Z_EXPECTED_LONG to initialize FAST_ZPP parsing loop
2018-01-23 09:24:40 -05:00
Sara Golemon
e88e83d3e5
Use Z_EXPECTED_LONG to initialize FAST_ZPP parsing loop 2018-01-23 09:24:10 -05:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
d9f5ea691f zend_fcall_info_cache.initialized is removed (zend_fcall_info_cache is initialized if zend_fcall_info_cache.function_handler is set). 2017-12-27 15:15:03 +03:00
Dmitry Stogov
f3aca3c852 Use "fastcal" calling convention for internal PHP functions on x86 2017-12-11 10:55:15 +03:00
Nikita Popov
cb2884679c Remove zend_get_parameters(_ex) APIs
zend_get_parameters_ex() has been marked as deprecated for a long
time already. What zend_get_paramers() does is even more
questionable under PHP7. Both functions are obsoleted by the ZPP
mechanism, so I'm dropping them.
2017-10-30 22:00:42 +01:00
Dmitry Stogov
8203a0668d Merge branch 'master' into rc_debug
* master:
  Use per-request heap instead of system one
  Extend zend_register_class_alias_ex() with additional argument to allow creating persistent or per-request aliases
  Makrk persistent resources and references with GC_PERSISTENT flag
2017-10-27 14:59:09 +03:00
Dmitry Stogov
8e01026b82 Extend zend_register_class_alias_ex() with additional argument to allow creating persistent or per-request aliases 2017-10-27 14:44:21 +03:00
Dmitry Stogov
49ea143bbd Encapsulate reference-counting primitives.
Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead.
Added mactros to validate reference-counting (disabled for now).
These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
2017-10-27 01:28:58 +03:00
Dmitry Stogov
272f5a1716 Extend zend_string API to avoid reallocation in zend_string_init_interned() 2017-10-19 00:02:56 +03:00
Dmitry Stogov
44e0b79ac6 Refactored array creation API. array_init() and array_init_size() are converted into macros calling zend_new_array(). They are not functions anymore and don't return any values. 2017-09-20 02:25:56 +03:00
Thomas Punt
a595b0f75b Fix fast ZPP macro definition 2017-08-19 15:24:11 +02:00
Kalle Sommer Nielsen
67be32ced9 FAST_ZPP variant of zend_parse_parameters_none(), ZEND_PARSE_PARAMETERS_NONE() 2017-07-23 08:48:06 +02:00
Anatol Belski
bc5811f361 further sync for vim mode lines 2017-07-04 18:12:45 +02:00
Richard Fussenegger
66e5dc5b9b Fixed ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO macro
The macro was expanding to a wrong macro and thus leads to compile errors upon
usage. Changed it to expand to the correct macro.
2017-06-30 13:22:25 +02:00
Nikita Popov
ee8e75aab4 Extract zend_get_callable_name() API
Instead of interleaving this inside zend_is_callable(), implement
this in a separate function instead.

Also add _deref() hash APIs. I've wanted these for a while, and
this is another place where they're useful, so finally do it...
2017-06-25 18:26:03 +02:00
Dmitry Stogov
db4561bfff Introduced "zif_handler" type (zif = zend internal function). 2017-06-08 16:52:39 +03:00
Dmitry Stogov
ace9fe5317 Improved new Zend Parameter Parsing API to avoid useless dereferences.
This derefernce made sense only for explicit paramter passing by reference, but this feature was removed in PHP-7.
The improvement is 100% backward compatible, only few "tricky" functions may be affected (e.g. extract and usort).
2017-06-08 13:03:24 +03:00
Jakub Zelenka
eb6614e458 Constify str in add_assoc_string_ex and add_assoc_stringl_ex 2017-06-07 23:44:23 +02:00
Kalle Sommer Nielsen
7b5ba8e68b Remove accidently added byte 2017-05-26 17:37:44 +02:00
Kalle Sommer Nielsen
0affe1e7bd Added zend_parse_parameters_none_throw() 2017-05-26 17:29:50 +02:00
Dmitry Stogov
f00d1c72b4 Added ZEND_GET_CLASS, ZEMD_GET_CALLED_CLASS, ZEND_GET_TYPE instructions, to implement corresponding builtin functions. 2017-05-25 18:41:28 +03:00
Bogdan Padalko
ab2489fae2
Add variadic type and obj info macros 2017-01-22 15:58:11 +00:00
Dmitry Stogov
141d1ba980 Introduced "zend_type" - an abstraction for type-hinting representation. 2017-01-13 11:37:46 +03:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Sara Golemon
52db03b3e5 Support ZEND_PARSE_PARAMS_THROW in new ZPP API 2016-12-29 18:26:19 -08:00
Anatol Belski
b204b3abd1 further normalizations, uint vs uint32_t
fix merge mistake

yet one more replacement run
2016-11-26 17:29:01 +01:00
Stanislav Malyshev
54003ab663 Fix bug #73147: Use After Free in PHP7 unserialize()
(cherry picked from commit 0e6fe3a4c9)
(cherry picked from commit f42cbd749c)
2016-10-14 01:44:16 +02:00
Anatol Belski
b1ef60f90e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #73147: Use After Free in PHP7 unserialize()
2016-10-12 17:56:13 +02:00
Stanislav Malyshev
f42cbd749c Fix bug #73147: Use After Free in PHP7 unserialize()
(cherry picked from commit 0e6fe3a4c9)
2016-10-12 17:51:15 +02:00
Andrea Faulds
fc5497cb92 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-11 22:46:20 +01:00
Andrea Faulds
d690014bf3 Remove zpp fallback code (always use Fast ZPP)
Squashed commit of the following:

commit 3e27fbb3d2
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Sep 11 19:14:37 2016 +0100

    Keep dummy FAST_ZPP macro for compatibility

commit 8a7cfd00de
Author: Andrea Faulds <ajf@ajf.me>
Date:   Mon Sep 5 22:36:03 2016 +0100

    Remove FAST_ZPP macro and plain zpp fallback code
2016-09-11 22:44:46 +01:00
Aaron Piotrowski
d9a9cf8eca Merge branch 'master' into iterable 2016-07-03 22:42:10 -05:00
Anatol Belski
c9a538cdb4 improve ZEND_MODULE_GLOBALS_BULK macro, fix data type 2016-06-23 16:47:04 +02:00
Dmitry Stogov
1433162083 Fixed compilation warnings 2016-06-21 20:12:29 +03:00
Dmitry Stogov
421843977f Fixed bug #71266 (Missing separation of properties HT in foreach etc). 2016-06-07 23:18:52 +03:00
Aaron Piotrowski
72692e9a9c Add iterable pseudo-type 2016-06-03 17:42:04 -05:00
Nikita Popov
91f5940329 Forbid dynamic calls to scope introspection functions
Per RFC:
https://wiki.php.net/rfc/forbid_dynamic_scope_introspection
2016-05-24 20:48:24 +02:00
Dmitry Stogov
7b94b958cc Intern some known (and offten used) strings. 2016-05-12 13:47:22 +03:00
Joe Watkins
3048092f5b Merge branch 'PHP-7.0'
* PHP-7.0:
  correct wording
2016-05-04 17:04:49 +01:00
Joe Watkins
a17e4187e7 correct wording 2016-05-04 17:04:38 +01:00
Dmitry Stogov
f0a2e8eb13 Removed "zend_fcall_info.function_table". It was assigned in many places, but is never used. 2016-04-27 13:46:38 +03:00
Dmitry Stogov
7abfaac901 Merge zend_execute_data->called_scope into zend_execute_data->This.
"called_scope" made sense only for static method calls, for dynamic calls it was always equal to the class of $this.
Now EG(This) may store IS_OBJECT + $this or IS_UNUSED + "called_scope" (of course, "called_scope" may be NULL).
Some code might need to be adopted to support this change.
Checks (Z_OBJ(EX(This))) might need to be converted into (Z_TYPE(EX(This)) == IS_OBJECT).
2016-04-01 16:17:49 +03:00
Dmitry Stogov
c67c166f93 Removed zend_fcall_info.symbol_table 2016-03-02 17:50:55 +03:00
Xinchen Hui
563659822d Merge branch 'PHP-7.0' 2016-01-02 17:56:54 +08:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Dmitry Stogov
a75c195000 Implemented the RFC Support Class Constant Visibility.
Squashed commit of the following:

commit f11ca0e7a5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Dec 8 12:38:42 2015 +0300

    Fixed test expectation

commit 211f873f54
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Dec 8 12:28:38 2015 +0300

    Embed zend_class_constant.flags into zend_class_constants.value.u2.access_flags

commit 51deab84b2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Dec 7 11:18:55 2015 +0300

    Fixed issues found by Nikita

commit 544dbd5b47
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Sat Dec 5 02:41:05 2015 +0300

    Refactored immplementation of https://wiki.php.net/rfc/class_const_visibility
    @reeze created an RFC here and I emailed internals here and didn't get any responses positive/negative.
2015-12-08 12:40:42 +03:00
Xinchen Hui
0495bf5650 Revert "fix typos "paramer" -> "parameters""
ABI BC break

This reverts commit 6ac12f1337.
2015-12-08 10:52:50 +08:00
Márcio Almada
6ac12f1337 fix typos "paramer" -> "parameters" 2015-12-07 14:48:26 +08:00
Márcio Almada
2dcfd8d16f fix typos "paramer" -> "parameters" 2015-12-07 01:59:53 -04:00
Bob Weinand
95dbe1d03e Short-circuit zend_parse_parameters_none() so that expensive zpp() call never happens in non-exceptional case 2015-09-20 02:43:22 +02:00
Dmitry Stogov
37f0c6b5cb Add myself into list of authors of the most refactored files. 2015-08-31 11:38:16 +03:00
Dmitry Stogov
71af54e5f6 Mark error and exception functions as "cold" (Matt's idea) 2015-08-19 14:40:56 +03:00
Julien Pauli
9a138b47c9 Removed unused code 2015-08-18 14:33:04 +02:00
Anatol Belski
ffa341de59 add macro to access globals as whole 2015-07-30 09:05:08 +02:00
Anatol Belski
43cdfd9a82 add unified globals accessor macro 2015-07-29 10:36:29 +02:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Dmitry Stogov
4bd22cf1c1 Improved zend_string API (Francois Laupretre)
Squashed commit of the following:

commit d96eab8d79
Author: Francois Laupretre <francois@tekwire.net>
Date:   Fri Jun 26 01:23:31 2015 +0200

    Use the new 'ZSTR' macros in the rest of the code.

    Does not change anything to the generated code (thanks to compat macros) but cleaner.

commit b352643910
Author: Francois Laupretre <francois@tekwire.net>
Date:   Thu Jun 25 13:45:06 2015 +0200

    Improve zend_string API

    Add missing methods
2015-06-29 16:44:54 +03:00
Bob Weinand
7c2a0157c7 Cache the class_name typehint key in arg_info
This leads to up to 2% improvement on one tested real world application by not having to always recalculate the lowercased string and its hash
2015-06-12 17:26:53 +02:00
Dmitry Stogov
8e10e8f921 Avoid zval duplication in ZVAL_ZVAL() macro (it was necessary only in few places).
Switch from ZVAL_ZVAL() to simpler macros where possible (it makes sense to review remaining places)
2015-06-12 12:33:23 +03:00
Remi Collet
a861019b7f Add consistency check in FAST_ZPP call
So ensure Z_PARAM_OPTIONAL is correctly call at the right place
Only in DEBUG build

Will raise 'Assertion `_i > _min_num_args || _optional==0' failed.'
or         'Assertion `_i <= _min_num_args || _optional==1' failed.'
Thus will allow to detect bad code early.
2015-05-19 10:54:10 +02:00
Dmitry Stogov
b3d053b036 Eliminated useless check in FAST_ZPP (this also fixed few wrong -Wmaybe-uninitialized compilation warnings) (Remi) 2015-05-19 11:06:01 +03:00
Dmitry Stogov
70c86732cb Use zend_string to represent pdo_column_data.name and avoid duplication. 2015-05-05 16:19:51 +03:00
Jin Hu
1f28da0225 Added RETURN_ARR and RETVAL_ARR macros 2015-04-08 00:33:11 +08:00
Nikita Popov
122d759618 Always throw TypeException on throwing zpp failures
Introduces a ZEND_PARSE_PARAMS_THROW flag for zpp, which forces to
report FAILURE errors using a TypeException instead of a Warning,
like it would happen in strict mode.

Adds a zend_parse_parameters_throw() convenience function, which
invokes zpp with this flag.

Converts all cases I could identify, where we currently have
throwing zpp usage in constructors and replaces them with this API.
Error handling is still replaced to EH_THROW in some cases to handle
other, domain-specific errors in constructors.
2015-04-06 11:27:34 +02:00
Dmitry Stogov
ea09a9fa32 Convert fatal errors into EngineExceptions
Make zval_update_constant_ex(), zval_update_constant(), zend_update_class_constants() and zend_ast_evaluate() return SUCCESS or FAILURE.
2015-04-02 02:05:25 +03:00
Nikita Popov
8d00385871 Reclassify E_STRICT notices
Per RFC https://wiki.php.net/rfc/reclassify_e_strict

While reviewing this, found that there are still three E_STRICTs
left in libraries - need to discuss those.
2015-04-01 11:17:55 +02:00
Dmitry Stogov
1018f462d8 Patch improvement:
Removed the corresponding core code.
Fixed ext/com_dotnet and ext/date.
Refactored ext/intl changes.
Improved ext/fileinfo and ext/pdo changes.
Fixed tests.
2015-03-30 18:53:38 +03:00
Kalle Sommer Nielsen
02be73b5fa Constness to zend_get_object_type(), thanks Michael! 2015-03-25 07:01:04 +01:00
Kalle Sommer Nielsen
927d53fda4 Change "Cannot redeclare class X" into "Cannot redeclare class/interface/trait X", meaning that the following:
C:\> php -r "trait A { } trait A { }"

Will now properly print "Cannot redeclare trait A" instead of "Cannot redeclare class A" to make error messages a tiny bit clearer. Admittedly, a better solution can most likely be made by actually telling what the colliding object is a type of.

Internally this adds a new function:
 zend_get_object_type()
2015-03-25 06:31:11 +01:00
Dmitry Stogov
550b07ae1b cleanup 2015-03-25 01:57:05 +03:00
Nikita Popov
ccfd53886f Revert "Use E_ERROR | E_EXCEPTION in FAST_ZPP mode too"
This reverts commit d4da7c20d2.

The argument passed to this function refers to the weak mode
severity, strict mode will get an exception in any case.
2015-03-22 09:17:42 +01:00
Bob Weinand
d4da7c20d2 Use E_ERROR | E_EXCEPTION in FAST_ZPP mode too 2015-03-22 00:17:33 +01:00
Dmitry Stogov
35f9b90bb8 ZPP changed to lazely check for "strict/weak" only if it's really necessary.
Cleanup.
2015-03-20 23:18:52 +03:00
Dmitry Stogov
054591ab9a Imroved ZPP rules (condititins reoredered to prevent duplicate checks) 2015-03-20 17:27:03 +03:00
Dmitry Stogov
5935612666 Improved type hinting:
EX_PREV_USES_STRICT_TYPES() and family changed/renamed to fit with other macros
Optimized zend_verify_internal_arg_type() and family (they don't need "strict" argument anymore)
Standerd ZPP is called from VM only for weak type check or strict exception (int -> double)
Fixed ZEND_RECV_VARIADIC
Fixed ZEND_STRLEN

TODO: should we accept IS_NULL for non-nullable arguments?
2015-03-20 16:04:04 +03:00
Anthony Ferrara
7044f9c6df Refactor as to not use call info, but add the flag to the op_array. 2015-03-19 13:30:11 -04:00
Anthony Ferrara
0ef80ac351 Fix severity issues with callbacks, start work porting ZEND_STRLEN opcode to work with strict mode, more refactoring to come 2015-03-19 12:26:34 -04:00
Anthony Ferrara
579e7fa457 Style cleanup, as well as fixing bug with missing argument for WRONG_PARAM_COUNT_WITH_RETVAL 2015-03-18 15:45:16 -04:00
Anthony Ferrara
8be4266f6a Clean up API renames for zend_wrong_param_count to maintain BC, introducing a zend_wrong_param_count_ex() function when you know strict value 2015-03-18 15:42:49 -04:00
Anthony Ferrara
d22bfb8aa6 Merge in master, fix merge conflicts and update patch to support exceptions everywhere 2015-03-18 10:50:11 -04:00
Dmitry Stogov
8633685675 Use specialized macro for string zval creation 2015-03-12 16:53:51 +03:00
Rouven Weßling
bb0504534d Add ZEND_ARG_CALLABLE_INFO to allow internal function to type hint against callable 2015-03-08 23:00:13 +08:00
Anthony Ferrara
9109e48749 Merge in master 2015-02-18 10:35:39 -05:00
Anthony Ferrara
00b3e77ead Move declare() to the top of the file only, and allow int->float generalization 2015-02-18 10:26:29 -05:00
Anatol Belski
07fdc1c78b fix data types 2015-02-12 18:39:40 +01:00
Andrea Faulds
44ed070a9a Fix Gd usages of ZEND_WRONG_PARAM_COUNT, add usage note 2015-02-10 15:48:09 +00:00
Andrea Faulds
86b0685f55 Prefix zend_wrong_param_count with _ to discourage use 2015-02-10 15:48:07 +00:00
Andrea Faulds
fe663cc404 Partial ZPP strictness implementation 2015-02-10 15:48:06 +00:00
Xinchen Hui
a3379d6691 Padding 2015-02-05 16:11:44 +08:00
Reeze Xia
bff4c47fa7 Implemented internal function return types 2015-02-05 01:04:54 +08:00
Dmitry Stogov
3e31838d19 zend_read_property() has to provide a holder for return value.
Previously it was possible that zend_read_property() returned pointer to zval allocated on stack.
2015-01-22 11:50:42 +03:00
Rasmus Lerdorf
6c9621c937 typo 2015-01-17 11:38:40 -08:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Andrea Faulds
41e3fdba8e Make zend_parse_parameters share fast zpp implementation where possible
Rename shared implementation functions and build them unconditionally

Don't fail on empty path for zend_parse_arg_path

Update type names

Fix behaviour of by-reference "z"

Make 'o' use zend_parse_arg_object

Fix NULL string check in zend_parse_arg_path(_str)
2014-12-29 12:28:28 +00:00
Xinchen Hui
b5b617674e Micro optimaztion (yeah, I know compiler supposed to do that) 2014-12-22 00:10:46 -05:00
Andrea Faulds
e5eb9530ab Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Andrea Faulds
0ea0b591d7 Merge branch 'zppFailOnOverflow'
* zppFailOnOverflow:
  Fix MySQLi tests
  Fixed gd test
  Refactor ZEND_LONG_MAX/MIN checks into ZEND_DOUBLE_FITS_LONG()
  Fixed copy-and-paste error
  Fix more 32-bit tests
  Skip buncha tests on 32-bit
  skip simplexml
  skip posix 32-bit
  skip tests on 32-bit
  Fixes simplexml test
  Fixes posix tests
  Fixes iconv tests
  Marked tests as 32-bit
  Fixed more 32-bit tests
  Fixed some 32-bit tests
  Mark said ext/date tests as 32-bit only
  Fixed ext/date tests broken by zpp error on overflow
  Fixed broken tests
  Make zpp fail if NaN passed for int, or out-of-range float for non-capping int

Conflicts:
	ext/date/tests/getdate_variation7.phpt
	ext/date/tests/localtime_variation3.phpt
2014-12-13 18:38:15 +00:00
Dmitry Stogov
3893c1fc3d Fixed compilation warnings 2014-12-12 21:57:34 +03:00
Dmitry Stogov
5dd427eac2 Use zend_string* for op_array->arg_info[]->name and op_array->arg_info[]->class_name. For internal functions we still use char*. 2014-12-03 16:56:09 +03:00
Andrea Faulds
f90b877f41 Refactor ZEND_LONG_MAX/MIN checks into ZEND_DOUBLE_FITS_LONG() 2014-11-29 02:13:20 +00:00
Andrea Faulds
d19ce51854 Fixed copy-and-paste error 2014-11-29 01:52:23 +00:00
Andrea Faulds
01554bf3e4 Merge branch 'master' into zppFailOnOverflow 2014-11-29 01:45:54 +00:00
Dmitry Stogov
11384ba77b Pack EX(num_args) into EX(This).u2.num_args 2014-11-28 10:28:49 +03:00
Andrea Faulds
71566b994f Merge branch 'master' into zppFailOnOverflow 2014-11-01 22:49:53 +00:00
Anatol Belski
f7d3355e75 fix datatype mismatches
and convert len args to size_t where the underlaying API uses zend_string
2014-10-24 20:50:06 +02:00
Anatol Belski
f227922446 move key lengths to use size_t as zend_string is used internally anyway 2014-10-23 10:29:54 +02:00
Anatol Belski
a5e4f1f598 fix several datatype mismatches 2014-10-22 17:56:30 +02:00
Anatol Belski
5e24ae321d all the key_len use uint, fix the warning when using strlen on 64 bit 2014-10-22 17:56:22 +02:00
Nikita Popov
cf5920e8aa Fix procedural finfo calls in methods
getThis() will return the $this of the calling method.
2014-10-16 14:24:23 +02:00
Anatol Belski
8a55159258 Merge branch 'PHP-5.6'
* PHP-5.6:
  DLL export several APIs needed for phpdbg
2014-10-12 19:22:40 +02:00
Anatol Belski
c96a6b4493 DLL export several APIs needed for phpdbg 2014-10-12 19:22:03 +02:00
Nikita Popov
df79b9b27a Update get_class_name semantics
* get_class_name is now only used for displaying the class name
   in debugging functions like var_dump, print_r, etc. It is no
   longer used in get_class() etc.
 * As it is no longer used in get_parent_class() the parent
   argument is now gone. This also fixes incorrect parent classes
   being reported in COM.
 * get_class_name is now always required (previously some places
   made it optional and some required it) and is also required
   to return a non-NULL value.
 * Remove zend_get_object_classname. This also fixes a number of
   potential leaks due to incorrect usage of this function.
2014-10-09 20:48:27 +02:00
Nikita Popov
e5e9d8346f Remove zend_get_class_entry function 2014-10-09 14:17:30 +02:00
Dmitry Stogov
bd9a234645 Replaced EG(This) and EX(object) with EX(This).
Internal functions now recieves zend_execute_data as the first argument.
2014-10-03 19:32:46 +04:00
Andrea Faulds
bb55397bab Make zpp fail if NaN passed for int, or out-of-range float for non-capping int 2014-09-22 17:06:16 +01:00
Anatol Belski
993d475126 fix condition
A char array like val[1] would always be valid when checking like
!val. Probably better were to check for ->len, but actually ->val[0]
is fine as the actual zend_string should have been initalized
before.
2014-09-13 00:03:42 +02:00
Anatol Belski
5d5a70205c reduce the struct size by 8 byte on 64 bit 2014-09-12 21:35:20 +02:00
Anatol Belski
d6faac2cb2 make array/object APIs accept large strings as values of elements/props 2014-08-28 19:17:47 +02:00
Anatol Belski
3234480827 first show to make 's' work with size_t 2014-08-27 20:49:31 +02:00
Anatol Belski
4d997f63d9 master renames phase 3 2014-08-25 20:22:49 +02:00
Anatol Belski
6f9f0bf205 master renames phase 2 2014-08-25 19:28:33 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
cd18b5884b Merge remote-tracking branch 'php/master' 2014-08-20 23:27:26 +02:00
Dmitry Stogov
8cda420ff4 Fixed ext/pdo_*/tests/pdo_005.phpt tests failure 2014-08-20 23:28:32 +04:00
Anatol Belski
22dbb38d5e fix typo 2014-08-18 10:37:38 +02:00
Anatol Belski
59ec8329f4 renamed _z_param_long 2014-08-18 10:35:46 +02:00
Anatol Belski
483a800c98 Merge remote-tracking branch '64bit_ng/master'
Conflicts:
	Zend/zend_API.h
2014-08-18 10:34:29 +02:00
Dmitry Stogov
f3dc4421ff Fixed parameter parsing 2014-08-18 10:08:48 +04:00
Anatol Belski
f2182ab845 some more pure naming replacements 2014-08-17 21:16:27 +02:00
Anatol Belski
b7e7a89541 several fixes -
- param parsing Z_PARAM_STR vs Z_PARAM_STRING
- some functions for new params
- etc
2014-08-16 12:55:13 +02:00
Anatol Belski
8ee2a4a9b5 first shot on merging the core fro the int64 branch 2014-08-16 11:16:11 +02:00
Xinchen Hui
c749fe2067 cleanup 2014-08-14 12:15:24 +08:00
Dmitry Stogov
0ae305e62d Fixed compilation warnings about unused labels 2014-08-11 10:17:06 +04:00
Dmitry Stogov
42c4bcaed1 Fixed ZTS build 2014-07-14 14:25:04 +04:00
Dmitry Stogov
27f38798a1 Fast parameter parsing API
This API is experemental. It may be changed or removed.
It should be used only for really often used functions.
(Keep the original parsing code and wrap usage with #ifndef FAST_ZPP)
2014-07-11 16:32:20 +04:00
Dmitry Stogov
1dd07d6bf4 Partial fix that allows internal constructors to set $this to null.
The address of $this passed to drectly called internal constructor in execute_data->return_value.
Internal constructors should use ZEND_CTOR_MAKE_NULL() macro (insted of previous ZEND_NULL(EG(This))) to do the work.

This patch doesn't fix the problem for indirectly called constructors. e.g. parant::__construct().
2014-07-09 11:57:42 +04:00
Dmitry Stogov
6bf24f4dd0 Removed EG(active_symbol_table) and use corresponding value from EG(current_execute_data) 2014-07-04 18:03:45 +04:00
Xinchen Hui
284141ca8f Fixed _zend_get_parameters_array
it should not decrease the refcount (spotted by
register_shutdown_function in ext/mysqli/tests/bug49442.phpt)
2014-06-25 00:39:37 +08:00
Dmitry Stogov
6e7338700e Avoid useless merge 2014-06-04 02:11:26 +04:00
Dmitry Stogov
c446e57588 ext/soap support for phpng (incomplete - just compilable) 2014-05-15 02:44:47 +04:00
Xinchen Hui
2402d6cbbc Refactor MySQLi (incompleted, only compilable now) 2014-05-11 14:53:18 +08:00
Xinchen Hui
d8651fbe1c Make they are in the same style of Z_ISREF 2014-05-03 16:08:58 +08:00
Dmitry Stogov
17d027ed47 Split IS_BOOL into IS_FALSE and IS_TRUE 2014-04-30 18:32:42 +04:00
Dmitry Stogov
f9927a6c97 Merge mainstream 'master' branch into refactoring
During merge I had to revert:
	Nikita's patch for php_splice() (it probably needs to be applyed again)
	Bob Weinand's patches related to constant expression handling (we need to review them carefully)
	I also reverted all our attempts to support sapi/phpdbg (we didn't test it anyway)

Conflicts:
	Zend/zend.h
	Zend/zend_API.c
	Zend/zend_ast.c
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_constants.c
	Zend/zend_exceptions.c
	Zend/zend_execute.c
	Zend/zend_execute.h
	Zend/zend_execute_API.c
	Zend/zend_hash.c
	Zend/zend_highlight.c
	Zend/zend_language_parser.y
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner_defs.h
	Zend/zend_variables.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/date/php_date.c
	ext/dom/documenttype.c
	ext/hash/hash.c
	ext/iconv/iconv.c
	ext/mbstring/tests/zend_multibyte-10.phpt
	ext/mbstring/tests/zend_multibyte-11.phpt
	ext/mbstring/tests/zend_multibyte-12.phpt
	ext/mysql/php_mysql.c
	ext/mysqli/mysqli.c
	ext/mysqlnd/mysqlnd_reverse_api.c
	ext/mysqlnd/php_mysqlnd.c
	ext/opcache/ZendAccelerator.c
	ext/opcache/zend_accelerator_util_funcs.c
	ext/opcache/zend_persist.c
	ext/opcache/zend_persist_calc.c
	ext/pcre/php_pcre.c
	ext/pdo/pdo_dbh.c
	ext/pdo/pdo_stmt.c
	ext/pdo_pgsql/pgsql_driver.c
	ext/pgsql/pgsql.c
	ext/reflection/php_reflection.c
	ext/session/session.c
	ext/spl/spl_array.c
	ext/spl/spl_observer.c
	ext/standard/array.c
	ext/standard/basic_functions.c
	ext/standard/html.c
	ext/standard/mail.c
	ext/standard/php_array.h
	ext/standard/proc_open.c
	ext/standard/streamsfuncs.c
	ext/standard/user_filters.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	main/php_variables.c
	sapi/phpdbg/phpdbg.c
	sapi/phpdbg/phpdbg_bp.c
	sapi/phpdbg/phpdbg_frame.c
	sapi/phpdbg/phpdbg_help.c
	sapi/phpdbg/phpdbg_list.c
	sapi/phpdbg/phpdbg_print.c
	sapi/phpdbg/phpdbg_prompt.c
2014-04-26 00:32:51 +04:00
Dmitry Stogov
ea2e1bb1eb Optimized zend_leave_helper() 2014-04-18 13:46:36 +04:00
Dmitry Stogov
050d7e38ad Cleanup (1-st round) 2014-04-15 15:40:40 +04:00
Nikita Popov
20f2e5986e Fix ZTS build
This only makes it compile, it doesn't actually work, presumably
because interned strings are assumed in some places.
2014-04-09 23:41:16 +02:00
Dmitry Stogov
58f0f2503c Various VM optimizations 2014-04-04 02:52:53 +04:00
Dmitry Stogov
76cc99fe60 Refactored ZVAL flags usage to simplify various checks (e.g. Z_REFCOUNTED(), candidate for GC, etc) 2014-04-03 15:26:23 +04:00
Dmitry Stogov
6b2ed577fd Avoid unnecessry reallocations 2014-04-01 22:36:17 +04:00
Dmitry Stogov
ea85451b65 Refactored data structures to keep zend_object* instead of a whole zval in some places 2014-03-28 02:11:22 +04:00
Xinchen Hui
903b6b59bf Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-03-26 23:25:26 +08:00
Xinchen Hui
c9bca5039b Refactor session (incompleted) 2014-03-26 23:23:54 +08:00
Dmitry Stogov
887189ca31 Refactored IS_INDIRECT usage for CV and object properties to support HashTable resizing 2014-03-26 18:07:31 +04:00
Dmitry Stogov
aa5f55306b Refactored EG(active_symbol_table) to be zend_array* instead of HashTable* 2014-03-17 23:15:22 +04:00
Dmitry Stogov
bfdaf6e806 Fixed reference support 2014-03-13 17:59:50 +04:00
Xinchen Hui
74c2deecd8 Fixed refcounted 2014-03-05 18:11:22 +08:00
Dmitry Stogov
19670c2bbc Fixied calling object closures from internal functions 2014-03-05 01:54:21 +04:00
Dmitry Stogov
639e4e1afa Changes zend_is_callable() to use zend_string* instead of char* 2014-02-25 16:03:34 +04:00
Dmitry Stogov
6fbea9ce6a Fixed exception constructor 2014-02-21 16:14:42 +04:00
Xinchen Hui
43b03c74b3 Refacting smart_str 2014-02-18 17:42:46 +08:00
Sara Golemon
837af67271 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add __debugInfo() magic method
2014-02-17 19:37:55 -08: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
Dmitry Stogov
a0fe8e5a91 Use better data structures (incomplete) 2014-02-18 01:41:23 +04:00
Dmitry Stogov
0e425121b3 Use better data structures (incomplete) 2014-02-17 11:50:32 +04:00
Dmitry Stogov
c56a2344d0 Merge branch 'refactoring2' of github.com:zend-dev/php into refactoring2 2014-02-14 13:40:23 +04:00
Dmitry Stogov
398256e5fe Use better data structures (incomplete) 2014-02-14 13:40:11 +04:00
Xinchen Hui
068ec75f8b Use better data structures (incomplete) 2014-02-14 17:05:04 +08:00
Dmitry Stogov
2161103fc3 Use better data structures (incomplete) 2014-02-10 17:49:21 +04:00
Dmitry Stogov
f4cfaf36e2 Use better data structures (incomplete) 2014-02-10 10:04:30 +04:00
Xinchen Hui
0f53e37494 Merge branch 'PHP-5.6' 2014-01-03 11:09:07 +08:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +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
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
0856714576 Always pass return_value_ptr to internal functions
Previous some places passed return_value_ptr only if the function
returned by reference. Now return_value_ptr is always set, even
for functions returning by-value.

This allows you to return zvals without copying their contents. For
this purpose two new macros RETVAL_ZVAL_FAST and RETURN_ZVAL_FAST
are added:

    RETVAL_ZVAL_FAST(zv); /* Analog to RETVAL_ZVAL(zv, 1, 0) */
    RETURN_ZVAL_FAST(zv); /* Analog to RETURN_ZVAL(zv, 1, 0) */

These macros behave similarly to the non-FAST versions with
copy=1 and dtor=0, with the difference that the FAST versions
will try return the zval without copying by utilizing return_value_ptr.
2013-08-31 13:16:41 +02:00
Nikita Popov
d18b969858 Evaluate ZVAL_ZVAL arguments only once
Also remove some isref/refcount assignments, which are no longer
necessary (as ZVAL_COPY_VALUE is used now).
2013-08-26 19:57:14 +02: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
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
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
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
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
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
93fd9c704b Fix bug #64099 (Wrong TSRM usage in zend_register_class_alias) 2013-01-29 19:47:45 +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