Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ensinando OO a base do fodase Rev 123123123
<?php
class Fodase {
public static function vaiCaralho() {
echo "vai caralho";
}
}
Fodase::vaiCaralho();
class Chatter extends Fodase
{
public $name;
private $messagesCount = 0;
private $lastSeen;
public function __construct(string $name) {
$this->name = $name;
$this->vaiCaralho();
}
public function sendMessage(string $message)
{
$this->messagesCount++;
echo "[". date('Y-m-d') ."]" . $this->name . ": " . $message . PHP_EOL;
}
public function getMessagesCount() {
return $this->messagesCount . PHP_EOL;
}
}
$danielhe4rt = new Chatter('danielhe4rt');
$buuh = new Chatter('buh');
$danielhe4rt->sendMessage('vai toma no cu nessa porra odeio programa');
$buuh->sendMessage('PO TO ENTENDENDO SEPA ESPERO Q ESTEJA');
$buuh->sendMessage('PO TO ENTENDENDO SEPA ESPERO Q ESTEJA');
$buuh->sendMessage('PO TO ENTENDENDO SEPA ESPERO Q ESTEJA');
$buuh->sendMessage('PO TO ENTENDENDO SEPA ESPERO Q ESTEJA');
echo $buuh->getMessagesCount();
$buuh->vaiCaralho();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment