Commit Graph

1060 Commits

Author SHA1 Message Date
Nikita Popov
440481fb3e Display TypeExceptions like normal exceptions
We currently don't show the argument at which the error actually
occured in the trace - should probably either add it or don't
display args on incomplete frames altogether, otherwise this'll
probably be confusing.
2015-05-17 19:54:12 +02:00
Nikita Popov
3ae995f03c Tweak uncaught exception message display
This implements a reduced variant of #1226 with just the following
change:

-Fatal error: Uncaught exception 'EngineException' with message 'Call to private method foo::bar() from context ''' in %s:%d
+Fatal error: Uncaught EngineException: Call to private method foo::bar() from context '' in %s:%d

The '' wrapper around messages is very weird if the exception
message itself contains ''. Futhermore having the message wrapped
in '' doesn't work for the "and defined" suffix of
TypeExceptions.
2015-05-17 18:47:06 +02:00
Aaron Piotrowski
64b167d201 Updated tests to reflect exception class changes. 2015-05-16 16:49:14 -05:00
Nikita Popov
c9f27ee422 Display EngineExceptions like ordinary exceptions
TypeException stays as-is for now because it uses messages that are
incompatible with the way exception messages are displayed.

closure_038.phpt and a few others now show that we're generating
too many exceptions for compound operations on undefined properties
-- this needs to be fixed in a followup.
2015-05-15 23:40:32 +02:00
Márcio Almada
a54e1237ec add tests for semi reserved words and remove obsolete ones 2015-04-30 03:03:29 -03:00
Dmitry Stogov
5820be029a 0.0 / 0.0 = NaN 2015-04-06 22:03:44 +03:00
Dmitry Stogov
cae0147ed3 Fixed weird operators behavior. Division by zero now emits warning and returns +/-INF, modulo by zero and intdid() throws an exception, shifts by negative offset throw exceptions. Compile-time evaluation of division by zero is disabled. 2015-04-06 14:30:05 +03:00
Nikita Popov
a8bf1c5d8f Throw ParseException from lexer
Primarily to avoid getting fatal errors from token_get_all().

Implemented using a magic E_ERROR token, which the lexer emits to
force a parser failure.
2015-04-02 16:31:17 +02: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
Nikita Popov
6ef9216269 Finish PHP 4 constructor deprecation 2015-03-31 17:55:27 +02:00
Andrea Faulds
db76b708cf Deprecate PHP 4 constructors 2015-03-31 17:55:27 +02:00
Kalle Sommer Nielsen
5e9036a2a1 Another CRLF test fix 2015-03-26 03:18:42 +01:00
Dmitry Stogov
7cf05ce8da Fixed error messages 2015-03-20 17:26:12 +03:00
Anthony Ferrara
0529eeb4a6 Fix executor issue with ignoring strict types, which cleans up a bunch of errors. Additionally fix the expected error of 2 unrelated tests that was caused by a change to the core error messages 2015-03-18 15:22:21 -04:00
Anatol Belski
b9bc84e29e use default test timeout 2015-03-16 23:07:33 +01:00
Anatol Belski
fd51bd4a9e test fixes + added skipif for slow tests 2015-03-16 13:55:40 -07:00
Anatol Belski
042dd8602e use busy sleep instead of sleep() for timeout tests 2015-03-16 13:21:33 -07:00
Anatol Belski
cab21b9347 test timeout with shutdown function, variation 2015-03-16 19:37:07 +01:00
Anatol Belski
1d6f94eeef test timeout with shutdown function 2015-03-16 19:35:36 +01:00
Anatol Belski
33d832bd45 test timeout with foreach loop 2015-03-16 19:30:04 +01:00
Anatol Belski
b05635ade9 test timeout with for loop 2015-03-16 19:28:01 +01:00
Anatol Belski
eab7da4bc9 test timeout with exception variation 2015-03-16 19:26:17 +01:00
Anatol Belski
1c0fce922e test timeout with exception 2015-03-16 19:21:58 +01:00
Anatol Belski
8f1fa842cd fix timeout with cal_user_func 2015-03-16 19:16:09 +01:00
Anatol Belski
7a7d8b9f9d test timeout within eval() 2015-03-16 19:12:55 +01:00
Anatol Belski
82d3a13983 test timeout with array_walk 2015-03-16 19:05:21 +01:00
Anatol Belski
f591c0dff8 test timeout within function 2015-03-16 19:01:23 +01:00
Anatol Belski
394bd2ab41 test timeout within while loop 2015-03-16 18:58:32 +01:00
Dmitry Stogov
ed9c8a23ba More accurate reference counting on closures 2015-03-10 23:04:41 +03:00
Dmitry Stogov
a30d328671 Errors converted to exceptions are not "recoverable" anymore. 2015-03-10 10:31:55 +03:00
Dmitry Stogov
1c94ff0595 Implement engine exceptions
RFC: https://wiki.php.net/rfc/engine_exceptions_for_php7

