PHP Benchmarks

Performance comparison of PHP code alternatives.

Test: exec vs. shell_exec

No Description

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

Result: Discarded

The test labeled "exec()" was the faster by 0.0164 seconds, (1.550% faster)

exec() 100%
shell_exec() 98.45%

The exec() test took 1.0442 seconds.
The shell_exec() test took 1.0607 seconds.


Each test case ran 20 random code order iterations consisting of 288,268 loops for a total of 5,765,360 runs.

  • Line execution difference (0.000003) milliseconds.
  • Avg difference (0.822) milliseconds per 288,268 loops.
  • Total difference 16.44 milliseconds for 5,765,360 loops

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