Created
December 11, 2016 22:48
-
-
Save MN-dev/8afe021d827882f9e5e55a786b7100fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* methods chaining | |
*/ | |
trait name1{ | |
public function feature(){ | |
echo "string1"; | |
} | |
} | |
trait name2{ | |
public function feature(){ | |
echo "string2"; | |
} | |
} | |
class phone{ | |
// trait name :: method name insteadof other method name | |
use name1, name2{ | |
//name1::feature as nameone; | |
// name2::feature as nametow; | |
name1::feature insteadof name2; | |
} | |
} | |
$phone = new phone(); | |
echo "<pre>"; | |
$phone->feature(); | |
print_r($phone); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment