]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.0'
authorNikita Popov <nikic@php.net>
Tue, 5 Jul 2016 12:32:49 +0000 (14:32 +0200)
committerNikita Popov <nikic@php.net>
Tue, 5 Jul 2016 12:34:20 +0000 (14:34 +0200)
1  2 
Zend/tests/method_argument_binding.phpt
Zend/zend_inheritance.c

index 731cc4fb325533f9c467a978fa32b644ce98c75c,0000000000000000000000000000000000000000..dea12621a394a5704ac029fd59a29e7893e15ea9
mode 100644,000000..100644
--- /dev/null
@@@ -1,47 -1,0 +1,46 @@@
- Warning: Declaration of C::method(&$x) should be compatible with A::method($x) in %s on line %d
 +--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--
 +int(2)
 +
 +Notice: Undefined variable: x in %s on line %d
Simple merge