Pending changes regarding naming of BaseException and whether it
should be an interface.
2015-03-09 14:01:32 +01:00
Reeze Xia
31d5b65c74 Fix test 2015-03-03 22:56:23 +08:00
Michael Wallner
6fed9960a9 fix test 2015-02-18 14:05:45 +01:00
Michael Wallner
84fad268d0 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test
2015-02-18 14:05:10 +01:00
Michael Wallner
23e4af185a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix test
2015-02-18 14:05:02 +01:00
Michael Wallner
8b6919c77c fix test 2015-02-18 14:04:53 +01:00
Michael Wallner
b36581aa75 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #65593 (Segfault when calling ob_start from output buffering callback)
2015-02-18 14:04:19 +01:00
Michael Wallner
0d2a2b98c9 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #65593 (Segfault when calling ob_start from output buffering callback)
2015-02-18 13:59:32 +01:00
Michael Wallner
225af964c0 Fixed bug #65593 (Segfault when calling ob_start from output buffering callback) 2015-02-18 13:58:31 +01:00
Stanislav Malyshev
3551083c2c Merge branch 'pull-request/1007'
* pull-request/1007:
  Fix associativity to match Perl
  Blast off to space.
2015-02-18 08:48:17 +01:00
Dmitry Stogov
4d2a575db2 Stop using internal array/object pointer in foreach by reference according to https://wiki.php.net/rfc/php7_foreach 2015-02-12 14:36:04 +03:00
Dmitry Stogov
97fe15db43 Fix "forech" statemt behaviour according to https://wiki.php.net/rfc/php7_foreach
Squashed commit of the following:

commit 1e41295097
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Sat Jan 31 07:28:58 2015 +0300

    Generalize HashTableIterator API to allows its usage without involvement of HashTable.nInternalPonter

commit 5406f21b11
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:43 2015 +0300

    Reduced alghorithms complexity

commit b37f1d58d2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:30 2015 +0300

    Fixed test name

commit fb2d079645
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:05 2015 +0300

    API cleanup

commit 08302c0d6d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 14:20:46 2015 +0300

    Make array_splice() to preserve foreach hash position

commit cc4b7be41e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 12:24:31 2015 +0300

    Make internal function, operation on array passed by reference, to preserve foreach hash position

commit 5aa9712b0a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 09:49:35 2015 +0300

    Implement consistent behavior for foreach by value over plain object

commit 4c5b385ff5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 07:56:37 2015 +0300

    More careful iterators update.

commit 721fc9e80d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:43:28 2015 +0300

    Added new test

