Easy. Outsourcings general return is something along the line of:
Cost Saving = .5X-R
Where:
.4 is the factor that given programmers are cheaper. (So I'm assuming that your third world Programmer is half the price of your first world one)
X is the total number of hours / days for the project *Note the implicit assumption here that all programmers are created equal)
R is the risk factor. Harder communication, Cultural barriers, etc.
So for smaller values of X (say when you're using django not php) - then your expected return goes down. (And the overall influence of the Risk factor goes up - namely it could be cheaper keeping it first world)
Cost Saving = .5X-R
Where: .4 is the factor that given programmers are cheaper. (So I'm assuming that your third world Programmer is half the price of your first world one) X is the total number of hours / days for the project *Note the implicit assumption here that all programmers are created equal) R is the risk factor. Harder communication, Cultural barriers, etc.
So for smaller values of X (say when you're using django not php) - then your expected return goes down. (And the overall influence of the Risk factor goes up - namely it could be cheaper keeping it first world)