fork(2) download
  1. <?php
  2. $s = ""; $re = "";
  3. for ($i = 0; $i < 100; $i++)
  4. {
  5. $s .= substr((string)$i, strlen((string)$i)-1, 1);
  6. $re .= "(\\d)";
  7. }//echo $s . PHP_EOL;//echo $re. PHP_EOL;
  8. preg_match("/" . $re . "/", $s, $m);
  9. echo $m[100] . PHP_EOL;
  10. echo preg_replace("/" . $re . "/", '${100}', $s);
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
9
${100}