这是一个创建于 3481 天前的主题,其中的信息可能已经有所发展或是发生改变。
<?php
class my_cls{
function __construct(){
$this->str=str_split('sfjhfsjfskdksdjkfskjsfkjsfkjfsfjvjhfjhv',1);
}
public function array_index($t){
return array_search($t, $this->str);
}
public function test($str){
for($i=0;$i<floor(strlen($str)/2);$i++){
$arr = array_map("my_cls::array_index",str_split(substr($str,$i*2,2)));
}
}
}
以上代码在 PHP5.4 是正常的,但是不兼容 5.2
请教一下 my_cls::array_index 应该怎么改才能兼容 PHP5.2 ?
6 条回复 2016-10-14 12:13:36 +08:00  | | 1 jfcherng 2016 年 10 月 13 日 1 可以 array($this, 'array_index') |
 | | 5 Outshine 2016 年 10 月 14 日 为毛还要兼容 5.2 。。。 |