This file contains hidden or 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 SingletonClass | |
{ | |
private static ?SingletonClass $instance = null; | |
private int $counter; | |
private function __construct() | |
{ | |
$this->counter = 0; |
This file contains hidden or 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 | |
echo '<h3>Family Tree Exercise</h3>'; | |
$family8 = ['member1' => 'Aethelflaed', 'member2' => '???', 'offspring' => []]; | |
$family7 = ['member1' => 'Edward', 'member2' => '???', 'offspring' => []]; | |
$family6 = ['member1' => 'Aethelwold', 'member2' => '???', 'offspring' => []]; | |
$family5 = ['member1' => 'Athelstan', 'member2' => '???', 'offspring' => []]; | |
$family4 = ['member1' => 'Alfred', 'member2' => 'Ealswith', 'offspring' => [$family7, $family8]]; | |
$family3 = ['member1' => 'Aethelred', 'member2' => 'Wulfthryth', 'offspring' => [$family6]]; | |
$family2 = ['member1' => 'Aethelwulf', 'member2' => 'Osburga', 'offspring' => [$family3, $family4, $family5]]; | |
$family1 = ['member1' => 'Egbert', 'member2' => 'Redburga', 'offspring' => [$family2]]; |
This file contains hidden or 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 | |
echo '<h2>Exercise</h2>'; | |
$monday = ['Soup' => 3, 'Ramen' => 5, 'Burger' => 10]; | |
$tuesday = ['Burger' => 5, 'Waffle' => 10, 'Pizza' => 10]; | |
$wednesday = ['Sandwich' => 5, 'Hotdog' => 7, 'Ramen' => 10]; | |
$thursday = ['Ramen' => 5, 'Pizza' => 7, 'Soup' => 10]; | |
$friday = []; | |
$weekExpenses = |
This file contains hidden or 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 | |
$currentKeys = 2; | |
$maxKeyCapacity = 2; | |
$currentPotions = 4; | |
$maxPotionCapacity = 5; | |
$currentInventoryCapacity = $currentKeys + $currentPotions; | |
$maxInventoryCapacity = 10; | |
// New item incoming | |
$newItemType = 'potion'; |
This file contains hidden or 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
[XDebug] | |
zend_extension = "C:\xampp\php\ext\php_xdebug-3.0.4-8.0-vs16-x86_64.dll" | |
xdebug.mode = debug | |
xdebug.stopOnEntry = true | |
xdebug.start_with_request = yes | |
xdebug.client_host = "127.0.0.1" | |
xdebug.client_port = 9000 |
This file contains hidden or 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
<VirtualHost dev.example.com:80> | |
ServerName dev.example.com | |
DocumentRoot "C:/xampp/htdocs/dev.example.com/public" | |
<Directory "C:/xampp/htdocs/dev.example.com/public"> | |
Require all granted | |
AllowOverride All | |
</Directory> | |
ErrorLog "logs/dev.example.com-error.log" | |
CustomLog "logs/dev.example.com-access.log" combined |