Mam dwa pliki:
data.class.php<?php
class Data
{
public $sMessage;
private $sSecret;
public function __construct($sInput)
{
echo '<br/><br/><b>Odpaliłem konstruktor klasy Data()...</b>'; $this->sMessage = $sInput;
}
public function setSecret()
{
$this->sSecret = md5($this->sMessage); }
public function getSecret()
{
return $this->sSecret;
}
public function getMessage()
{
return $this->sMessage;
}
}
$oData = new Data('Tajny string...');
$oData->setSecret();
echo '<br/>Message: ' . $oData->getMessage(); echo '<br/>Secret: ' . $oData->getSecret()
?>
oraz
index.php<?php
// data.class.php
{
if ($rHandle = @fopen('data.class.php', 'r')) {
if (flock($rHandle, LOCK_SH
)) {
flock($rHandle, LOCK_UN
); }
}
}
$sText = $sFile;
// base64_encode()
?>
Wywołując funkcję eval() dostaję błąd. W którym miejscu popełniam błąd?
Natomiast coś takiego
<?php
?>
działa bez problemu..