Commit Graph

9133 Commits

Author SHA1 Message Date
Dmitry Stogov
f2a2fccece Merge branch 'master' into phpng
* master:
  fix nmake snap when ext name is different in target dll
  force atoll macro usage on windows
  Enable $ replacement in exif, ldap, pdo_pgsql and tidy
  See bug #67635
  NEWS
  NEWS
  improve previous, add message during configure
  Fixed bug #67635 php links to systemd libraries without using pkg-config
  Improve fix for #66608
  Fixed segfault with empty break
  New added opcodes don't need to be resloved
  Update NEWS
  Update NEWS
  Update NEWS
  Fixed bug #66827 Session raises E_NOTICE when session name variable is array
  implemented copy libs of core exts in phpize mode
  fix copy the ext dll into the prefix path in phpize mode
  fix default prefix in phpize mode
  fix file with zero size usage in phpize mode

Conflicts:
	Zend/zend_opcode.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/session/session.c
2014-07-22 15:42:17 +04:00
Nikita Popov
130b6340d2 Code cleanup 2014-07-22 13:30:26 +02:00
Nikita Popov
cc0bef6636 Fix namespace\, maybe 2014-07-22 13:25:47 +02:00
Nikita Popov
9c69c41a64 Port top level stmt
Problem: namespace\foo no longer works :/
2014-07-22 13:02:51 +02:00
Nikita Popov
8a2ff6b53d Partial NS port (semicolon, no errors) 2014-07-22 12:45:44 +02:00
Nikita Popov
b6c9eb21d4 Port constant declaration 2014-07-22 11:55:07 +02:00
Dmitry Stogov
821b8bbb39 Fixed support for executor override 2014-07-22 11:24:16 +04:00
Dmitry Stogov
ea17b018d8 Fixed dtrace support 2014-07-22 11:12:49 +04:00
Nikita Popov
64151ec37a Port function/const use 2014-07-21 23:41:11 +02:00
Nikita Popov
573d25b5e7 Drop dead code 2014-07-21 22:58:38 +02:00
Nikita Popov
37ac1b96ed Port use statement 2014-07-21 22:49:31 +02:00
Nikita Popov
c60cd3e8ef Remove __clone test (not reason it should error) 2014-07-21 18:47:03 +02:00
Nikita Popov
94d5d7d01b Remove one usage of implementing_class 2014-07-21 18:25:46 +02:00
Nikita Popov
6c6dd84c50 Dead code 2014-07-21 18:24:10 +02:00
Nikita Popov
f8ce5e6efc Handle const expr __CLASS__ in trait 2014-07-21 18:21:13 +02:00
Nikita Popov
61a6083e99 Fix some remaining class declaration issues 2014-07-21 18:15:09 +02:00
Nikita Popov
df970e9fc2 Pre-evaluate magic constants 2014-07-21 18:02:31 +02:00
Nikita Popov
18fd2a1897 Port __TRAIT__ and __CLASS__ to AST 2014-07-21 17:34:00 +02:00
Nikita Popov
005315510a Mostly finish class declarations (~50 failing tests) 2014-07-21 17:14:01 +02:00
Nikita Popov
b24bda6be1 Partial port of class declarations 2014-07-21 16:34:45 +02:00
Nikita Popov
461bce5222 Prepare zend_ast_decl for reuse with classes 2014-07-21 15:38:21 +02:00
Nikita Popov
09564ebacf zend_begin_func_decl 2014-07-21 15:22:13 +02:00
Nikita Popov
028c7d20fb Throw \self etc error
Could only enable this now that everything uses the new format
2014-07-19 23:44:33 +02:00
Nikita Popov
c8d99a1333 No need to handle leading \ in class_name_literal 2014-07-19 23:39:51 +02:00
Nikita Popov
e6e8867550 Fix class name resolution in traits 2014-07-19 23:36:01 +02:00
Nikita Popov
86f1004c4e Improve class name handling 2014-07-19 23:30:07 +02:00
Nikita Popov
e572a32657 Dead code 2014-07-19 22:46:22 +02:00
Nikita Popov
291bcfe4f1 Port trait uses 2014-07-19 22:39:01 +02:00
Nikita Popov
fd7387a761 Handle class const doc comment
Property doc comments not yet handled
2014-07-19 15:20:35 +02:00
Nikita Popov
222430d99c Port class const decl 2014-07-19 15:13:50 +02:00
Nikita Popov
43d6e599cf Port property declarations 2014-07-19 14:54:56 +02:00
Nikita Popov
1aaaedc1eb Dead code 2014-07-19 13:23:25 +02:00
Nikita Popov
6513e959d6 Fix for with empty expression lists 2014-07-19 13:21:12 +02:00
Nikita Popov
ef26f95676 Load lineno when compiling exprs 2014-07-19 13:13:58 +02:00
Nikita Popov
446cf29ab7 Fix compound assign to static property 2014-07-19 13:03:58 +02:00
Nikita Popov
09309a543f Remove dead code 2014-07-19 13:00:57 +02:00
Nikita Popov
74dba7e4db __autoload error 2014-07-19 12:57:31 +02:00
Nikita Popov
547331d24d Port methods
The duplicated magic method checks are ugly
2014-07-19 12:52:44 +02:00
Xinchen Hui
1c0e22f50c Merge branch 'PHP-5.6' 2014-07-19 17:19:57 +08: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
a3e8a10918 Merge branch 'PHP-5.6' 2014-07-19 13:12:56 +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
Nikita Popov
b9f62be2e6 Cleanup 2014-07-18 20:24:44 +02:00
Nikita Popov
d0b66f3af3 zend_emit_jump and zend_emit_cond_jump 2014-07-18 20:03:29 +02:00
Nikita Popov
ca7a490758 zend_update_jump_target 2014-07-18 16:11:43 +02:00
Nikita Popov
0eab81f32b Remove bits of dead code 2014-07-18 15:53:38 +02:00
Nikita Popov
adbddf4e5b Support static closures 2014-07-18 15:47:46 +02:00
Nikita Popov
405b97e8a9 Handle function doc comments 2014-07-18 15:23:16 +02:00
Nikita Popov
cdcf78f730 Fix lexer/compiler interdependency 2014-07-18 15:05:31 +02:00
Nikita Popov
359f99fe48 Use dedicated func_decl ast node
Functions need a bunch of extra info, that becomes inconvenient
to handle using the normal ast structure.
2014-07-18 14:57:00 +02:00
Nikita Popov
3ad55e001e Small cleanup
Current problem: build_runtime_defined_function_key is lexer
coupled
2014-07-18 13:15:58 +02:00
Nikita Popov
ae5ba9abfb Port closures 2014-07-18 12:58:24 +02:00
Nikita Popov
abfc8bd894 Port closure use 2014-07-18 12:30:39 +02:00
Xinchen Hui
6cc487df2c Revert "stash" (pushed by accident)
This reverts commit a18bf5fc93.
2014-07-18 16:27:31 +08:00
Xinchen Hui
110bf9c720 Merge remote-tracking branch 'origin/master' into phpng
Conflicts:
	Zend/zend_compile.h
	ext/openssl/xp_ssl.c
