Created
October 5, 2013 12:26
-
-
Save jfranciscos4/6840302 to your computer and use it in GitHub Desktop.
Na classe TellAll, os resultados são imediatamente impresso na tela, se você quer que eles ou não. Para fins de demonstração, isso é bom, mas como um módulo, outros módulos podem simplesmente querer usar as informações sobre o dispositivo e /ou no navegador. Então, como você vai ver, nem todas as classes incluem uma função de construtor.
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 | |
// Saved as TellAll.php | |
class TellAll | |
{ | |
private $_userAgent; | |
public function __construct() | |
{ | |
$this->_userAgent = $_SERVER['HTTP_USER_AGENT']; | |
echo $this->_userAgent; | |
} | |
} | |
$tellAll = new TellAll(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment