Deprecated: Return type of Carro::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/4HmUZ on line 29
object(Carro)#1 (3) {
["motor":"Carro":private]=>
object(Peca)#2 (3) {
["marca":"Peca":private]=>
string(2) "VW"
["modelo":"Peca":private]=>
string(3) "1.8"
["preco":"Peca":private]=>
float(15000)
}
["pneus":"Carro":private]=>
object(Peca)#3 (3) {
["marca":"Peca":private]=>
string(2) "VW"
["modelo":"Peca":private]=>
string(2) "P7"
["preco":"Peca":private]=>
float(500)
}
["amortecedor":"Carro":private]=>
object(Peca)#4 (3) {
["marca":"Peca":private]=>
string(2) "VW"
["modelo":"Peca":private]=>
string(2) "ar"
["preco":"Peca":private]=>
float(1000)
}
}
Output for 8.3.5
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
Deprecated: Return type of Carro::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/4HmUZ on line 29
object(Carro)#1 (3) {
["motor":"Carro":private]=>
object(Peca)#2 (3) {
["marca":"Peca":private]=>
string(2) "VW"
["modelo":"Peca":private]=>
string(3) "1.8"
["preco":"Peca":private]=>
float(15000)
}
["pneus":"Carro":private]=>
object(Peca)#3 (3) {
["marca":"Peca":private]=>
string(2) "VW"
["modelo":"Peca":private]=>
string(2) "P7"
["preco":"Peca":private]=>
float(500)
}
["amortecedor":"Carro":private]=>
object(Peca)#4 (3) {
["marca":"Peca":private]=>
string(2) "VW"
["modelo":"Peca":private]=>
string(2) "ar"
["preco":"Peca":private]=>
float(1000)
}
}
Parse error: syntax error, unexpected 'Peca' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /in/4HmUZ on line 5
Process exited with code 255.