What do you think that should output? If you thought it would print "Before" followed by your computer's uptime information, then "After", you are quite wrong!
You see, unlike functions such as exec() or passthru(), pcntl_exec() replaces the existing process with the new program specified in its parameter. This program is launched and run normally, it has the same PID as PHP had before it called pcntl_exec(), but it replaces the PHP process entirely. As a result, the second print line is never reached, because the PHP interpreter gets killed and replaced by the uptime program in the same process.
If you find this confusing, do not despair - pcntl_exec() is very rarely used, and, to be honest, when you do need to use it things will become clear!
Author's Note: If you are a Unix programmer, it may be helpful for you to know that pcntl_exec() is just a thin wrapper around the execve() function.
The last two parameters to this function allow you to control how the launched process operates. The "args" parameter is simply an array of strings to pass into the program as arguments, whereas the "envs" parameter lets you specify environment variables and their values as an array. Use array keys for environment variables and array values for the environment values.