Commit Graph

582 Commits

Author SHA1 Message Date
Aaron Piotrowski
110e0a5a2c Merge branch 'master' into throwable-interface
# Conflicts:
#	Zend/zend_language_scanner.c
#	Zend/zend_language_scanner.l
#	ext/simplexml/tests/SimpleXMLElement_xpath.phpt
2015-06-14 18:53:11 -05:00
Dmitry Stogov
1c754f0b71 Get rid of more ZVAL_ZVAL() macros 2015-06-12 13:33:14 +03: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
Ferenc Kovacs
7ec3016e29 fix hard-coded path in test 2015-06-09 16:42:02 +02:00
Anatol Belski
f378b9a998 fix test title 2015-05-18 22:37:31 +02:00
Anatol Belski
6fe4f18dcd fork test for ICU >= 55.1 compat 2015-05-18 22:37:29 +02:00
Anatol Belski
8af0de914f sync test with exception currently thrown 2015-05-18 22:37:28 +02:00
Anatol Belski
d3515bdef0 fork test for ICU >= 55.1 compat 2015-05-18 22:37:26 +02:00
Anatol Belski
bb27f4ca8b fork test for ICU >= 55.1 compat 2015-05-18 22:37:25 +02:00
Anatol Belski
83f98277c2 skip test for ICU >= 55.1, a newer test is available and passes 2015-05-18 22:37:23 +02:00
Anatol Belski
3658412814 fork test for ICU >= 55.1 compat 2015-05-18 22:37:22 +02:00
Anatol Belski
30be2e654e fork test for ICU >= 55.1 compat 2015-05-18 22:37:21 +02:00
Aaron Piotrowski
e97d5fab35 Update exception names in tests after formatting changes. 2015-05-17 17:31:43 -05:00
Aaron Piotrowski
fb7206e452 Merge branch 'master' into throwable-interface 2015-05-17 16:15:35 -05:00
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
434a46612e Fix a few missed tests. 2015-05-16 22:04:16 -05: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
Dmitry Stogov
e96616739c Fixed redundand internal constructor behavior (they shouldn't return NULL anymore) 2015-05-07 10:38:47 +03:00
Nikita Popov
e74b84a9fe Fix Intl constructor leaks
Drop the Z_OBJ(return_value) = NULL hack and return status code
from ctor function instead.
2015-04-17 10:33:59 +02:00
Nikita Popov
25affa8a0f Fix leak in transliterator_transliterate() 2015-04-17 10:33:58 +02:00
Nikita Popov
8138756295 Fix leak in IntlDateFormatter::getTimeZone() 2015-04-17 09:28:38 +02:00
Nikita Popov
4e2be45309 Fix leak in IntlCalendar::fromDateTime() 2015-04-17 09:28:36 +02: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
Anatol Belski
a0eaa37afe missing includes 2015-04-01 13:39:25 +02:00
Anatol Belski
e271ace5f8 fix extern "C"
now, it shouldn't matter where intl_common.h is included,
not need for extra putting it into extern C
2015-04-01 13:18:52 +02:00
Anatol Belski
ca1ef2749d C89 compat 2015-04-01 13:18:51 +02:00
Nikita Popov
cf0ffa8e4c Remove datefmt_set_timezone_id and OO variant 2015-04-01 12:34:28 +02:00
Dmitry Stogov
2afca9f179 Fixed test 2015-03-30 21:48:54 +03: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
Dmitry Stogov
9155a267ad Merge branch 'InternalClassClean' of github.com:Danack/php-src into InternalClassClean
* 'InternalClassClean' of github.com:Danack/php-src:
  Fixed indentation. Fixed comment style. Fixed commented out code.
  Reverted change to function name and added note of why it is different from the class it is actually changing.
  Made UConverter throw an exception if the constructor fails.
  Fixed PDO constructor to not return null.
  Fixed fileinfo behaviour.
  Made Phar throw exception on bad constructor.
  Converted intl extension to use IntlException in constructors.
  Fixed SplFixedArray and tests.
  Fixed ReflectionExtension and ReflectionProperty.
  Fixed ReflectionFunction, ReflectionMethod and ReflectionParameter.
  Fixed PDORow behaviour and message.
2015-03-30 12:14:43 +03:00
Anatol Belski
2d78023244 cleanup the mod version macros, round 2 2015-03-23 20:33:54 +01:00
Rasmus Lerdorf
f01071f55f Remove extraneous strlen() call 2015-03-21 08:26:06 -07:00
Danack
910a324306 Fixed indentation. Fixed comment style. Fixed commented out code. 2015-03-16 23:14:56 +00:00
Danack
9803fccfbc Made UConverter throw an exception if the constructor fails. 2015-03-15 15:30:25 +00:00
Danack
99dae96dc0 Converted intl extension to use IntlException in constructors. 2015-03-15 13:59:48 +00:00
Lior Kaplan
a4384bd3d4 s/PHP Version 5/PHP Version 7/g
Follow up for d0cb7153
2015-03-13 11:09:42 +02:00
Dmitry Stogov
8633685675 Use specialized macro for string zval creation 2015-03-12 16:53:51 +03:00
Dmitry Stogov
816b196973 Fixed memory leak 2015-03-10 23:16:09 +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
zxcvdavid
a4a85887e0 Fix compile error 2015-03-04 09:56:50 +08:00
Anatol Belski
af3ca74501 made ZEND_TSRMLS_CACHE_* macros look like function calls
which also comply with the current semantics for such macros
2015-02-16 17:19:32 +01:00
Dmitry Stogov
bc630ad6da Get rid of old HashTable iteration API (it doesn't work with constant arrays) 2015-02-13 20:18:29 +03:00
Xinchen Hui
5f285482ea zend_get_parameters_ex is deprecated 2015-02-13 11:26:40 +08:00
Dmitry Stogov
9e70d7672d Move zend_object->guards into additional slot of zend_object->properties_table[]. As result size of objects without __get/__set/__unset/__isset magic methods is reduced. 2015-02-04 15:24:13 +03:00
Anatol Belski
d2f64edf29 remove unused var 2015-01-30 10:31:37 +01:00
Dmitry Stogov
8aa146b810 Fixed use after free 2015-01-26 12:24:33 +03:00
Stanislav Malyshev
cb6fb59b59 Fix the fix for #68884 2015-01-24 23:07:50 -08:00