2014-07-18 16:25:43 +08:00
Xinchen Hui
f6f621ef69 Merge branch 'PHP-5.6' 2014-07-18 15:51:24 +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
Xinchen Hui
4e378844ab Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-07-17 15:21:46 +08:00
Dmitry Stogov
2febfbab8e Micro optimization for the main interpreter loop 2014-07-17 11:18:44 +04:00
Nikita Popov
20d2a044ee Lineno corrections 2014-07-16 23:33:22 +02:00
Nikita Popov
64a7132185 Port __METHOD__ 2014-07-16 23:23:25 +02:00
Nikita Popov
a75921dcb1 Port __FUNCTION__ to AST 2014-07-16 23:10:16 +02:00
Xinchen Hui
a18bf5fc93 stash 2014-07-16 16:35:48 +08:00
Nikita Popov
f589713cc4 Preliminary function decl support
Problem: __FUNCTION__ etc don't work anymore, due to lexer/parser
interdependency.
2014-07-16 00:07:09 +02:00
Dmitry Stogov
8217e20ddb Fixed compilation warnings 2014-07-15 15:51:40 +04:00
Nikita Popov
1ee3277aba Port parameter defs
Has one bug re \self
2014-07-14 23:03:53 +02:00
Dmitry Stogov
bcc677789c Fixed ZTS build 2014-07-14 15:46:09 +04:00
Dmitry Stogov
af7cb16907 Implemented builtin instruction for strlen() 2014-07-14 15:43:11 +04:00
Dmitry Stogov
42c4bcaed1 Fixed ZTS build 2014-07-14 14:25:04 +04:00
Xinchen Hui
0ef6f729c9 Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-07-14 14:34:51 +08:00
Dmitry Stogov
7dfb4f6b38 Implemented builtin instruction for type check functions - is_*() 2014-07-14 10:33:11 +04:00
Xinchen Hui
b7ff8f28b2 Temporary fixed the invalid read warning 2014-07-14 14:01:53 +08:00
Nikita Popov
47f0717a69 Rename params -> args 2014-07-13 13:11:55 +02:00
Nikita Popov
484ad86958 Moar removal 2014-07-12 19:20:21 +02:00
Nikita Popov
f9ed83469c Remove more dead code 2014-07-12 19:18:09 +02:00
Nikita Popov
b934dfe088 Remove dead code 2014-07-12 19:10:19 +02:00
Nikita Popov
856e2a05b6 Fix + improve try/catch 2014-07-12 19:08:09 +02:00
Nikita Popov
069da161cf approx correct linenos in errors 2014-07-12 17:10:10 +02:00
Nikita Popov
c58079b4fd Port static vars
Need to figure out the constant expr stuff
2014-07-12 17:00:53 +02:00
Nikita Popov
86a1cd0d82 Verious fixes 2014-07-12 16:25:47 +02:00
Nikita Popov
8577f58e52 Store (bad) estimate of lineno with ast
Currently not used yet
2014-07-12 14:03:42 +02:00
Nikita Popov
e367e68111 Port try/catch
Down to 50 failing Zend tests
2014-07-12 13:50:58 +02:00
Dmitry Stogov
6c8db864e0 Implemented builtin instruction for strlen() 2014-07-11 18:52:27 +04:00
Nikita Popov
32ca08f249 Fix leak 2014-07-11 15:33:39 +02:00
Nikita Popov
dde9faee2e Port switch 2014-07-11 15:31:47 +02: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
Nikita Popov
f12c1482a3 Port foreach 2014-07-11 12:16:21 +02:00
Nikita Popov
7f151465b2 Make inner_statement_list asty 2014-07-10 23:04:42 +02:00
Dmitry Stogov
de306e7088 Implement call_user_func() and call_user_func_array() using special opcodes.
In some rare cases it leads to insignificant changes in error messages.
2014-07-11 00:32:18 +04:00
Dmitry Stogov
4e291fab81 Fixed usage after free() 2014-07-10 21:45:09 +04:00
Nikita Popov
4215969904 Port if (partial) 2014-07-10 16:38:04 +02:00
Dmitry Stogov
d81b287ce1 Fixed delayed closure destruction and reference support 2014-07-10 18:36:11 +04:00
Nikita Popov
3be63fca48 Port for 2014-07-10 15:51:47 +02:00
Nikita Popov
80c44ad510 Support creating of ast nodes with >3 children 2014-07-10 15:18:08 +02:00
Nikita Popov
1738ee7e5a Port do/while 2014-07-10 14:46:22 +02:00
Nikita Popov
c7656c06cc Port while
Note: From here on everything is broken
2014-07-10 14:35:59 +02:00
Nikita Popov
68777b72b2 Expr stmts go through ast 2014-07-10 00:04:27 +02:00
Nikita Popov
1de1bc96a5 Make statement asty 2014-07-10 00:00:48 +02:00
Nikita Popov
117714d122 Port goto label 2014-07-09 23:46:22 +02:00
Nikita Popov
d14b763bb9 Make unticked_statement an ast node (usually NULL) 2014-07-09 23:39:21 +02:00
Nikita Popov
fc541418f2 Port goto 2014-07-09 23:11:32 +02:00
Nikita Popov
cc8a6fa91e Port break/continue 2014-07-09 23:05:21 +02:00
Nikita Popov
5bf0c28fe3 Port throw 2014-07-09 22:48:42 +02:00
Dmitry Stogov
c85c795e46 Imporoved EXPECTED/UNEXPECTED macros to support not boolean expressions.
Fixed invalid EXPECTED() usage.
2014-07-09 19:32:09 +04:00
Dmitry Stogov
19729aa7fe Use data stored in current call frame instead of EG() if possible 2014-07-09 17:07:41 +04:00
Dmitry Stogov
9d6e45a0ee Changed zend_make_printable_zval() to return "use_copy" instead of additional reference argument.
Improved branch prediction.
2014-07-09 16:05:55 +04:00
Dmitry Stogov
d87140d8d8 Added missed warning (ext/spl/tests/iterator_035.phpt) 2014-07-09 13:30:47 +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
Xinchen Hui
549c5a5c1b Mismatched folder marks 2014-07-08 17:53:13 +08:00
Dmitry Stogov
9b9d60a480 Specify HashTable size and optimize inserts that may not conflict 2014-07-08 13:46:03 +04:00
Dmitry Stogov
0abd626269 code cleanup 2014-07-08 13:24:23 +04:00
Dmitry Stogov
73679bf6db Another fix for uninitialized execute_data->symbol_table 2014-07-08 12:17:52 +04:00
Xinchen Hui
e5fed097cc Fixed uninitialized symbol_table 2014-07-08 14:43:20 +08:00
Dmitry Stogov
b36aaea6ed ZEND_SEND_VAR and ZEND_SEND_VAL specialization 2014-07-08 02:13:53 +04:00
Nikita Popov
289265402a Port echo 2014-07-07 21:14:14 +02:00
Nikita Popov
36c3cf3198 Port return statement 2014-07-07 21:06:02 +02:00
Dmitry Stogov
d9585f019f Skip useless ZEND_RECV opcodes 2014-07-07 22:18:48 +04:00
Dmitry Stogov
21acbd5b75 Avoid useless check 2014-07-07 21:33:53 +04:00
Dmitry Stogov
7d0b21d3bc Function can't be "interactive" 2014-07-07 21:33:09 +04:00
Dmitry Stogov
2ed8a17045 Refactored run_time_cache usage in object handlers 2014-07-07 20:54:31 +04:00
Dmitry Stogov
bce6a36c8a Merge branch 'master' into test
* master: (48 commits)
  change locale - looks like not everybody has sl_SI
  Fix bug #66921 - Wrong argument type hint for function intltz_from_date_time_zone
  fix format
  Fix bug #67052 (NumberFormatter::parse() resets LC_NUMERIC setting)
  Make sure the generator script also creates a newline at the end of file
  Add newline at end of file to prevent compilation warning
  Fix handling of session user module custom handlers.
  Reference bug report instead of github issue in NEWS file
  add more exts for Travis
  Update NEWS
  Fix phpdbg.1 man page installation when build != src directory
  BFN for bug #67551 (php://input temp file will be located in sys_temp_dir instead of upload_tmp_dir)
  reorder
  restore API compatibility
  finish
  refactor php_stream_temp_create{,_ex} and use it for the php://input stream
  refactor _php_stream_fopen_{temporary_,tmp}file()
  fix length overflow of HTTP_RAW_POST_DATA
  Update NEWS
  Fixed bug #67215 (php-cgi work with opcache, may be segmentation fault happen)
  ...

