Commit Graph

502 Commits

Author SHA1 Message Date
Xinchen Hui
2402d6cbbc Refactor MySQLi (incompleted, only compilable now) 2014-05-11 14:53:18 +08:00
Dmitry Stogov
0c6a6f0fba Re-applyed Bob's patch with minor fixes 2014-05-07 15:03:56 +04:00
Dmitry Stogov
4ecc527976 Reverted Bob's patch (it breaks many tests when run with opcache and needs to be fixed first). 2014-05-07 03:26:13 +04:00
Bob Weinand
f3c1881f1d Re-added fix for bug #66015 and adapted for phpng branch 2014-05-06 14:59:03 +02: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
65e2ed6e50 Redesigned zend_execute_data layout now EX(object), EX(scope) and EX(called_scope) arr properties of the current function execution co
ntext. They are set during zend_execute_data initialization and never changed.
2014-04-24 15:53:20 +04:00
Dmitry Stogov
7e424f5a95 Use symbolic names instead of magic constants + optimization 2014-04-23 02:47:41 +04:00
Nikita Popov
3d3a55cbcb Pass expected array size hint in INIT_ARRAY
To avoid unnecessary rehashes
2014-04-22 18:57:03 +02:00
Dmitry Stogov
7584ae3200 Fixed compilaation warnings 2014-04-22 18:52:59 +04:00
Dmitry Stogov
5d479ef693 ZEND_SEND_* optimization 2014-04-22 12:33:00 +04:00
Dmitry Stogov
f71da39210 Use ZEND_HASH_FOEACH_* instead of zend_hash_apply_* 2014-04-21 13:55:25 +04:00
Dmitry Stogov
ea2e1bb1eb Optimized zend_leave_helper() 2014-04-18 13:46:36 +04:00
Dmitry Stogov
5c02e0fc5f Cache op_array->run_time_cache in zend_execute_data for faster access 2014-04-17 16:36:04 +04:00
Dmitry Stogov
e96073b1e4 Moved zend_literal->cache_slot right into zval.
It should be accessed using Z_CACHE_SLOT() macro.
zend_literal structure is removed.
API functions that accepted pointer to zend_literal now accept pointer to zval or cache_slot directly.
Calls of such functiond that now accept cache_slot need to be changed to pass -1 instead of NULL.
2014-04-17 15:40:45 +04:00
Dmitry Stogov
050d7e38ad Cleanup (1-st round) 2014-04-15 15:40:40 +04:00
Bob Weinand
f614fc6898 Fix bug #66015 by reverting "Removed operations on constant arrays." 2014-04-11 10:08:44 +02: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
ea85451b65 Refactored data structures to keep zend_object* instead of a whole zval in some places 2014-03-28 02:11:22 +04:00
Dmitry Stogov
9a8fbdf2f4 Use CV variable offset instead of CV variable number 2014-03-27 16:00:25 +04:00
Dmitry Stogov
ef6919e6f2 Fixed static data cleanup 2014-03-21 13:51:18 +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
51494f252f Don't include trailing zero into hash caclculation 2014-03-14 15:35:57 +04: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
Xinchen Hui
47fb198533 Revert "Use zend_string for arg_info to fixed segfault in Zend/tests/argument_restriction_003.phpt"
This reverts commit b96318105b.
2014-02-21 23:02:24 +08:00
Xinchen Hui
b96318105b Use zend_string for arg_info to fixed segfault in Zend/tests/argument_restriction_003.phpt 2014-02-21 22:34:30 +08:00
Dmitry Stogov
bb58ea348c Use better data structures (incomplete) 2014-02-18 18:10:54 +04: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
2b9b9afa7a Use better data structures (incomplete) 2014-02-17 17:59:18 +04:00
Dmitry Stogov
4e66abad54 Use better data structures (incomplete) - refactored return_value handling 2014-02-12 14:29:51 +04:00
Dmitry Stogov
e2ea9a7319 Use better data structures (incomplete) 2014-02-12 11:42:27 +04:00
Dmitry Stogov
f4cfaf36e2 Use better data structures (incomplete) 2014-02-10 10:04:30 +04:00
Nikita Popov
2c47dfbaeb Implement argument unpacking
RFC: https://wiki.php.net/rfc/argument_unpacking
2014-01-11 12:42:08 +01:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui
794a888a48 Fixed bug #65784 (Segfault with finally). 2013-12-13 00:16:08 +08: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
Bob Weinand
d36cf90291 Merge branch 'const_scalar_exprs' into PHP-5.6
Conflicts:
	Zend/zend_extensions.h
2013-11-28 13:41:42 +01:00
Dmitry Stogov
57c1335fec Don't check argument types for internal functions without type hinting 2013-11-28 11:44:14 +04:00
Dmitry Stogov
43e3933fa3 Removed deprecated AI_SET_PTR()s 2013-11-27 20:30:35 +04:00
Igor Wiedler
719db1a7b2 Merge pull request #4 from LawnGnome/use-function
FIX ALL THE THINGS
2013-11-08 18:39:29 -08:00
Adam Harvey
da553a8166 Fix constant resolution. 2013-11-08 21:37:38 -05:00
Igor Wiedler
24e0b99103 Merge remote-tracking branch 'upstream/PHP-5.6' into use-function
* upstream/PHP-5.6: (399 commits)
  Fixed issue #115 (path issue when using phar). Fixed issue #149 (Phar mount points not working with OPcache enabled).
  Added tests for PHAR/OPCahce incompatibilities
  Update NEWS
  Fixed bug #65947 (basename is no more working after fgetcsv in certain situation)
  Update NEWS
  Fixed Bug #66043 (Segfault calling bind_param() on mysqli)
  NEWS entry
  NEWS entry
  Fix bug #65946 - pdo_sql_parser.c permanently converts values bound to strings
  bump API versions
  Add a couple more test cases to parse_url() tests
  fix missing change from 'tcp_socket' to the more common 'server'
  fix many parallel test issues
  Cleanup temp test file
  Revert "Fixed issue #115 (path issue when using phar)."
  Update LiteSpeed SAPI code to V6.4
  Fixed typo in Makefile.frag
  updated NEWS
  Remove outdate codes, make it clearer, although just a bit..
  Update NEWS
  ...

Conflicts:
	Zend/zend_compile.h
2013-11-08 19:14:58 -05:00
Dmitry Stogov
9647c61dc1 Constant expressions refactoring 2013-11-06 22:21:07 +04:00
Bob Weinand
ad967e1329 Added a few more operators 2013-11-03 01:58:39 +01:00
Bob Weinand
2361745806 Working commit for constant scalar expressions (with constants).
Tests will follow.
2013-10-31 08:57:12 +01:00
Nikita Popov
0ceea8a2e8 Don't track parameter number in separate znode
We already track it in the op array already.
2013-09-26 19:43:32 +02: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
ef9e003b0c Small cleanup in class name resolution of compiler
* The fetch_type and check_ns_name parameters of
   zend_resolve_class_name were unused and are now removed.
 * ZEND_FETCH_CLASS_GLOBAL is no longer used (no code actually
   checking for it).
 * The checks for usage of "namespace" as class name were
   unnecessary as that situation can't occur anyways.
2013-09-13 12:18:39 +02:00