-
-
Save exileed/b364207c4b95489f7a5bba944dfd4028 to your computer and use it in GitHub Desktop.
index.php
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 | |
namespace twelve; | |
require_once 'CanMove.php'; | |
class Car | |
{ | |
use CanMove; | |
} |
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 | |
namespace twelve; | |
trait CanMove | |
{ | |
public function move() | |
{ | |
echo 'Движение автомобиля<br>'; | |
} | |
} |
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 | |
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