1--TEST-- 2void socket_clear_error ([ resource $socket ] ) ; 3--CREDITS-- 4marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br 5--EXTENSIONS-- 6sockets 7--SKIPIF-- 8<?php 9 10if(substr(PHP_OS, 0, 3) != 'WIN' ) { 11 die('skip windows only test'); 12} 13?> 14--FILE-- 15<?php 16$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 17$socketConn = socket_connect($socket, "127.0.0.1", 21248); 18var_dump(socket_last_error($socket)); 19socket_clear_error($socket); 20var_dump(socket_last_error($socket)); 21?> 22--CLEAN-- 23<?php 24socket_close($socket); 25unset($socket); 26unset($socketConn); 27?> 28--EXPECTF-- 29Warning: socket_connect(): unable to connect [%d]: No connection could be made because the target machine actively refused it in %s on line %d 30int(%d) 31int(%d) 32