mirror of
https://github.com/php/php-src.git
synced 2024-12-12 19:33:31 +08:00
82523c0752
* pr/647: (33 commits) zend_uint -> uint32_t Fix nesting for *non*-compile-time-resolveable functions Seea1a4ba9511 (commitcomment-7414223)
Add tests for calls to nested, *non*-compile-time-resolveable functions Seea1a4ba9511 (commitcomment-7414362)
Make list of opcodes used for nesting calculation consistent with `zend_do_convert_call_user_func()` in Zend/zend_compile.c Rewrite code to use ZEND_VM_JMP() instead of repeated ZEND_VM_INC_OPCODE() calls QA: Simplify code to find matching ZEND_DO_FCALL_BY_NAME CG(context).nested_calls is stored inside the initializer's result.num and inside the finalizer's op2.num, by comparing these we don't need to count manually, and are thus safer from future expansion with specialized opcodes e.g. Fix expected fatal error, now is catchable fatal Adjust expected fatal error message Now also includes "on [TYPE]" after merge from master Check for memory leaks when not using return value Adjust expected fatal error message Now also includes "on [TYPE]" after merge from master Add tests with arrays as parameters Handle ZEND_NEW nesting Also verify nesting with dynamically called static methods Handle ZEND_INIT_NS_FCALL_BY_NAME nesting QA: Refactor: Split tests a bit to make them more comprehendable Support nested static calls Handle ZEND_EXT_FCALL_END, skipping if necessary Verified with running tests with new "-e" run-tests arg: $ make test TESTS=Zend/tests/*-on-non-objects-*phpt TEST_PHP_ARGS=-e # Tests passed : 11 (100.0%) Add support for PHP's 'extended information for debugger/profiler' mode Verify non-CV-operands also work See discussion https://github.com/php/php-src/pull/647#issuecomment-48050551 Only allocate NULL return value if it's actually used ... Conflicts: ext/date/tests/bug67118.phpt
30 lines
652 B
PHP
30 lines
652 B
PHP
--TEST--
|
|
Bug #67118 crashes in DateTime when this used after failed __construct
|
|
--INI--
|
|
date.timezone=Europe/Berlin
|
|
--FILE--
|
|
<?php
|
|
class mydt extends datetime
|
|
{
|
|
public function __construct($time = 'now', $tz = NULL, $format = NULL)
|
|
{
|
|
if (!empty($tz) && !is_object($tz)) {
|
|
$tz = new DateTimeZone($tz);
|
|
}
|
|
try {
|
|
@parent::__construct($time, $tz);
|
|
} catch (Exception $e) {
|
|
echo "Bad date" . $this->format("Y") . "\n";
|
|
}
|
|
}
|
|
|
|
};
|
|
|
|
new mydt("Funktionsansvarig rådgivning och juridik", "UTC");
|
|
?>
|
|
--EXPECTF--
|
|
|
|
Warning: DateTime::format(): The DateTime object has not been correctly initialized by its constructor in %s on line %d
|
|
Bad date
|
|
|