diff options
| author | Xinchen Hui <laruence@gmail.com> | 2017-11-25 00:54:15 +0800 |
|---|---|---|
| committer | Xinchen Hui <laruence@gmail.com> | 2017-11-25 00:54:15 +0800 |
| commit | c412b8b3844b1881a952e1340dba23288a943f96 (patch) | |
| tree | f1f814d0a01008a2cb65300ded03551129369271 | |
| parent | 0dbb327d705b61e068b4ea7617bae79fc69488d1 (diff) | |
| download | php-git-c412b8b3844b1881a952e1340dba23288a943f96.tar.gz | |
Fixed bug #75556 (Invalid opcode 138/1/1)
| -rw-r--r-- | NEWS | 3 | ||||
| -rw-r--r-- | ext/opcache/Optimizer/zend_optimizer.c | 2 | ||||
| -rw-r--r-- | ext/opcache/tests/bug75556.phpt | 26 |
3 files changed, 31 insertions, 0 deletions
@@ -9,6 +9,9 @@ PHP NEWS . Fixed bug #74862 (Unable to clone instance when private __clone defined). (Daniel Ciochiu) +- Opcache: + . Fixed bug #75556 (Invalid opcode 138/1/1). (Laruence) + - PCRE: . Fixed bug #74183 (preg_last_error not returning error code after error). (Andrew Nester) diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c index f55aa41428..d50503d4c5 100644 --- a/ext/opcache/Optimizer/zend_optimizer.c +++ b/ext/opcache/Optimizer/zend_optimizer.c @@ -306,6 +306,8 @@ int zend_optimizer_update_op1_const(zend_op_array *op_array, /* This would require a non-local change. * zend_optimizer_replace_by_const() supports this. */ return 0; + case ZEND_INSTANCEOF: + return 0; case ZEND_CASE: case ZEND_FETCH_LIST: return 0; diff --git a/ext/opcache/tests/bug75556.phpt b/ext/opcache/tests/bug75556.phpt new file mode 100644 index 0000000000..1b2511c580 --- /dev/null +++ b/ext/opcache/tests/bug75556.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #75556 (Invalid opcode 138/1/1) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=-1 +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php + function createFromFormat($format, $date, ?\DateTimeZone $tz = null): ?\DateTimeInterface + { + if ($tz !== null + || ($tz instanceof \DateTimeZone && !in_array($tz->getName(), ['UTC', 'Z'], true)) + ) { + $msg = 'Date objects must have UTC as their timezone'; + throw new \UnexpectedValueException($msg); + } + + return null; +} + +var_dump(createFromFormat('m/d/Y', '12/07/2017', null)); +?> +--EXPECT-- +NULL |
