PHPackages                             lpeltier/struct - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lpeltier/struct

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

lpeltier/struct
===============

v2.1.1(7y ago)03.3k↓50%MITPHPPHP ^7.2

Since Jul 15Pushed 7y agoCompare

[ Source](https://github.com/L-P/struct)[ Packagist](https://packagist.org/packages/lpeltier/struct)[ RSS](/packages/lpeltier-struct/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

struct
======

[](#struct)

struct-like trait for PHP.

Usage
-----

[](#usage)

Create a struct by using the `struct` trait in a class and declaring **public**properties. You can then read and write those properties using the arrow (`->`) operator. Any attempt to access an undefined, protected, or private property will result in an exception.
You can also use the constructor to set all properties at once.

Example:

```
