Anonymous
public text v1 · immutable<?php
class test {
private $array_test = array();
public function __construct() {
$temp_var = "array_test";
$this->{$temp_var} = "hello";
}
}
class test2 {
private $array_test = array();
public function __construct() {
$temp_var = "array_test";
$this->$$temp_var = "hello";
}
}
$class_test = new test();
print_r($class_test);
print("<hr />");
$class_test_2 = new test2();
print_r($class_test_2);