Skip to content

Instantly share code, notes, and snippets.

@prophile
Created May 5, 2009 23:42
Show Gist options
  • Save prophile/107287 to your computer and use it in GitHub Desktop.
Save prophile/107287 to your computer and use it in GitHub Desktop.
<?php
function cb ( $matches )
{
return '';
}
function rep ( $str )
{
return preg_replace_callback('/ /', 'cb', $str);
}
if (($v = rep('foo bar')) != 'foobar')
{
var_dump($v);
die("Failed.\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment