summaryrefslogtreecommitdiff
path: root/Zend/tests/assert
diff options
context:
space:
mode:
authorJakub Zelenka <bukka@php.net>2016-06-19 17:05:48 +0100
committerJakub Zelenka <bukka@php.net>2016-06-19 17:05:48 +0100
commite63a8540a60e95aa5bd8e269add1b02afcc1b79b (patch)
treeb83a144eec24cc81adab0b9a778f7a730d8df79e /Zend/tests/assert
parent7a4cc73641bb3eb878f7184bcbd026ee663cf2a9 (diff)
parent53071e647049f099f7f7a0771ddb63fc2cdd621c (diff)
downloadphp-git-e63a8540a60e95aa5bd8e269add1b02afcc1b79b.tar.gz
Merge branch 'openssl_error_store' into openssl_aead
Diffstat (limited to 'Zend/tests/assert')
-rw-r--r--Zend/tests/assert/expect_015.phpt2
-rw-r--r--Zend/tests/assert/indirect_var_access_misoptimization.phpt19
2 files changed, 20 insertions, 1 deletions
diff --git a/Zend/tests/assert/expect_015.phpt b/Zend/tests/assert/expect_015.phpt
index 030913f7f9..0c53c75c4d 100644
--- a/Zend/tests/assert/expect_015.phpt
+++ b/Zend/tests/assert/expect_015.phpt
@@ -154,7 +154,7 @@ Warning: assert(): assert(0 && ($a = function () {
$x = $a ? $b : $c;
$x = $a ?: $c;
$x = $a ?? $b;
- list($a, $b, $c) = [1, 2 => 'x', 'z' => 'c'];
+ [$a, $b, $c] = [1, 2 => 'x', 'z' => 'c'];
@foo();
$y = clone $x;
yield 1 => 2;
diff --git a/Zend/tests/assert/indirect_var_access_misoptimization.phpt b/Zend/tests/assert/indirect_var_access_misoptimization.phpt
new file mode 100644
index 0000000000..61c193ab60
--- /dev/null
+++ b/Zend/tests/assert/indirect_var_access_misoptimization.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Misoptimization when variable is modified by assert()
+--INI--
+zend.assertions=1
+--FILE--
+<?php
+
+function test() {
+ $i = 0;
+ assert('$i = new stdClass');
+ $i += 1;
+ var_dump($i);
+}
+test();
+
+?>
+--EXPECTF--
+Notice: Object of class stdClass could not be converted to int in %s on line %d
+int(2)