PHP Benchmarks

Performance comparison of PHP code alternatives.

Test: exec vs. shell_exec

No Description

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

Result: Discarded

The test labeled "shell_exec()" was the faster by 0.0319 seconds, (2.972% faster)

shell_exec() 100%
exec() 97.028%

The shell_exec() test took 1.0404 seconds.
The exec() test took 1.0723 seconds.


Each test case ran 20 random code order iterations consisting of 283,926 loops for a total of 5,678,520 runs.

  • Line execution difference (0.000006) milliseconds.
  • Avg difference (1.594) milliseconds per 283,926 loops.
  • Total difference 31.87 milliseconds for 5,678,520 loops

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