PHP Benchmarks

Performance comparison of PHP code alternatives.

Test: exec vs. shell_exec

No Description

View test history (2) Run this test again Return to test menu

Result: Discarded

The test labeled "shell_exec()" was the faster by 0.0007 seconds, (0.105% faster)

shell_exec() 100%
exec() 99.895%

The shell_exec() test took 0.6432 seconds.
The exec() test took 0.6439 seconds.


Each test case ran 20 random code order iterations consisting of 146,461 loops for a total of 2,929,220 runs.

  • Line execution difference (0.000000) milliseconds.
  • Avg difference (0.034) milliseconds per 146,461 loops.
  • Total difference 0.68 milliseconds for 2,929,220 loops

The iteration variablity for Code 1 was (3.5197) milliseconds and Code 2 was (4.7165) milliseconds. The lower and the closer together there values are the more accurate the results are.


The first test, "exec()", was:


The second test, "shell_exec()", was:


Running: Linux (x86_64:1 GB) PHP (