<?php
trait T1 {
function UPPERCASE() { }
function UPPERCASE1() { }
}
trait T2 {
use T1 { UPPERCASE as Trait1_Camelcase; }
function UPPERCASE() { }
function UPPERCASE2() { }
}
class C {
use T2 { UPPERCASE as Trait2_Camelcase; }
function UPPERCASEC() { }
}
var_dump(get_class_methods("C"));
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
array(6) {
[0]=>
string(10) "UPPERCASEC"
[1]=>
string(16) "Trait2_Camelcase"
[2]=>
string(9) "UPPERCASE"
[3]=>
string(10) "UPPERCASE2"
[4]=>
string(16) "Trait1_Camelcase"
[5]=>
string(10) "UPPERCASE1"
}
Fatal error: Trait method Trait2_Camelcase has not been applied, because there are collisions with other trait methods on C in /in/gqENX on line 17
Process exited with code 255.