Conflicts:
	ext/opcache/zend_accelerator_util_funcs.c
	ext/session/mod_user.c
	ext/spl/spl_array.c
	ext/spl/spl_dllist.c
	ext/standard/file.c
	ext/standard/streamsfuncs.c
	ext/standard/string.c
	main/streams/memory.c
2014-07-07 19:21:23 +04:00
Dmitry Stogov
477bd49cca Wrong expectation in tests (for some reason backtraces contained invlalid extra frame at the top) 2014-07-07 18:09:17 +04:00
Dmitry Stogov
4dd7c63d1e Wrong expectation in test (The error "Non-static method A::A_ftk() should not be called statically" is reported on caller side, so backtrace shouldn't include call to A::A_ftk()). 2014-07-07 17:27:16 +04:00
Dmitry Stogov
2f316a775d Wrong expectation in test (for some reason backtrace misses gc_collect_cycles() call) 2014-07-07 17:17:42 +04:00
Dmitry Stogov
70a112e51b Wrong expectation in test (wrong line number in backtrace) 2014-07-07 16:57:05 +04:00
Dmitry Stogov
7ce2d59ad2 Merge branch 'call-frame' into phpng
* call-frame:
  Simplify call-frame handling
  Removed EG(active_symbol_table) and use corresponding value from EG(current_execute_data)
  Use values from current_execute_data instead of globals where possible
  Removed EG(called_scope) and use corresponding value from EG(current_execute_data)
  Removed EG(in_execution). If EG(currentent_execute_data) is not NULL we are executing something.
  Removed EG(opline_ptr) and use corresponding value from EG(current_execute_data)
  Removed EG(active_op_array) and use corresponding value from EG(current_execute_data)
  Uinified call frame handling for user and internal functions. Now EG(current_execute_data) always point to the call frame of the currently executed function.
  Fixed cleanup of incompleytely passed parameters
  Prohibited parameter redefinition
  Fixed support for extra arguments in conjunction with variadiv argument. Use compile time flags to check if we call constructor and result of ZEND_NEW is used or not.
  Fixed uninitialized variables
  Optimization
  Changed zend_execute_data layout to reduce memory overhead
  Help C compilet to do the better job optimizing target code
  Use fast comparison for (func->type == ZEND_USER_FUNCTION || func->type == ZEND_EVAL_CODE)
  Keep extra args in the same VM stack segment (after all CV and TMP vars)
  Refactoring: merge call_frame and end_execute_data into single data structure. Keep only single copy of each argument on VM stack (previously ZE kept two copies of each arguments for user functions)
  Refactoring: use call_frames instead of call_slots

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2014-07-07 16:19:24 +04:00
Dmitry Stogov
5aa91be509 Simplify call-frame handling 2014-07-07 15:50:44 +04: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
439a95908b Fix leak when generator return value is not used 2014-07-05 15:07:25 +02:00
Nikita Popov
2d4c962c61 Fix ZTS build 2014-07-05 14:12:20 +02:00
Nikita Popov
77fddc0ca2 Use zend_string* in some places 2014-07-05 00:11:00 +02:00
Nikita Popov
17c2d16d79 Refactor class name resolution as well 2014-07-04 23:45:20 +02:00
Nikita Popov
b3336270f6 Hack around global leak for now 2014-07-04 23:15:31 +02:00
Nikita Popov
fdc318849a Shared name production for const / fn name 2014-07-04 23:08:05 +02: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
Dmitry Stogov
d2890963e4 Use values from current_execute_data instead of globals where possible 2014-07-04 17:03:44 +04:00
Dmitry Stogov
c4d99ec982 Removed EG(called_scope) and use corresponding value from EG(current_execute_data) 2014-07-03 02:34:43 +04:00
Dmitry Stogov
0a77dcd4b9 Removed EG(in_execution). If EG(currentent_execute_data) is not NULL we are executing something. 2014-07-03 01:02:25 +04:00
Dmitry Stogov
63c057e331 Removed EG(opline_ptr) and use corresponding value from EG(current_execute_data) 2014-07-02 23:29:53 +04:00
Dmitry Stogov
4b09dd69e6 Removed EG(active_op_array) and use corresponding value from EG(current_execute_data) 2014-07-02 22:03:21 +04:00
Dmitry Stogov
412ad4b254 Uinified call frame handling for user and internal functions.
Now EG(current_execute_data) always point to the call frame of the currently executed function.
2014-07-02 22:01:25 +04:00
Nikita Popov
ac552cccc1 Merge branch 'PHP-5.6' 2014-07-02 17:37:25 +02: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
6b0beb9df1 Merge branch 'PHP-5.6' 2014-07-02 17:26:44 +02:00
Bob Weinand
1163a7ce24 Mark test as XFAIL until fixed 2014-07-02 17:25:47 +02:00
Bob Weinand
c01dcd325d Merge branch 'PHP-5.6' 2014-07-02 12:44:30 +02:00
Bob Weinand
33699a4dab Messed up syntax of tests 2014-07-02 12:43:27 +02:00
Bob Weinand
0870cc8a7c Merge branch 'PHP-5.6' 2014-07-02 12:35:06 +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
Xinchen Hui
1d1226afa2 Suppress warning "cast from pointer to integer of different size" 2014-07-01 10:36:19 +08:00
Dmitry Stogov
acfbb7b6dc Merge branch 'master' into test
* master: (67 commits)
  remove the NEWS entry for the reverted fpm fix
  remove the NEWS entry for the reverted fpm fix
  remove the NEWS entry for the reverted fpm fix
  Revert "Fix Bug #67530 	error_log=syslog ignored"
  --enable-fpm for the travis build
  fix the last fpm NEWS entry, the other bug is related, but not the same what we fixed here
  NEWS
  NEWS
  Fix bug #67091: make install fails to install libphp5.so on FreeBSD 10.0
  adding NEWS entry for the fix for bug #65641
  Updated NEWS file for recent phpdbg fixes
  Fixed issue krakjoe/phpdbg#94 - List behavior is inconsistent
  Fix issue krakjoe/phpdbg#97 - list now appends a newline if there is none The prompt should always ensure it is on a newline
  Fixed test
  Inform about back command existence in help - Fixes krakjoe/phpdbg#100 No way to list the current stack/frames
  Fix issue krakjoe/phpdbg#98 break if does not seem to work
  Fix issue krakjoe/phpdbg#99 register function has the same behavior as run
  Fix readline/libedit (Thanks to @remicollet)
  Replace incorrect `E` command with `ev` in watch help
  Fix typo in `finish` help
  ...

Conflicts:
	Zend/zend_ast.c
	Zend/zend_highlight.c
	Zend/zend_indent.c
	ext/spl/spl_array.c
	ext/spl/spl_observer.c
	ext/standard/info.c
2014-07-01 00:19:41 +04:00
Dmitry Stogov
8c9b3e664c Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed possible crash because of race conditions on modifying constants in shared memory
2014-07-01 00:17:55 +04: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
Dmitry Stogov
b7715c7e8a Refactored parameter passing mechanism.
In PHP-5.6 and below each argument passed to user function was copies on VM stack twice.
Now we always have ZEND_INIT_FCALL (or simular) opcode that pushes "call frame" on top of VM stack.
"Call frame" is actually the same zend_execute_data structure.
All the following ZEND_SEND instructions push arguments on top of the stack in a way that they directly comes into corresponding CV variables of the called frame. Extra arguments are copied at the end of stack frame (after all CV and TMP variables) on function enterance.

There are two minor incompatibilities:
1) It's not allowed to decalre functions redefining arguments e.g. "function foo($a,$a) {}".
2) func_get_arg() and func_get args() return the current value of argument and not the original value that was sent.
2014-06-30 15:43:45 +04:00
Nikita Popov
fb98dd31a0 Some refactoring of fn/const resolution 2014-06-28 22:27:06 +02:00
Nikita Popov
e198132542 Drop addition of weird \ prefix for FQ consts
Also fixes a resolution bug
2014-06-28 18:24:59 +02:00
Nikita Popov
111ad71d38 Rename ZEND_CONST to ZEND_AST_ZVAL 2014-06-28 18:03:26 +02:00
Xinchen Hui
7614fe810e C++ doesn't allow implicitly convert void * to other pointer type 2014-06-28 11:19:38 +08:00
Xinchen Hui
f609d8c1c6 C++ compiler doesn't allow cast a void * to other pointer type 2014-06-27 12:35:34 +08:00
Dmitry Stogov
9af4b18b81 Reverted 387c491559 (it broke ext/standard/tests/file/bug44607.phpt) 2014-06-27 00:40:52 +04:00
Nikita Popov
64dab4b914 Drop dead code 2014-06-26 22:17:19 +02:00
Nikita Popov
0e44f4c583 Remove obseleted grammar productions 2014-06-26 22:09:05 +02:00
Nikita Popov
dd60c8e0f1 Reuse expr for static_scalar 2014-06-26 22:02:54 +02:00
Nikita Popov
dd60b9bb91 Handle ::class in const expr via ast as well 2014-06-26 21:44:46 +02:00
Nikita Popov
080e8bffa5 Compile const refs to CONST 2014-06-26 16:56:50 +02:00
Nikita Popov
b83c70416b Compile class const refs to CONST zval 2014-06-26 16:35:30 +02:00
Xinchen Hui
387c491559 op2 is null terminated string 2014-06-26 22:13:24 +08:00
Nikita Popov
08c4e01a1b Add compilation state for static scalars 2014-06-26 16:03:15 +02:00
Nikita Popov
9c169d5a4d Remove static_scalar_base 2014-06-26 14:03:31 +02:00
Nikita Popov
31687ed5c7 Handle trait __CLASS__ in parser 2014-06-26 14:00:20 +02:00
Nikita Popov
7f01b6fcec Bring static scalar arrays in line 2014-06-26 13:20:39 +02:00
Nikita Popov
0237954778 Bring static scalar AST more in line with normal AST 2014-06-26 13:06:39 +02:00
Nikita Popov
1b84b87e78 Const eval unary pm (as previously) 2014-06-26 12:43:20 +02:00
Xinchen Hui
f75c04ac8d No need to initialize it 2014-06-26 18:10:18 +08:00
Xinchen Hui
a7ce96d01f More optimizations 2014-06-26 18:09:04 +08:00
Xinchen Hui
64c5eb00b8 Let's assume the name is already lowercased 2014-06-26 17:56:55 +08: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
Xinchen Hui
18bde665f5 Merge branch 'PHP-5.6' 2014-06-24 13:53:43 +08:00
Xinchen Hui
9d49492fd6 Fixed bug #67368 (Memory leak with immediately dereferenced array in class constant) 2014-06-24 13:53:05 +08:00
Nikita Popov
e26c6d663a Implement constant expression folding as a separate pass 2014-06-23 21:59:14 +02:00
Dmitry Stogov
0c5a1b835e Fixed refcounting bug 2014-06-23 17:02:22 +04:00
Dmitry Stogov
bbc508dea5 Fixed string deallocation and code cleanup 2014-06-23 17:01:59 +04:00
Ferenc Kovacs
f5defa1cf2 Merge branch 'PHP-5.6'
* PHP-5.6:
  testcase for 67468 (only for debug build, as I could not create a stable segfault without loading other exts like pgsql)
  mention 67468 fix in NEWS
  Fix Bug #67468  Segfault in highlight_file()/highlight_string() when pgsql.so module is loaded
