가능한 중복 :
Reference - What does this symbol mean in PHP?PHP는 특별한 표기
내가 개체 초기화에 사용되는 다음과 같은 특수 표기 을 발견 this tutorial .There를 사용하여 PHP MVC를 공부하고
$this->$model =& new $model;
나는 &을 알고있다. r은 앰퍼샌드 (&)를 HTML로 표현합니다. 여기서 의미하는 것은 무엇입니까? 표기법이있는 클래스가 아래에 주어져 있습니다. 또한이 튜토리얼은 무엇입니까? 좋은 사람입니까? 다른 사람이 나를 더 잘 참조 할 수 없다면 하나?
<?php
class Controller {
protected $_model;
protected $_controller;
protected $_action;
protected $_template;
function __construct($model, $controller, $action) {
$this->_controller = $controller;
$this->_action = $action;
$this->_model = $model;
$this->$model =& new $model;
$this->_template =& new Template($controller,$action);
}
function set($name,$value) {
$this->_template->set($name,$value);
}
function __destruct() {
$this->_template->render();
}
}
그게 나에게 유효한 PHP 같지 않아. 실행하면 오류나 경고가 발생합니까? – Dai
더 나은 자습서를 찾으십시오. '$ variable = & new Something'은 PHP 4의 나머지 부분이며, PHP 5에서는 필요 없습니다. mysql_ * 함수는 새로운 코드에서는 사용하지 말아야합니다 *. 'register_globals'와'magic_quotes_gpc' 같은 것들도 마찬가지입니다. – DCoder
나에게 좋은 자습서를 제안 해 줄 수 있습니까? –