403Webshell
Server IP : 66.29.132.122  /  Your IP : 3.144.4.4
Web Server : LiteSpeed
System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : admazpex ( 531)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/opt/alt/tests/alt-php80-phpiredis_1.0.1-1.el8/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/opt/alt/tests/alt-php80-phpiredis_1.0.1-1.el8/reader_003.phpt
--TEST--
[READER] Check reader state

--SKIPIF--
<?php
require_once 'testsuite_skipif.inc';

--FILE--
<?php

$reader = phpiredis_reader_create();

phpiredis_reader_feed($reader, "+OK\r\n");
var_dump(phpiredis_reader_get_reply($reader));
var_dump(phpiredis_reader_get_state($reader) == PHPIREDIS_READER_STATE_INCOMPLETE);

phpiredis_reader_feed($reader, "+OK\r\n");
var_dump(phpiredis_reader_get_state($reader) == PHPIREDIS_READER_STATE_COMPLETE);
var_dump(phpiredis_reader_get_reply($reader));

phpiredis_reader_feed($reader, "$3\r\nSE");
var_dump(phpiredis_reader_get_state($reader) == PHPIREDIS_READER_STATE_INCOMPLETE);

phpiredis_reader_feed($reader, "T\r\n");
var_dump(phpiredis_reader_get_state($reader) == PHPIREDIS_READER_STATE_COMPLETE);
var_dump(phpiredis_reader_get_reply($reader));

phpiredis_reader_feed($reader, "nSET\r\n");
var_dump(phpiredis_reader_get_reply($reader) == FALSE);
var_dump(phpiredis_reader_get_state($reader) == PHPIREDIS_READER_STATE_ERROR);
var_dump(phpiredis_reader_get_error($reader));

--EXPECT--
string(2) "OK"
bool(true)
bool(true)
string(2) "OK"
bool(true)
bool(true)
string(3) "SET"
bool(true)
bool(true)
string(42) "Protocol error, got "n" as reply type byte"

Youez - 2016 - github.com/yon3zu
LinuXploit