the php code dose not go to error function , this function goes directly in handle_data(); function
Reference: What is variable scope, which variables are accessible from where and what are "undefined variable" errors?