My ONE,TWO, and THREE variables are undefined when I try and run the script even though it's defined in the global scope. My A,B, and C variables are considered defined though. At first I thought it was because I'm assigning constant values as keys, but I didn't find anything online that said I couldn't do that.
<?php class aClass
{
const A = 1;
const B = 2;
const C = 3;
const ONE = 1;
const TWO = 2;
const THREE = 3;
public $arr = [];
function __construct() {
$this->createArray();
}
function createArray() {
$this->arr[] = $this->A = [
$this->ONE => 'one.',
$this->TWO => 'two',
$this->THREE => 'three'
];
$this->arr[] = $this->B = [
$this->ONE => 'one',
$this->TWO => 'two',
$this->THREE => 'three',
];
$this->arr[] = $this->C = [
$this->ONE => 'one',
$this->TWO => 'two',
$this->THREE => 'three',
];
}
}
?>