在我使用一流的豆类变异,但出于某种原因,在我想要将其设定为<代码>true时,它不做以下工作:
<?php
class TinyFram {
private $urlMatched;
public function get($url, $method){
$urlR = str_replace( / , / , $url);
$urlR = ^ . $urlR . /?$ ;
if (preg_match("/$urlR/i", $reqURI, $rMatch)) {
$this->urlMatched = true; // I SET IT TO TRUE HERE
$method($rMatch);
}
if(!$this->urlMatched) {
echo var_dump($this->urlMatched); // BUT HERE IT SHOWS AS FALSE
notFound($rMatch);
}
}
}
?>
什么是错的? 感谢!