stscoundrel/struct: Structs for PHP

planted on in: Nifty Show and Tell and PHP.

https://github.com/stscoundrel/struct

While we wait for PHP: rfc:structs to make some traction there are other solutions that attempt to bring Structs to #PHP. This one by Sampo Silvennoinen provides an AbstractStruct class which can be extended to produce struct like behaviour. For example:

class Employee extends AbstractStruct
{
public string $name;
public string $department;
public int $salary;
}
Page History

This page was first added to the repository on April 27, 2024 in commit 287e833a. View the source on GitHub.