PHP Benchmarks

Performance comparison of PHP code alternatives.

Test: exec vs. shell_exec

No Description

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

Result: Saved

The test labeled "exec()" was the faster by 0.0141 seconds, (2.630% faster)

exec() 100%
shell_exec() 97.37%

The exec() test took 0.5207 seconds.
The shell_exec() test took 0.5348 seconds.


Each test case ran 20 random code order iterations consisting of 137,035 loops for a total of 2,740,700 runs.

  • Line execution difference (0.000005) milliseconds.
  • Avg difference (0.703) milliseconds per 137,035 loops.
  • Total difference 14.06 milliseconds for 2,740,700 loops

The iteration variablity for Code 1 was (1.5193) milliseconds and Code 2 was (1.5967) 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 (