I want to replace all "private function __someMethod()" with "protected function _someMethod(). But I do want to leave the magic ones untouched. The replacing does not work though.
$x = array(
/private function __([^(construct|destruct|sleep|wakeup|get|set|call|toString|invoke|set_state|clone|callStatic|isset|unset)])/i ,
protected function _1
)
它使用preg_replace($x[0],x0.1美元)
。
th!
i 并尝试 [^ruct^sleep]
。 等等
the same applies to " $this->__ "
and " ::__ "
(static call) then, of course.