Make some tweak for checkOnline() function.
Test on PHP Version 5.5.9