<?php
class Veiculos {
protected $tipo = "carro";
}
class Veiculo extends Veiculos {
public function tipo_veiculo() {
if ($this->tipo == "carro") {
echo "Você selecionou carro. Escolha a cor.";
} elseif ($this->tipo == "moto") {
echo "Você selecionou moto. Escolha a cor.";
} else {
echo "Você não selecionou nenhum carro.";
}
}
}
$carro = new Veiculo();
echo $carro->tipo_veiculo();
PD9waHAKCmNsYXNzIFZlaWN1bG9zIHsKICAgIHByb3RlY3RlZCAkdGlwbyA9ICJjYXJybyI7Cn0KCmNsYXNzIFZlaWN1bG8gZXh0ZW5kcyBWZWljdWxvcyB7CiAgICBwdWJsaWMgZnVuY3Rpb24gdGlwb192ZWljdWxvKCkgewogICAgICAgIGlmICgkdGhpcy0+dGlwbyA9PSAiY2Fycm8iKSB7CiAgICAgICAgICAgIGVjaG8gIlZvY8OqIHNlbGVjaW9ub3UgY2Fycm8uIEVzY29saGEgYSBjb3IuIjsKICAgICAgICB9IGVsc2VpZiAoJHRoaXMtPnRpcG8gPT0gIm1vdG8iKSB7CiAgICAgICAgICAgIGVjaG8gIlZvY8OqIHNlbGVjaW9ub3UgbW90by4gRXNjb2xoYSBhIGNvci4iOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGVjaG8gIlZvY8OqIG7Do28gc2VsZWNpb25vdSBuZW5odW0gY2Fycm8uIjsKICAgICAgICB9CiAgICB9Cn0KJGNhcnJvID0gbmV3IFZlaWN1bG8oKTsKZWNobyAkY2Fycm8tPnRpcG9fdmVpY3VsbygpOwo=