Re: Re: scanf function

From Crys, 12 Years ago, written in PHP, viewed 939 times. This paste is a reply to Re: scanf function from xxxy - view diff
URL https://paste.godclan.hu/view/RQJHfxYu Embed
Download Paste or View Raw
  1. <?php
  2. function scanf($format) {
  3.     $trace = debug_backtrace();
  4.     $args = $trace[0]['args'];
  5.     $argc = func_num_args();
  6.     $inputs = fscanf(STDIN, $format);
  7.     $n = count($inputs);
  8.     if($argc <= $n)
  9.         $n = $argc - 1;
  10.     for($i=0;$i<$n;$i++)
  11.         $args[$i+1] = $inputs[$i];
  12.     return $n;
  13. }
  14.  
  15. scanf("%d", &$number);
  16.  
  17. echo $number;
  18. ?>

Reply to "Re: Re: scanf function"

Here you can reply to the paste above