aaaa - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of aaaa.php
- <?php
- class MenuElement
- {
- public $id;
- public $children = array();
- public __construct($id)
- {
- $this->id = $id;
- }
- public function addChild(MenuElement $menuElement)
- {
- array_push($this->children, $menuElement);
- }
- }
- $menuElement1 = new MenuElement(1);
- $menuElement11 = new MenuElement(11);
- $menuElement12 = new MenuElement(12);
- $menuElement121 = new MenuElement(121);
- $menuElement122 = new MenuElement(122);
- $menuElement123 = new MenuElement(123);
- $menuElement1211 = new MenuElement(1211);
- $menuElement121->addChild($menuElement1211);
- $menuElement12->addChild($menuElement121);
- $menuElement12->addChild($menuElement122);
- $menuElement12->addChild($menuElement123);
- $menuElement1->addChild($menuElement11);
- $menuElement1->addChild($menuElement12);
File Description
- aaaa
- PHP Code
- 18 Aug-2019
- 838 Bytes
You can Share it:
Latest PHP Pastes