1
resposta

Erro teste-saque.php

C:\Users\Daniela Conceiçao\Documents\Alura curso\PHP>php teste-saque.php
PHP Fatal error:  Uncaught Error: Cannot instantiate abstract class Alura\Banco\Modelo\Conta\Conta in C:\Users\Daniela Conceiçao\Documents\Alura curso\PHP\teste-saque.php:13
Stack trace:
#0 {main}
  thrown in C:\Users\Daniela Conceiçao\Documents\Alura curso\PHP\teste-saque.php on line 13

Fatal error: Uncaught Error: Cannot instantiate abstract class Alura\Banco\Modelo\Conta\Conta in C:\Users\Daniela Conceiçao\Documents\Alura curso\PHP\teste-saque.php:13
Stack trace:
#0 {main}
  thrown in C:\Users\Daniela Conceiçao\Documents\Alura curso\PHP\teste-saque.php on line 13

C:\Users\Daniela Conceiçao\Documents\Alura curso\PHP>
<?php


use Alura\Banco\Modelo\Conta\{ContaPoupanca, ContaCorrente, Titular};
use Alura\Banco\Modelo\{CPF, Endereco}; 

require_once 'autoload.php';

$conta = new ContaCorrente(
    new Titular (
        new CPF('123.456.789-10'),
        'Daniela Santos', 
        new Endereco('Petropolis', 'Bairro teste', 'Rua lá', '34')
    )
);

$conta->depositar(500);
$conta->sacar(100);

echo $conta->recuperaSaldo();
1 resposta

Daniela, esse é o conteúdo do arquivo teste-saque.php? Pela mensagem de erro, não parece ser...