2014-06-23 10:14:08 +02: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
Nikita Popov
0644fbccf7 Implement CT eval of binary expressions
I totally hate this approach. It's ugly and I don't think I can
share code with the static scalar evaluation. Maybe I should use
the approach that static scalars use instead?
2014-06-22 15:57:44 +02:00
Nikita Popov
508d146cd3 Move T_STRING_VARNAME handling 2014-06-21 20:11:31 +02:00
Nikita Popov
90d36554e2 Support string interpolation 2014-06-21 20:06:46 +02:00
Nikita Popov
b6789b1dd6 zend_ast_dynamic_ast returns new node 2014-06-21 19:31:08 +02:00
Nikita Popov
86db3942cf Remove dead code 2014-06-21 18:54:30 +02:00
Nikita Popov
657762ee2b AST stage 2.4 2014-06-21 18:54:13 +02:00
Nikita Popov
55ab55c417 Add ability to specify additional attr in AST 2014-06-19 13:48:50 +02:00
Nikita Popov
89ecd73a04 Make ast->children a uint
Future optimization: only use uint for dynamic lists and use a
uchar or even an introspection function to get the child count.
2014-06-19 13:48:50 +02:00
Nikita Popov
0c81b3eae2 Remove dead code 2014-06-19 13:48:49 +02:00
Nikita Popov
232a922618 Support yield without parens
for now => is lowest-prec right-assoc
2014-06-19 13:48:49 +02:00
Nikita Popov
0ec49bba22 AST stage 1.9
Expressions (mostly) use the AST
2014-06-19 13:48:35 +02:00
Dmitry Stogov
b108267f2c Merge branch 'master' into phpng
* master: (41 commits)
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  NEWS
  Fix Request #67453 Allow to unserialize empty data.
  Update copyright year to 2014
  Update copyright year for re2c generated files
  Update copyright year to 2014
  Update copyright year for re2c files as well
  Fix patch for bug #67436
  fix failed test
  Fix test on modern distro where old unsecure algo are disabled in openssl config. Testing recent algo should be enough to check this function.
  Added tests for bug 67436
  Fixed wrong XFAIL test - already fixed
  Fix typo in Bug #67406 NEWS entry
  Fix typo in Bug #67406 NEWS entry
  ...

