diff options
| author | Jakub Zelenka <bukka@php.net> | 2016-06-19 17:05:48 +0100 |
|---|---|---|
| committer | Jakub Zelenka <bukka@php.net> | 2016-06-19 17:05:48 +0100 |
| commit | e63a8540a60e95aa5bd8e269add1b02afcc1b79b (patch) | |
| tree | b83a144eec24cc81adab0b9a778f7a730d8df79e /Zend/tests/method_argument_binding.phpt | |
| parent | 7a4cc73641bb3eb878f7184bcbd026ee663cf2a9 (diff) | |
| parent | 53071e647049f099f7f7a0771ddb63fc2cdd621c (diff) | |
| download | php-git-e63a8540a60e95aa5bd8e269add1b02afcc1b79b.tar.gz | |
Merge branch 'openssl_error_store' into openssl_aead
Diffstat (limited to 'Zend/tests/method_argument_binding.phpt')
| -rw-r--r-- | Zend/tests/method_argument_binding.phpt | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Zend/tests/method_argument_binding.phpt b/Zend/tests/method_argument_binding.phpt new file mode 100644 index 0000000000..731cc4fb32 --- /dev/null +++ b/Zend/tests/method_argument_binding.phpt @@ -0,0 +1,47 @@ +--TEST-- +Edge cases in compile-time method argument binding +--FILE-- +<?php + +class A { + private function method($x) {} +} + +class B extends A { + public function test() { + $x = 1; + $this->method($x); + var_dump($x); + } +} + +class C extends B { + public function method(&$x) { + ++$x; + } +} + +(new C)->test(); + +class D { + private final function method(&$x) { + ++$x; + } +} + +class E extends D { + public function __call($name, $args) { } + + public function test() { + $this->method($x); + } +} + +(new E)->test(); + +?> +--EXPECTF-- +Warning: Declaration of C::method(&$x) should be compatible with A::method($x) in %s on line %d +int(2) + +Notice: Undefined variable: x in %s on line %d |
