Created
May 6, 2021 00:00
-
-
Save DanielHe4rt/d4284ad7f049ee2dbb8196ed239e056c to your computer and use it in GitHub Desktop.
Ensinando OO a base do fodase Rev 123123123
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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