diff options
author | Christian Schneider | 2012-02-13 14:46:59 +0000 |
---|---|---|
committer | Christian Schneider | 2012-02-13 14:46:59 +0000 |
commit | ca407bc3f8e3e6d5f042be787f96304687af097e (patch) | |
tree | 52b8dd84fd1037e92171917f5dbdb95f51e5b237 /it_debug.class | |
parent | 3207842eeab9de8c558d23506ecc38cbe1ad8035 (diff) | |
download | itools-ca407bc3f8e3e6d5f042be787f96304687af097e.tar.gz itools-ca407bc3f8e3e6d5f042be787f96304687af097e.tar.bz2 itools-ca407bc3f8e3e6d5f042be787f96304687af097e.zip |
Replace preg_replace /e modifier with preg_replace_callback: Modified planned to be removed. ITools now requires PHP 5.3 or newer
Diffstat (limited to 'it_debug.class')
-rw-r--r-- | it_debug.class | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/it_debug.class b/it_debug.class index c558f52..ec6de07 100644 --- a/it_debug.class +++ b/it_debug.class @@ -133,7 +133,7 @@ function dump($args) $item = $head . "class $classname { $values }$tail"; } - $item = preg_replace('/\b(1[234]\d\d\d\d\d\d\d\d)\b(.*)/e', "'$1$2 # ' . date('Y-m-d H:i:s', '$1')", $item); + $item = preg_replace_callback('/\b(1[234]\d\d\d\d\d\d\d\d)\b(.*)/', function($m) { return $m[1] . $m[2] . " # " . date('Y-m-d H:i:s', $m[1]); }, $item); $item = preg_replace("#(=>?)\s*\n\s*(array|class)#", '$1 $2', $item); # array( and class on same line as key $item = preg_replace('#array \(\s+([^({,;]+),\s+\)#', 'array( $1 )', $item); # 1-element arrays on 1 line $item = preg_replace('#class (\S+) \{\s+([^({,;]+;)?\s+\}#', 'class $1 { $2 }', $item); # 1-element objects on 1 line |