Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*********Compostos***********/
- // array
- $carros = array("Gol","Uno","Camaro",12,20.6,true);
- var_dump($carros);
- if(is_array($carros)):
- echo "É um array";
- else:
- echo "Não é um array";
- endif;
- echo "<hr>";
- // object
- class Cliente {
- public $nome;
- public function atribuirNome($nome) {
- $this->$nome = $nome;
- }
- }
- $cliente = new Cliente();
- $cliente->atribuirNome("Geicy");
- var_dump($cliente);
- if(is_object($cliente)):
- echo "É um object";
- else:
- echo "Não é um object";
- endif;
- echo "<hr>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement