PHPackages                             arashdalir/php-classfriendship - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. arashdalir/php-classfriendship

ActiveLibrary

arashdalir/php-classfriendship
==============================

This library provides basic functionality needed to simulate class friendship as in C++.

v1.3.0(5mo ago)0445↓100%PHPPHP ^5.6 || ^7.0 || ^8.0

Since Jun 12Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/arashdalir/php-classfriendship)[ Packagist](https://packagist.org/packages/arashdalir/php-classfriendship)[ RSS](/packages/arashdalir-php-classfriendship/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

ClassFriendship
===============

[](#classfriendship)

`ArashDalir/ClassFriendship` provides basic functionality needed to simulate class friendship like in c++.

Install
-------

[](#install)

Use following command to add the repository to your project:

```
composer require arashdalir/php-classfriendship

```

Or add following line to your composer.json:

```
{
  "require": {
     "arashdalir/php-classfriendship": "dev-master"
  }
}
```

Usage
-----

[](#usage)

The classes need to use `trait Friends` in their implementation. A new Friendship can be defined like this:

```