Conflicts:
	Zend/zend_compile.c
	ext/session/session.c
	ext/standard/array.c
	ext/standard/http_fopen_wrapper.c
	tests/classes/bug63462.phpt
2014-06-18 17:50:27 +04:00
Dmitry Stogov
a4f38192ec Use arena allocator for optimizer temporary data structures 2014-06-18 17:09:37 +04:00
Xinchen Hui
2508d493d9 Fixed typo 2014-06-18 15:11:46 +08:00
Xinchen Hui
2bd14a07fe Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-06-18 12:09:51 +08:00
Xinchen Hui
6288bb8ffe Refactoring mysqlnd (incompleted, only mysqlnd ext compilable) 2014-06-18 12:09:37 +08:00
Dmitry Stogov
e1b18e59f7 Use arena allocator for zend_class_entry, zend_op_array and zend_property_info that live till the end of request 2014-06-18 02:47:01 +04:00
Dmitry Stogov
a8e63d2b56 Fixed support for constants inherited from interfaces 2014-06-17 01:15:51 +04:00
Dmitry Stogov
909acec231 Avoid useles constants update 2014-06-16 23:32:58 +04:00
Dmitry Stogov
bd10db271c Use new zend_hash iteration API 2014-06-16 21:11:52 +04:00
Dmitry Stogov
e181798405 Small call/return improvement 2014-06-16 13:25:23 +04:00
Bob Weinand
b4d61c335b Merge branch 'PHP-5.6' 2014-06-16 11:20:05 +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
Dmitry Stogov
3b2fb7abc5 Fixed support for references 2014-06-16 13:08:48 +04:00
Bob Weinand
8668f205ca Merge branch 'PHP-5.6' 2014-06-16 00:43:31 +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
143cc3f0da Merge branch 'PHP-5.6' 2014-06-15 23:16:21 +02: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
Nikita Popov
258a733ed2 AST-based compiler: Stage 1 2014-06-14 15:22:18 +02:00
Dmitry Stogov
83817ddb1c Fixed reference counting 2014-06-12 13:01:44 +04:00
Dmitry Stogov
dd1c68e67f Merge branch 'master' into phpng
* master: (77 commits)
  NEWS entry for Fix potential segfault in dns_get_record()
  NEWS entry for "Fix potential segfault in dns_get_record()"
  NEWS entry for Fix potential segfault in dns_get_record(
  Fix potential segfault in dns_get_record()
  Revert "Add optional second arg to unserialize()"
  5.5.15 now
  update NEWS
  Fix bug #66127 (Segmentation fault with ArrayObject unset)
  5.4.31 next
  Add NEWS. This doesn't need UPGRADING (or an RFC), IMO.
  Fix broken test.
  Add a mime type map generation script and update the header.
  Move the mime type map out of php_cli_server.c for easier generation.
  Replace the CLI server's linear search for extensions with a hash table.
  fix test
  Remove unused included file
  NEWS
  NEWS
  NEWS
  Fixed Bug #67413 	fileinfo: cdf_read_property_info insufficient boundary chec
  ...

Conflicts:
	Zend/zend_closures.c
	Zend/zend_execute.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/spl/spl_array.c
	ext/standard/basic_functions.c
	ext/standard/dns.c
	ext/standard/var.c
2014-06-12 05:07:33 +04:00
Dmitry Stogov
593b125eb9 Fixed reference handling 2014-06-12 03:14:57 +04:00
Dmitry Stogov
9f6db414f8 Improved assignment code 2014-06-11 15:11:29 +04:00
Dmitry Stogov
14e6ee7f42 Use absolute addresses as branch targets for NEW, FE_RESET and FE_FETCH 2014-06-11 11:39:42 +04:00
Dmitry Stogov
592c8a0426 Improved conditions order 2014-06-11 02:46:50 +04:00
Xinchen Hui
d461afc3a2 Merge branch 'PHP-5.6' 2014-06-10 21:58:31 +08: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
Xinchen Hui
3c69140a90 Remove unused codes 2014-06-10 21:53:46 +08:00
Dmitry Stogov
eb9b0baaa9 Optimized for fast path 2014-06-10 01:58:28 +04:00
Dmitry Stogov
9a9bb8877e Improved ZTS support 2014-06-09 21:29:20 +04:00
Dmitry Stogov
371345bed6 Avoid reallocation 2014-06-09 17:36:37 +04:00
Dmitry Stogov
2d29f2d8d9 Comparison optimization 2014-06-09 17:00:22 +04:00
Dmitry Stogov
7bf4fa69be Avoid extra function call on hot path 2014-06-09 15:41:29 +04:00
Stanislav Malyshev
9fceb05fcf Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug 64744 Show the type of the non-object for more descriptive errors
2014-06-08 19:18:09 -07: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
a17734fb04 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug 666222
  Fix bug 666222
2014-06-08 19:02:51 -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
Stanislav Malyshev
224f369a03 Merge remote-tracking branch 'github/pr/671'
* github/pr/671:
  Fix align indentation
  Fixed identation on file
2014-06-08 14:29:03 -07:00
Jefersson Nathan
e51eaaf665 Fix align indentation 2014-06-08 14:28:51 -07:00
Nikita Popov
98918fe65b Remove (&ast->u.child)[i] weirdness 2014-06-06 22:35:21 +02:00
Nikita Popov
2adda06544 Merge branch 'PHP-5.6' 2014-06-06 17:13:08 +02:00
Nikita Popov
6d1885342c Fix bug #67392: dtrace breaks argument unpack 2014-06-06 17:09:49 +02:00
Nikita Popov
c8aa51f825 Accept static member fetch in new variable (BC) 2014-06-06 17:05:14 +02:00
Dmitry Stogov
e499c3d259 Introduced new BIND_GLOBAL instraction instead of FETCH_W+ASSIGN_REF pair that caused a lot of useles checks 2014-06-06 15:04:30 +04:00
Dmitry Stogov
e4581fd6b8 GC doesn't count scalars and immutable arrays in the same way 2014-06-05 21:05:07 +04:00
Dmitry Stogov
1b8916886b Speedup string equality check 2014-06-05 19:14:47 +04:00
Dmitry Stogov
730beec16e Simplify code 2014-06-05 18:42:17 +04:00
Dmitry Stogov
c1965f58d4 Use reference counting instead of zval duplication 2014-06-05 16:04:11 +04:00
Nikita Popov
e4e42df4e6 Allow only simple variables with global keyword 2014-06-04 17:15:16 +02:00
Dmitry Stogov
3d87391cc0 Reference counters in PHPNG may have different values 2014-06-04 09:57:17 +04:00
Dmitry Stogov
6e7338700e Avoid useless merge 2014-06-04 02:11:26 +04:00
Dmitry Stogov
3f6f0d5a70 Simplified and optimized ZEND_HANDLE_NUMERIC() 2014-06-03 13:10:42 +04:00
Dmitry Stogov
bc2ba841f9 Optimized conditions order 2014-06-03 09:45:09 +04:00
Dmitry Stogov
30c05577f7 Optimized conditions order 2014-06-03 03:54:03 +04:00
Dmitry Stogov
af78ea1d97 Avoid copying of immutable arrays 2014-06-03 02:43:53 +04:00
Dmitry Stogov
2bc1abe204 cleanup 2014-06-03 02:43:31 +04:00
Dmitry Stogov
0427ae08fb cleanup 2014-06-03 00:36:31 +04:00
Nikita Popov
f4a11b66cc Merge and rename to member_name 2014-05-31 21:00:11 +02:00
Nikita Popov
8d7f5a403a Remove duplication 2014-05-31 20:58:44 +02:00
Nikita Popov
8515b96e53 Handle FUNC_ARG fetches on temporaries 2014-05-31 20:15:55 +02:00
Nikita Popov
96b32ec532 Support isset() on temporaries 2014-05-31 20:05:03 +02:00
Nikita Popov
5c2120b6cf Forbid writing to temporary expressions 2014-05-31 19:41:39 +02:00
Nikita Popov
72b5e0cac0 Add another static member access test 2014-05-31 18:18:20 +02:00
Nikita Popov
f0ac7f7d7b Properly handle property read on const/tmp 2014-05-31 17:51:22 +02:00
Nikita Popov
c53a7ea4e5 Property handle calls on [] and '' consts/tmps 2014-05-31 17:37:30 +02:00
Nikita Popov
64e4c9eff1 Support directly calling closure 2014-05-31 17:18:37 +02:00
Nikita Popov
fd85f77857 Fix previous commit 2014-05-31 17:02:48 +02:00
Nikita Popov
64f80b3835 Introduce dereferencable_scalar to simplify future additions 2014-05-31 16:44:53 +02:00
Nikita Popov
4ec505f9b5 Add two initial tests 2014-05-31 16:33:52 +02:00
Nikita Popov
f48241f734 Generalize static access syntax 2014-05-31 16:27:03 +02:00
Nikita Popov
8a65c3b234 Remove now unnecessary code in begin_method_call 2014-05-31 16:08:38 +02:00
Nikita Popov
fcf42d817d Remove object_stack (mostly) 2014-05-31 15:59:54 +02:00
Nikita Popov
c29d3b6e3e Update another test 2014-05-31 00:48:06 +02:00
Nikita Popov
c5920af515 Update two tests with new semantics 2014-05-31 00:40:32 +02:00
Nikita Popov
ff475e9e76 Allow arrays + object access for new expressions 2014-05-31 00:37:03 +02:00
Nikita Popov
75c0db1119 Integrate combined scalar as dereferencable 2014-05-31 00:18:50 +02:00
Nikita Popov
46a2ca8324 Generalize expression dereferencing 2014-05-31 00:09:11 +02:00
Nikita Popov
5712f0e9bd Minor cleanup 2014-05-31 00:02:51 +02:00
Nikita Popov
87f8e758c8 Cleanup old grammar rules 2014-05-30 23:51:54 +02:00
Nikita Popov
295d07e373 Reintroduce new expression dereferencing 2014-05-30 23:44:30 +02:00
Nikita Popov
067fca0e89 Remove reference_variable indirection 2014-05-30 23:36:30 +02:00
Nikita Popov
e89958a634 Make function calls directly callable 2014-05-30 23:30:37 +02:00
Nikita Popov
667f8409c5 Recursive definition for object proprety fetches 2014-05-30 23:25:43 +02:00
Nikita Popov
a8c1595012 LTR static member access 2014-05-30 22:33:03 +02:00
Nikita Popov
b8b3b355be Use recursion for property fetches 2014-05-30 22:04:39 +02:00
Nikita Popov
46e35e3d5d Get rid of base_variable_with_function_calls 2014-05-30 21:14:18 +02:00
Nikita Popov
e2be2cee97 Temporarily disable complex variables in new expressions 2014-05-30 21:11:25 +02:00