Php detects the running capability of the server. Php detection server running ability detection function supports functionisfun ($ funName) {return (false! Function_exists ($ funName ))? Supported: fontcolorred does not support font;} integer php testing server running capability
// Detection function support
Function isfun ($ funName ){
Return (false! = Function_exists ($ funName ))? 'Supported ': 'unsupported ';
}
// Integer computing capability test
Function test_int (){
$ TimeStart = gettimeofday ();
For ($ I = 0; I I <3000000; $ I ++ ){
$ T = 1 + 1;
}
$ TimeEnd = gettimeofday ();
$ Time = ($ timeEnd ["usec"]-$ timeStart ["usec"])/1000000 + $ timeEnd ["sec"]-$ timeStart ["sec"];
$ Time = round ($ time, 3). "seconds ";
Return $ time;
}
// Floating point computing capability test
Function test_float (){
// Obtain the circumference rate
$ T = pi ();
$ TimeStart = gettimeofday ();
For ($ I = 0; I I <3000000; $ I ++ ){
// Square
Sqrt ($ t );
}
$ TimeEnd = gettimeofday ();
$ Time = ($ timeEnd ["usec"]-$ timeStart ["usec"])/1000000 + $ timeEnd ["sec"]-$ timeStart ["sec"];
$ Time = round ($ time, 3). "seconds ";
Return $ time;
}
// IO capability test
Function test_io (){
$ Fp = @ fopen (PHPSELF, "r ");
$ TimeStart = gettimeofday ();
For ($ I = 0; I I <10000; $ I ++ ){
@ Fread ($ fp, 10240 );
@ Rewind ($ fp );
}
$ TimeEnd = gettimeofday ();
@ Fclose ($ fp );
$ Time = ($ timeEnd ["usec"]-$ timeStart ["usec"])/1000000 + $ timeEnd ["sec"]-$ timeStart ["sec"];
$ Time = round ($ time, 3). "seconds ";
Return ($ time );
}
FUNCTIONS // detection functions support function isfun ($ funName) {return (false! = Function_exists ($ funName ))? 'Supported ': 'Font color = red does not support/font';} // integer operation...