diff options
author | Julien Pauli <jpauli@php.net> | 2015-12-24 14:08:59 +0100 |
---|---|---|
committer | Julien Pauli <jpauli@php.net> | 2015-12-24 14:08:59 +0100 |
commit | 048fb4b00f2e26c0d7e5ce3161722d631bc393fd (patch) | |
tree | 769b451fd795bbe8983b999d84bfe4040fc0583a | |
parent | 3f09d301b5e4b50825b4560f0dd6673dbe616fc5 (diff) | |
parent | d73d9fecf6c7a4cf2a7443f1a3833c8fb6e30ea1 (diff) | |
download | php-git-048fb4b00f2e26c0d7e5ce3161722d631bc393fd.tar.gz |
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
Fixed and improved tests
test to function socket_getopt();
test to function socket_clear_error();;
test to function socket_shutdown();
test to function socket_send();
test to function gethostname ( void );
test to function DateTimeZone::getLocation();
test to function stream_get_transports();
test to function stream_get_wrappers();
test to function stream_socket_enable_crypto();
test to function stream_socket_get_name();
Create stream_socket_recvfrom.phpt
test to stream function set_file_buffer.phpt();
test to function PDO_getAvaliableDrivers;
test to misc. function connection_status();
test to function connection_aborted();
test to function memory_get_peak_usage();
-rw-r--r-- | Zend/tests/memory_get_peak_usage.phpt | 17 | ||||
-rw-r--r-- | ext/date/tests/DateTimeZone_getLocation.phpt | 82 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/PDO_getAvaliableDrivers.phpt | 11 | ||||
-rw-r--r-- | ext/sockets/tests/socket_clear_error.phpt | 28 | ||||
-rw-r--r-- | ext/sockets/tests/socket_getopt.phpt | 73 | ||||
-rw-r--r-- | ext/sockets/tests/socket_send.phpt | 50 | ||||
-rw-r--r-- | ext/sockets/tests/socket_shutdown.phpt | 54 | ||||
-rw-r--r-- | ext/standard/tests/general_functions/connection_aborted.phpt | 10 | ||||
-rw-r--r-- | ext/standard/tests/general_functions/connection_status.phpt | 10 | ||||
-rw-r--r-- | ext/standard/tests/network/gethostname.phpt | 20 | ||||
-rw-r--r-- | ext/standard/tests/streams/set_file_buffer.phpt | 47 | ||||
-rw-r--r-- | ext/standard/tests/streams/stream_get_transports.phpt | 16 | ||||
-rw-r--r-- | ext/standard/tests/streams/stream_get_wrappers.phpt | 21 | ||||
-rw-r--r-- | ext/standard/tests/streams/stream_socket_enable_crypto.phpt | 65 | ||||
-rw-r--r-- | ext/standard/tests/streams/stream_socket_get_name.phpt | 26 | ||||
-rw-r--r-- | ext/standard/tests/streams/stream_socket_recvfrom.phpt | 34 |
16 files changed, 564 insertions, 0 deletions
diff --git a/Zend/tests/memory_get_peak_usage.phpt b/Zend/tests/memory_get_peak_usage.phpt new file mode 100644 index 0000000000..ba6f4fda34 --- /dev/null +++ b/Zend/tests/memory_get_peak_usage.phpt @@ -0,0 +1,17 @@ +--TEST-- +int memory_get_peak_usage ([ bool $real_usage = false ] ); +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--FILE-- +<?php +var_dump($a = memory_get_peak_usage()); +var_dump(memory_get_peak_usage(true)); +var_dump(memory_get_peak_usage(false)); +$array = range(1,1024*1024); +var_dump(memory_get_peak_usage() > $a); +?> +--EXPECTF-- +int(%d) +int(%d) +int(%d) +bool(true) diff --git a/ext/date/tests/DateTimeZone_getLocation.phpt b/ext/date/tests/DateTimeZone_getLocation.phpt new file mode 100644 index 0000000000..8e6e33bd17 --- /dev/null +++ b/ext/date/tests/DateTimeZone_getLocation.phpt @@ -0,0 +1,82 @@ +--TEST-- +DateTimeZone::getLocation -- timezone_location_get — Returns location information for a timezone +public array DateTimeZone::getLocation ( void ) ; +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- +<?php +if (phpversion() < "5.3.0") { + die('SKIP php version so lower.'); +} +?> +--FILE-- +<?php +$arrayDate = DateTimeZone::listAbbreviations(); +$countryCode = array("??"); +$countryCodeTest = array("AU", "CA", "ET", "AF", "US", "KZ", "AM"); + +foreach($arrayDate as $value){ + + if(NULL != $value[0]['timezone_id']){ + $timeZone = new DateTimeZone($value[0]['timezone_id']); + $timeZoneArray = $timeZone->getLocation(); + + if((!in_array($timeZoneArray['country_code'], $countryCode)) && (NULL != $timeZoneArray['country_code']) && ("" != $timeZoneArray['country_code'])) { + array_push($countryCode, $timeZoneArray['country_code']); + + if(in_array($timeZoneArray['country_code'], $countryCodeTest)){ + print_r($timeZoneArray); + } + } + } +} +?> +--CLEAN-- +<?php +unset($arrayDate); +unset($countryCode); +unset($countryCodeTest); +?> +--EXPECTF-- +Array +( + [country_code] => %s + [latitude] => %f + [longitude] => %f + [comments] => %s +) +Array +( + [country_code] => %s + [latitude] => %f + [longitude] => %f + [comments] => %s +) +Array +( + [country_code] => %s + [latitude] => %f + [longitude] => %f + [comments] => +) +Array +( + [country_code] => %s + [latitude] => %f + [longitude] => %f + [comments] => %s +) +Array +( + [country_code] => %s + [latitude] => %f + [longitude] => %f + [comments] => %s +) +Array +( + [country_code] => %s + [latitude] => %f + [longitude] => %f + [comments] => +) diff --git a/ext/pdo_mysql/tests/PDO_getAvaliableDrivers.phpt b/ext/pdo_mysql/tests/PDO_getAvaliableDrivers.phpt new file mode 100644 index 0000000000..07ddca183a --- /dev/null +++ b/ext/pdo_mysql/tests/PDO_getAvaliableDrivers.phpt @@ -0,0 +1,11 @@ +--TEST-- +public static array PDO::getAvailableDrivers ( void ); +array pdo_drivers ( void ); +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--FILE-- +<?php +print((is_array(PDO::getAvailableDrivers())) ? ("yes") : ("Test failed")); +?> +--EXPECT-- +yes diff --git a/ext/sockets/tests/socket_clear_error.phpt b/ext/sockets/tests/socket_clear_error.phpt new file mode 100644 index 0000000000..af9acaa9bf --- /dev/null +++ b/ext/sockets/tests/socket_clear_error.phpt @@ -0,0 +1,28 @@ +--TEST-- +void socket_clear_error ([ resource $socket ] ) ; +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- +<?php +if (!extension_loaded('sockets')) { + die('SKIP sockets extension not available.'); +} +?> +--FILE-- +<?php +$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); +$socketConn = socket_connect($socket, "127.0.0.1", 21248); +var_dump(socket_last_error($socket)); +socket_clear_error($socket); +var_dump(socket_last_error($socket)); +?> +--CLEAN-- +<?php +socket_close($socket); +unset($socket); +unset($socketConn); +?> +--EXPECTF-- +Warning: socket_connect(): unable to connect [%d]: Connection refused in %s on line %d +int(%d) +int(%d) diff --git a/ext/sockets/tests/socket_getopt.phpt b/ext/sockets/tests/socket_getopt.phpt new file mode 100644 index 0000000000..12c0aeb888 --- /dev/null +++ b/ext/sockets/tests/socket_getopt.phpt @@ -0,0 +1,73 @@ +--TEST-- +mixed socket_getopt( resource $socket , int $level , int $optname ) ; +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- +<?php +if (!extension_loaded('sockets')) { + die('skip sockets extension not available.'); +} +?> +--FILE-- +<?php +$domain = AF_INET; +$level = IPPROTO_IP; +$s = socket_create($domain, SOCK_DGRAM, SOL_UDP) or die("err"); + +echo "Setting IP_MULTICAST_TTL\n"; +$r = socket_set_option($s, $level, IP_MULTICAST_TTL, 9); +var_dump($r); +$r = socket_getopt($s, $level, IP_MULTICAST_TTL); +var_dump($r); +echo "\n"; + +echo "Setting IP_MULTICAST_LOOP\n"; +$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 0); +var_dump($r); +$r = socket_getopt($s, $level, IP_MULTICAST_LOOP); +var_dump($r); +$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 1); +var_dump($r); +$r = socket_getopt($s, $level, IP_MULTICAST_LOOP); +var_dump($r); +echo "\n"; + +echo "Setting IP_MULTICAST_IF\n"; +echo "interface 0:\n"; +$r = socket_set_option($s, $level, IP_MULTICAST_IF, 0); +var_dump($r); +$r = socket_getopt($s, $level, IP_MULTICAST_IF); +var_dump($r); +echo "interface 1:\n"; +$r = socket_set_option($s, $level, IP_MULTICAST_IF, 1); +var_dump($r); +$r = socket_getopt($s, $level, IP_MULTICAST_IF); +var_dump($r); +echo "\n"; +?> +--CLEAN-- +<?php +unset($domain); +unset($level); +socket_close($s); +unset($s); +unset($r"); +?> +--EXPECT-- +Setting IP_MULTICAST_TTL +bool(true) +int(9) + +Setting IP_MULTICAST_LOOP +bool(true) +int(0) +bool(true) +int(1) + +Setting IP_MULTICAST_IF +interface 0: +bool(true) +int(0) +interface 1: +bool(true) +int(1) diff --git a/ext/sockets/tests/socket_send.phpt b/ext/sockets/tests/socket_send.phpt new file mode 100644 index 0000000000..1411868c4b --- /dev/null +++ b/ext/sockets/tests/socket_send.phpt @@ -0,0 +1,50 @@ +--TEST-- +int socket_send ( resource $socket , string $buf , int $len , int $flags ); +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- +<?php +if (!extension_loaded('sockets')) { + die('SKIP sockets extension not available.'); +} +?> +--FILE-- +<?php +$port = 80; +$host = "yahoo.com"; +$stringSocket = "send_socket_to_connected_socket"; +$stringSocketLenght = strlen($stringSocket); + +$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); +$socketConn = socket_connect($socket, $host, $port); + +if(socket_send($socket, $stringSocket, $stringSocketLenght, MSG_OOB)===$stringSocketLenght){ + print("okey\n"); +} + +if(socket_send($socket, $stringSocket, $stringSocketLenght, MSG_EOR)===$stringSocketLenght){ + print("okey\n"); +} + +if(socket_send($socket, $stringSocket, $stringSocketLenght, MSG_EOF)===$stringSocketLenght){ + print("okey\n"); +} + +if(socket_send($socket, $stringSocket, $stringSocketLenght, MSG_DONTROUTE)===$stringSocketLenght){ + print("okey\n"); +} +?> +<?php +socket_close($socket); +unset($port); +unset($host); +unset($stringSocket); +unset($stringSocketLenght); +unset($socket); +unset($socketConn); +?> +--EXPECTF-- +okey +okey +okey +okey diff --git a/ext/sockets/tests/socket_shutdown.phpt b/ext/sockets/tests/socket_shutdown.phpt new file mode 100644 index 0000000000..09f5ac73fc --- /dev/null +++ b/ext/sockets/tests/socket_shutdown.phpt @@ -0,0 +1,54 @@ +--TEST-- +bool socket_shutdown ( resource $socket [, int $how = 2 ] ) ; +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- +<?php +if (!extension_loaded('sockets')) { + die('SKIP sockets extension not available.'); +} +?> +--FILE-- +<?php +$host = "yahoo.com"; +$port = 80; + +$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); +$socketConn = socket_connect($socket, $host, $port); +var_dump(socket_shutdown($socket,0)); +socket_close($socket); + +$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); +$socketConn = socket_connect($socket, $host, $port); +var_dump(socket_shutdown($socket,1)); +socket_close($socket); + +$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); +$socketConn = socket_connect($socket, $host, $port); +var_dump(socket_shutdown($socket,2)); +socket_close($socket); + +$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); +var_dump(socket_shutdown($socket,0)); + +$socketConn = socket_connect($socket, $host, $port); +var_dump(socket_shutdown($socket,-1)); +socket_close($socket); +?> +--CLEAN-- +<?php +unset($host); +unset($port); +unset($socket); +unset($socketConn); +?> +--EXPECTF-- +bool(true) +bool(true) +bool(true) + +Warning: socket_shutdown(): unable to shutdown socket [%d]: Transport endpoint is not connected in %s on line %d +bool(false) + +Warning: socket_shutdown(): unable to shutdown socket [%d]: Invalid argument in %s on line %d +bool(false) diff --git a/ext/standard/tests/general_functions/connection_aborted.phpt b/ext/standard/tests/general_functions/connection_aborted.phpt new file mode 100644 index 0000000000..79618c2aa1 --- /dev/null +++ b/ext/standard/tests/general_functions/connection_aborted.phpt @@ -0,0 +1,10 @@ +--TEST-- +int connection_aborted ( void ); +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--FILE-- +<?php +var_dump(connection_aborted()); +?> +--EXPECTF-- +int(0) diff --git a/ext/standard/tests/general_functions/connection_status.phpt b/ext/standard/tests/general_functions/connection_status.phpt new file mode 100644 index 0000000000..5e0677fe27 --- /dev/null +++ b/ext/standard/tests/general_functions/connection_status.phpt @@ -0,0 +1,10 @@ +--TEST-- +int connection_status ( void ); +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--FILE-- +<?php +var_dump(connection_status() == CONNECTION_NORMAL); +?> +--EXPECTF-- +bool(true) diff --git a/ext/standard/tests/network/gethostname.phpt b/ext/standard/tests/network/gethostname.phpt new file mode 100644 index 0000000000..5c811b8c6f --- /dev/null +++ b/ext/standard/tests/network/gethostname.phpt @@ -0,0 +1,20 @@ +--TEST-- +string gethostname(void); +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- +<?php +if (phpversion() < "5.3.0") { + die('SKIP php version so lower.'); +} +?> +--FILE-- +<?php +var_dump(gethostname()); +var_dump(gethostname("php-zend-brazil")); +?> +--EXPECTF-- +%s + +Warning: gethostname() expects exactly %d parameters, %d given in %s on line %d +NULL diff --git a/ext/standard/tests/streams/set_file_buffer.phpt b/ext/standard/tests/streams/set_file_buffer.phpt new file mode 100644 index 0000000000..04d0fb121d --- /dev/null +++ b/ext/standard/tests/streams/set_file_buffer.phpt @@ -0,0 +1,47 @@ +--TEST-- +int set_file_buffer ( resource $stream , int $buffer ); +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--FILE-- +<?php + +class test_wrapper { + + function stream_open($path, $mode, $openedpath) { + return true; + } + + function stream_eof() { + return false; + } + + function stream_write($data) { + echo "size: ", strlen($data), "\n"; + return strlen($data); + } + + function stream_set_option($option, $arg1, $arg2) { + echo "option: ", $option, ", ", $arg1, ", ", $arg2, "\n"; + return false; + } +} + +var_dump(stream_wrapper_register('test', 'test_wrapper')); +$fd = fopen("test://foo","r"); +var_dump(set_file_buffer($fd, 50)); +var_dump(stream_set_chunk_size($fd, 42)); +var_dump(fwrite($fd, str_repeat('0', 70))); +?> +--CLEAN-- +<?php +fclose($fd); +unset($fd); +?> +--EXPECTF-- +bool(true) +option: %d, %d, %d +int(%i) +int(%d) +size: %d +size: %d +int(%d) diff --git a/ext/standard/tests/streams/stream_get_transports.phpt b/ext/standard/tests/streams/stream_get_transports.phpt new file mode 100644 index 0000000000..0d4e194d64 --- /dev/null +++ b/ext/standard/tests/streams/stream_get_transports.phpt @@ -0,0 +1,16 @@ +--TEST-- +array stream_get_transports ( void ); +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- +<?php +if (phpversion() < "5.3.0") { + die('SKIP php version so lower.'); +} +?> +--FILE-- +<?php +print((is_array(stream_get_transports())) ? ("yes") : ("Test 'array stream_get_transports ( void );' has failed")); +?> +--EXPECT-- +yes diff --git a/ext/standard/tests/streams/stream_get_wrappers.phpt b/ext/standard/tests/streams/stream_get_wrappers.phpt new file mode 100644 index 0000000000..58dfdc930d --- /dev/null +++ b/ext/standard/tests/streams/stream_get_wrappers.phpt @@ -0,0 +1,21 @@ +--TEST-- +array stream_get_wrappers ( void ); +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- +<?php +if (phpversion() < "5.3.0") { + die('SKIP php version so lower.'); +} +?> +--FILE-- +<?php +print((is_array(stream_get_wrappers())) ? ("yes") : ("Test 'array stream_get_wrappers ( void );' has failed")); +echo "\n"; +class Foo { } +stream_wrapper_register("foo", "Foo"); +var_dump(in_array("foo", stream_get_wrappers())); +?> +--EXPECT-- +yes +bool(true) diff --git a/ext/standard/tests/streams/stream_socket_enable_crypto.phpt b/ext/standard/tests/streams/stream_socket_enable_crypto.phpt new file mode 100644 index 0000000000..47d6c62893 --- /dev/null +++ b/ext/standard/tests/streams/stream_socket_enable_crypto.phpt @@ -0,0 +1,65 @@ +--TEST-- +mixed stream_socket_enable_crypto(resource $stream , bool $enable [, int $crypto_type [, resource $session_stream ]] ) ; +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- +<?php +if (phpversion() < "5.3.0") { die('SKIP php version so lower.'); } +if (!extension_loaded('openssl')) { die('ext/openssl required'); } +?> +--FILE-- +<?php +$serverUri = "tcp://127.0.0.1:31854"; +$sock = stream_socket_server($serverUri, $errno, $errstr); + +if (is_resource($sock)) { + var_dump(stream_socket_enable_crypto($sock, false)); + var_dump(stream_socket_enable_crypto($sock, true)); + var_dump(stream_socket_enable_crypto($sock, true, STREAM_CRYPTO_METHOD_SSLv2_CLIENT)); + var_dump(stream_socket_enable_crypto($sock, true, STREAM_CRYPTO_METHOD_SSLv3_CLIENT)); + var_dump(stream_socket_enable_crypto($sock, true, STREAM_CRYPTO_METHOD_SSLv23_CLIENT)); + var_dump(stream_socket_enable_crypto($sock, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)); + var_dump(stream_socket_enable_crypto($sock, true, STREAM_CRYPTO_METHOD_SSLv2_SERVER)); + var_dump(stream_socket_enable_crypto($sock, true, STREAM_CRYPTO_METHOD_SSLv3_SERVER)); + var_dump(stream_socket_enable_crypto($sock, true, STREAM_CRYPTO_METHOD_SSLv23_SERVER)); + var_dump(stream_socket_enable_crypto($sock, true, STREAM_CRYPTO_METHOD_TLS_SERVER)); +} else { + die("Test stream_socket_enable_crypto has failed; Unable to connect: {$errstr} ({$errno})"); +} +?> +--CLEAN-- +<?php +unset($serverUri); +unset($sock); +unset($errno); +unset($errstr); +?> +--EXPECTF-- +bool(false) + +Warning: stream_socket_enable_crypto(): When enabling encryption you must specify the crypto type in %s on line %d +bool(false) + +Warning: stream_socket_enable_crypto(): SSLv2 %s in %s on line %d +bool(false) + +Warning: stream_socket_enable_crypto(): SSL: Broken pipe in %s on line %d +bool(false) + +Warning: stream_socket_enable_crypto(): SSL/TLS already set-up for this stream in %s on line %d +bool(false) + +Warning: stream_socket_enable_crypto(): SSL/TLS already set-up for this stream in %s on line %d +bool(false) + +Warning: stream_socket_enable_crypto(): SSL/TLS already set-up for this stream in %s on line %d +bool(false) + +Warning: stream_socket_enable_crypto(): SSL/TLS already set-up for this stream in %s on line %d +bool(false) + +Warning: stream_socket_enable_crypto(): SSL/TLS already set-up for this stream in %s on line %d +bool(false) + +Warning: stream_socket_enable_crypto(): SSL/TLS already set-up for this stream in %s on line %d +bool(false) diff --git a/ext/standard/tests/streams/stream_socket_get_name.phpt b/ext/standard/tests/streams/stream_socket_get_name.phpt new file mode 100644 index 0000000000..17bf0b7db4 --- /dev/null +++ b/ext/standard/tests/streams/stream_socket_get_name.phpt @@ -0,0 +1,26 @@ +--TEST-- +string stream_socket_get_name ( resource $handle , bool $want_peer ) ; +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- +<?php +if (phpversion() < "5.3.0") { + die('SKIP php version so lower.'); +} +?> +--FILE-- +<?php +$serverUri = "tcp://127.0.0.1:31854"; +$sock = stream_socket_server($serverUri, $errno, $errstr); + +var_dump(stream_socket_get_name($sock, false)); +var_dump(stream_socket_get_name($sock, true)); +?> +--CLEAN-- +<?php +unset($serverUri); +unset($sock); +?> +--EXPECT-- +string(15) "127.0.0.1:31854" +bool(false) diff --git a/ext/standard/tests/streams/stream_socket_recvfrom.phpt b/ext/standard/tests/streams/stream_socket_recvfrom.phpt new file mode 100644 index 0000000000..f4161288ff --- /dev/null +++ b/ext/standard/tests/streams/stream_socket_recvfrom.phpt @@ -0,0 +1,34 @@ +--TEST-- +string stream_socket_recvfrom ( resource $socket , int $length [, int $flags = 0 [, string &$address ]] ); +--CREDITS-- +marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br +--SKIPIF-- +<?php +if (phpversion() < "5.3.0") { + die('SKIP php version so lower.'); +} +?> +--FILE-- +<?php +$serverUri = "tcp://127.0.0.1:31854"; +$sock = stream_socket_server($serverUri, $errno, $errstr); +$sockLen = 1500; + +var_dump(stream_socket_recvfrom($sock, $sockLen)); +var_dump(stream_socket_recvfrom($sock, $sockLen, STREAM_OOB)); +var_dump(stream_socket_recvfrom($sock, $sockLen, STREAM_PEEK)); +?> +--CLEAN-- +<?php +fclose($sock); +unset($serverUri); +unset($clientFlags); +unset($sock); +unset($sockLen); +unset($errno); +unset($errstr); +?> +--EXPECT-- +bool(false) +bool(false) +bool(false) |