Skip to content

Instantly share code, notes, and snippets.

@exileed
Forked from myvitaliy/index.php
Last active May 14, 2018 15:01
Show Gist options
  • Save exileed/b364207c4b95489f7a5bba944dfd4028 to your computer and use it in GitHub Desktop.
Save exileed/b364207c4b95489f7a5bba944dfd4028 to your computer and use it in GitHub Desktop.
index.php
<?php
namespace twelve;
require_once 'CanMove.php';
class Car
{
use CanMove;
}
<?php
namespace twelve;
trait CanMove
{
public function move()
{
echo 'Движение автомобиля<br>';
}
}
<?php
require_once 'Car.php';
use twelve\Car;
$car = new Car();
$car->move();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment