代码例子:
<?php
class Leaf{
public $label;
public $nextLeave=[];
public function __construct($label)
{
$this->label=$label;
}
}
class Side{
public $leftNodeLabel;
public $rightNodeLabel;
public function __construct($leftNodeLabel,$rightNodeLabel)
{
$this->leftNodeLabel=$leftNodeLabel;
$this->rightNodeLabel=$rightNodeLabel;
}
}
function createMap(){
$map=[];
$map[]=new Side('a','c');
$map[]=new Side('b&#