Skip to content

Instantly share code, notes, and snippets.

@MN-dev
Created December 11, 2016 22:48
Show Gist options
  • Save MN-dev/8afe021d827882f9e5e55a786b7100fe to your computer and use it in GitHub Desktop.
Save MN-dev/8afe021d827882f9e5e55a786b7100fe to your computer and use it in GitHub Desktop.
<?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