hiphop-php /hphp/test/zend/bad/ext/pcre/tests/preg_replace_callback2.php

Language PHP Lines 20
MD5 Hash 3f9b64077dcfa6afab96f39ead6b7704 Estimated Cost $260 (why?)
Repository git://github.com/facebook/hiphop-php.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<?php

function f() {
	throw new Exception();
}

try {
var_dump(preg_replace_callback('/\w/', 'f', 'z'));
} catch(Exception $e) {}

function g($x) {
	return "'$x[0]'";
}

var_dump(preg_replace_callback('@\b\w{1,2}\b@', 'g', array('a b3 bcd', 'v' => 'aksfjk', 12 => 'aa bb')));

var_dump(preg_replace_callback('~\A.~', 'g', array(array('xyz'))));

var_dump(preg_replace_callback('~\A.~', create_function('$m', 'return strtolower($m[0]);'), 'ABC'));
?>
Back to Top