The function does not work in ESP8266

Because it is a nasty trap to do so - as can be seen in this thread.