commit 15a23b1218
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:05:02 2015 +0300

    Reimplement iteration magic with HashTableIterators (see https://wiki.php.net/rfc/php7_foreach#implementation_details)

commit 10a3260b1f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:04:44 2015 +0300

    New test

commit eef80c5837
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 16:52:21 2015 +0300

    Fixed foreach by reference iteration over constant array

commit 61e7391873
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 14:59:54 2015 +0300

    Fixed temporary variable re-allocation pass

commit 92e90c09f0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 12:44:57 2015 +0300

    Fixed operand destruction in case of exceptions in iterator

commit dd2a36a207
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 10:02:34 2015 +0300

    Use GET_OP1_ZVAL_PTR_DEREF() (IS_TMP_VAR and IS_CONST can't be IS_REFERENCE)

commit 4638f7b914
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 07:43:28 2015 +0300

    Change "foreach" statement behavior (this is just a PoC yet)

    - "foreach by value" don't relay on internal array/object pointer and doesnt perform array duplication. It just locks it incrementing reference counter. If the original array is modified by some code, the copy on write is performed and "foreach" still work with the old copy.

    - it makes no difference if array given to "foreach by value" is reference itself

    - "foreach by reference" still use internal array/object pointer and should work similar to PHP-5. (This id not completely implemented)
2015-02-12 13:57:12 +03:00
Yasuo Ohgaki
feef180e6c Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed Bug #67988 htmlspecialchars() does not respect default_charset specified by ini_set.

Conflicts:
	main/main.c
	tests/basic/encoding.phpt
2015-02-03 19:00:13 +09:00
Yasuo Ohgaki
436ba1c488 Fixed Bug #67988 htmlspecialchars() does not respect default_charset specified by ini_set. 2015-02-03 18:52:46 +09:00
Andrea Faulds
797dee59cd Blast off to space. 2015-01-29 17:56:09 +00:00
Nikita Popov
cb9c99ebd0 Remove preg_replace /e modifier 2015-01-26 21:00:23 +01:00
Nikita Popov
4d3e4d3bf9 Remove assignment of new by reference 2015-01-26 21:00:22 +01:00
Andrea Faulds
5f29b98051 Error on invalid octal (fixes PHPSadness #31)
Further error checks
2015-01-17 18:50:28 +00:00
Kalle Sommer Nielsen
334b9718d5 Fix tests I broke with the E_ERROR > E_RECOVERABLE_ERROR change 2014-12-29 07:54:44 +01:00
Andrea Faulds
e5eb9530ab Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
Andrea Faulds
bae46f307c Unicode Codepoint Escape Syntax 2014-12-19 00:40:59 +00: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
Anatol Belski
3d68d843cb Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fixed bug #65230 setting locale randomly broken
2014-12-06 12:01:09 +01:00
Anatol Belski
ebaf130a15 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #65230 setting locale randomly broken
2014-12-06 12:00:17 +01:00
Anatol Belski
1b4d5ad46a Fixed bug #65230 setting locale randomly broken 2014-12-06 11:59:43 +01:00
Andrea Faulds
01554bf3e4 Merge branch 'master' into zppFailOnOverflow 2014-11-29 01:45:54 +00:00
Andrea Faulds
ebaa42302a Skip buncha tests on 32-bit 2014-11-29 01:05:19 +00:00
Stanislav Malyshev
d7808ddae4 Merge branch 'PHP-5.6'
* PHP-5.6:
  move tests into proper place
2014-11-24 12:27:04 -08:00
Stanislav Malyshev
faa396c67d Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  move tests into proper place
2014-11-24 12:26:50 -08:00
Stanislav Malyshev
f86aa349eb move tests into proper place 2014-11-24 12:26:20 -08:00
Stanislav Malyshev
be638b22e7 Merge branch 'PHP-5.6'
* PHP-5.6:
  tests image gd
  xmlwriter_full_end_element tests
  Tests for writeAttributeNS and xmlwriter_write_attribute_ns
2014-11-23 17:53:00 -08:00
Stanislav Malyshev
90445ba4a4 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  tests image gd
  xmlwriter_full_end_element tests
  Tests for writeAttributeNS and xmlwriter_write_attribute_ns
2014-11-23 17:52:50 -08:00
marcosptf
49a133dd0b test to function addcslashes
test to function bin2hex
2014-11-23 17:19:56 -08:00
marcosptf
2917c70252 test 2014-11-23 17:19:47 -08:00
Veres Lajos
4b9535341a typo fixes - https://github.com/vlajos/misspell_fixer 2014-11-19 20:23:00 +00:00
Nikita Popov
e756333bbb Remove <% and <script language="php"> tags
As per https://wiki.php.net/rfc/remove_alternative_php_tags.

Removes:
 * <% opening tag
 * %> closing tag
 * <%= short opening tag
 * /<script\s+language\s*=\s*(php|"php"|'php')\s*>/i opening tag
 * /</script>/i closing tag
 * asp_tags ini directive
2014-10-05 21:57:05 +02:00
Dmitry Stogov
2e1b8ba4b7 Moved checks and error reporting related to static methods from DO_FCALL inti INTI_FCALL* opcodes that may really deal with static methods. (In some rare cases it may lead to different order of warning messages). 2014-10-04 14:55:44 +04:00
Nikita Popov
5831cca957 Mark three foreach tests as XFAIL
A lot of work is needed to properly handle all foreach edge cases,
which is not going to happen anytime soon. So marking these tests
as XFAIL for now.
2014-10-03 22:02:02 +02:00
Andrea Faulds
2d069f640e Merge branch 'coalesce_operator'
* coalesce_operator:
  Extended coalesce operator test case for ordering/short-circuiting
  Ensure not evaluated twice
  Added test
  Initial coalesce operator implementation
2014-09-28 00:07:04 +01:00
Andrea Faulds
ec39802e4e Extended coalesce operator test case for ordering/short-circuiting 2014-09-23 16:28:02 +01:00
Andrea Faulds
12b15e5ca4 Merge branch 'master' into integer_semantics 2014-09-21 00:29:48 +01:00
Florian MARGAINE
8eb7e7bf7f Merge branch 'master' into issue-67910
Conflicts:
	README.PARAMETER_PARSING_API
	ext/gmp/tests/001.phpt
2014-09-20 10:09:21 +02:00
Florian MARGAINE
cf0303e782 Replaces php5 with php7, without whitespace changes. 2014-09-20 10:01:44 +02:00
Andrea Faulds
157da54e82 Ensure not evaluated twice 2014-09-16 19:32:01 +01:00
Andrea Faulds
a1711cee17 Added test 2014-09-16 19:20:15 +01:00
Andrea Faulds
db72160e5a Merge branch 'master' into integer_semantics
Conflicts:
	Zend/zend_operators.h
2014-09-16 13:45:06 +01:00
Nikita Popov
828fe35381 Fix string increment 2014-09-05 12:45:42 +02:00
Marcelo Diniz
cba1150cdb tests image gd 2014-08-23 16:55:55 -03:00
Andrea Faulds
59f6cec3dd Updated 32-bit << test 2014-08-19 21:28:26 +01:00
Andrea Faulds
821ca32a6f Updated << 64-bit tests 2014-08-19 20:21:24 +01:00
Andrea Faulds
6a58f270d8 Updated >> 64-bit tests 2014-08-19 20:21:23 +01:00
Andrea Faulds
2f5e508e39 Fixed 32-bit test 2014-08-19 20:21:23 +01:00
Andrea Faulds
4fb5a983a3 Fixed 64-bit tests 2014-08-19 20:21:22 +01:00
Nikita Popov
904a83a137 Merge remote-tracking branch 'php-src/master' into ast
Conflicts:
	ext/opcache/Optimizer/optimize_func_calls.c
2014-08-16 22:31:13 +02:00
Nikita Popov
71675a4bf8 Merge remote-tracking branch 'php-src/phpng' into ast
Conflicts:
	Zend/zend_ast.c
	Zend/zend_compile.c
	Zend/zend_language_parser.y

Incomplete merge!
2014-08-16 21:55:08 +02:00
Nikita Popov
e607215e47 Fix tests to account for warnings moved from RT to CT 2014-08-15 18:44:39 +02:00
Nikita Popov
f7e5308f4b Fix test to conform with UVS changes 2014-08-15 18:31:54 +02:00
Nikita Popov
7d8383149a Fix list() test wrt new assignment order 2014-08-15 18:25:58 +02:00
Nikita Popov
c4460dd162 Restore old evaluation order
${a()}[b()][c()] = d() will now evaluate in order a, b, c, d.
2014-08-15 17:10:06 +02:00
Dmitry Stogov
3bd32efb3e Behavoir of func_get_arg() and func_get_args() was changed in PHP7.
Now they show current values of variables corresponded to passed arguments instead of originally passed values.
2014-08-15 11:39:50 +04:00
Dmitry Stogov
7301994c28 Merge branch 'master' into phpng
* master: (46 commits)
  PHP_INT_MIN and _MAX tests
  NEWS and UPGRADING
  Added PHP_INT_MIN
  Fix wrong lenght size
  Bug #51096 - Remove unnecessary ? for first/last day of
  Moved streams related functions to xp_ssl.c
  Remove duplicate NEWS
  Update NEWS
  Update NEWS
  Update NEWS
  BFN
  BFN
  Fixed bug #67715 (php-milter does not build and crashes randomly).
  We need to turn off any strict mode here for this warning to show up
  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
  Revert "Fix bug #67064 in a BC safe way"
  Updated NEWS for #67693
  Updated NEWS for #67693
  Fixed bug #67693 - incorrect push to the empty array
  add missing entry to NEWS
  ...

Conflicts:
	Zend/tests/errmsg_040.phpt
	Zend/tests/ns_059.phpt
	Zend/zend_language_parser.y
	Zend/zend_vm_def.h
	ext/openssl/openssl.c
	ext/reflection/php_reflection.c
	ext/session/session.c
	ext/spl/spl_directory.c
	ext/spl/spl_iterators.c
	ext/sqlite3/sqlite3.c
	ext/standard/array.c
2014-08-04 13:56:27 +04:00
Andrea Faulds
fe894c2154 PHP_INT_MIN and _MAX tests 2014-08-01 17:01:17 +01:00
Nikita Popov
60d96d5117 Fix code in test 2014-07-26 18:39:40 +02:00
Nikita Popov
0406b4d494 Update error message 2014-07-26 18:38:54 +02:00
Rasmus Lerdorf
55069b4c09 The test output is dependent on expose_php ini 2014-07-14 07:21:10 -07:00
Rasmus Lerdorf
5d391be285 The test output is dependent on expose_php ini 2014-07-14 07:17:59 -07:00
Dmitry Stogov
32e477c98c Merge branch 'master' into phpng
* master: (40 commits)
  Bug #67609: TLS connections fail behind HTTP proxy
  Updated NEWS for #67594
  Updated NEWS for #67594
  Fix #67594 - invisible colon should be stripped off header name
  Updated NEWS for 34407
  Updated NEWS for 34407
  Updated NEWS for 34407
  Fix for bug #34407 - ucwords and title case
  fixed broken merged code
  Fixed a bug that cannot access custom request header stored in apache_request_headers() though array index.
  fixed broken merged code
  Fixed a bug that cannot access custom request header stored in apache_request_headers() though array index.
  Fixed a bug that cannot access custom request header stored in apache_request_headers() though array index.
  Fixed a bug that cannot access custom request header stored in apache_request_headers() though array index.
  Test output relies on expose_php being on
  1.2 is a problematic float to print out Lower the default display precision for this test
  The test output is dependent on expose_php ini
  fix makefile in phpize mode
  fixe output_as_table() when no ext was enabled
  fix end of stream exception when generating makefile
  ...

Conflicts:
	ext/standard/http_fopen_wrapper.c
	ext/standard/string.c
	sapi/cli/php_cli_server.c
2014-07-14 11:44:53 +04:00
Rasmus Lerdorf
e6fae4ca4f The test output is dependent on expose_php ini 2014-07-11 09:12:32 -07: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
Bob Weinand
02bea01f3d Merge branch 'PHP-5.6' 2014-06-15 23:56:14 +02:00