com php-src: Added test (failed with valgrind): Zend/tests/type _declarations/typed_properties_056.phpt

From: Date: Wed, 25 May 2016 16:36:37 +0000
Subject: com php-src: Added test (failed with valgrind): Zend/tests/type _declarations/typed_properties_056.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95511@lists.php.net to get a copy of this message
Commit: d7f313e5c320758264bb4599ec6cfb347e07f797 Author: Dmitry Stogov <dmitry@zend.com> Wed, 25 May 2016 19:36:37 +0300 Parents: 56e2aaa11e8c13e95ddf6e1d7dfb9b1823c25c48 Branches: typed_ref_properties Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d7f313e5c320758264bb4599ec6cfb347e07f797 Log: Added test (failed with valgrind) Changed paths: A Zend/tests/type_declarations/typed_properties_056.phpt Diff: diff --git a/Zend/tests/type_declarations/typed_properties_056.phpt b/Zend/tests/type_declarations/typed_properties_056.phpt new file mode 100644 index 0000000..e6d6e63 --- /dev/null +++ b/Zend/tests/type_declarations/typed_properties_056.phpt @@ -0,0 +1,23 @@ +--TEST-- +Type change in assign_op (use-after-free) +--FILE-- +<?php +declare(strict_types=1); + +class A { + public string $foo; +} + +$o = new A; +$o->foo = "1" . str_repeat("0", 2); +try { + $o->foo += 5; +} catch (Throwable $e) { + echo $e->getMessage() . "\n"; +} +var_dump($o->foo); +unset($o); +?> +--EXPECT-- +Typed property A::$foo must be string, integer used +string(3) "100" \ No newline at end of file

« previous php.cvs (#95511) next »