<?php
trait ExampleTrait
{
protected $developer;
public function really()
{
echo 'yep';
}
}
class Work
{
protected $developer;
use ExampleTrait;
public function __construct()
{
$this->developer = 'Aaron';
echo $this->developer;
}
public function really()
{
echo 'noppers';
}
}
$work = new Work();
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Aaron
Strict Standards: Work and ExampleTrait define the same property ($developer) in the composition of Work. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in /in/cDWRn on line 30
Aaron