php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #64235
Patch deny_use_with_classes.patch revision 2013-02-21 09:09 UTC by laruence@php.net
Patch bug64235.patch revision 2013-02-20 08:07 UTC by laruence@php.net
revision 2013-02-20 07:39 UTC by laruence@php.net
Patch bug64235.phpt revision 2013-02-20 07:41 UTC by laruence@php.net

Patch bug64235.phpt for Scripting Engine problem Bug #64235

Patch version 2013-02-20 07:41 UTC

Return to Bug #64235 | Download this patch
Patch Revisions:

Developer: laruence@php.net

--TEST--
Bug #64235 (Insteadof not work for class method in 5.4.11)
--FILE--
<?php

class TestParentClass
{
    public function method()
    {
        print_r('Parent method');
        print "\n";
    }
}

trait TestTrait
{
    public function method()
    {
        print_r('Trait method');
        print "\n";
    }
}

class TestChildClass extends TestParentClass
{
    use TestTrait
    {
        TestTrait::method as methodAlias;
        TestParentClass::method insteadof TestTrait;
    }
}

(new TestChildClass)->method();
(new TestChildClass)->methodAlias();
?>
--EXPECT--
Parent method
Trait method
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 15:01:30 2024 UTC