@@ -850,18 +850,17 @@ PHP_FUNCTION(socket_listen)
850850PHP_FUNCTION (socket_close )
851851{
852852 zval * arg1 ;
853- php_socket * php_socket ;
854853
855854 ZEND_PARSE_PARAMETERS_START (1 , 1 )
856855 Z_PARAM_OBJECT_OF_CLASS (arg1 , socket_ce )
857856 ZEND_PARSE_PARAMETERS_END ();
858857
859- php_socket = Z_SOCKET_P (arg1 );
860- ENSURE_SOCKET_VALID (php_socket );
858+ php_socket * socket = Z_SOCKET_P (arg1 );
859+ ENSURE_SOCKET_VALID (socket );
861860
862- if (!Z_ISUNDEF (php_socket -> zstream )) {
861+ if (!Z_ISUNDEF (socket -> zstream )) {
863862 php_stream * stream = NULL ;
864- php_stream_from_zval_no_verify (stream , & php_socket -> zstream );
863+ php_stream_from_zval_no_verify (stream , & socket -> zstream );
865864 if (stream != NULL ) {
866865 /* close & destroy stream, incl. removing it from the rsrc list;
867866 * resource stored in php_sock->zstream will become invalid */
@@ -870,13 +869,13 @@ PHP_FUNCTION(socket_close)
870869 (stream -> is_persistent ?PHP_STREAM_FREE_CLOSE_PERSISTENT :0 ));
871870 }
872871 } else {
873- if (!IS_INVALID_SOCKET (php_socket )) {
874- close (php_socket -> bsd_socket );
872+ if (!IS_INVALID_SOCKET (socket )) {
873+ close (socket -> bsd_socket );
875874 }
876875 }
877876
878- ZVAL_UNDEF (& php_socket -> zstream );
879- php_socket -> bsd_socket = -1 ;
877+ ZVAL_UNDEF (& socket -> zstream );
878+ socket -> bsd_socket = -1 ;
880879}
881880/* }}} */
882881
0 commit comments