Ex5 - 31
This commit is contained in:
30
Aufgabe_29/index.php
Normal file
30
Aufgabe_29/index.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<!-- Ziel ist hier, unten eigenen Code einzufügen, welcher die obere Klasse verwendet. Auf dem Bild zu dieser Aufgabe finden Sie die gewollte Ausgabe. -->
|
||||
|
||||
<?php
|
||||
|
||||
class Ex
|
||||
{
|
||||
private string $setString;
|
||||
|
||||
function SetString(string $str)
|
||||
{
|
||||
$setString = $str;
|
||||
throw new Exception("Problem beim Setzen des Strings!");
|
||||
}
|
||||
|
||||
function ShowString()
|
||||
{
|
||||
echo "<p>".$setString."</p>";
|
||||
throw new Exception("Problem beim Zeigen des Strings!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//1. Erstellen der Instanz
|
||||
$cl = new Ex;
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user