phpcheck.class.debug.php Total: 90 Tests, 1 Errors ->first, ↻all
PHPCheck V1.66, OS: Linux, Machine: el8_9.x86_64, PHP-Version: 8.2.18 (64 Bit), Time: 51.095 ms (AVG: 0.568 ms), Memory: 2.0M (512M)
CommentLineCodeResultTest
include class debug 18 require __DIR__.'/../class/class.debug.php';
$t->checkEqual(class_exists('debug'), true); 
[6.287 ms]
true
Ok
check versions info 23 $info $t->getClassVersion("debug");
$t->check($info$info >= 2.52); 
[0.178 ms]
2.52
Ok
debug::write integer 27 $var 1;
debug::write($var);
$t->checkOutput('Line '.(__LINE__-1).',integer,1h'); 
[0.138 ms]
[29.04.2024 00:45:24,680](775k/960k) Debug::write "phpcheck.class.debug.php" Line 28
0integer1 [00000001h]
Ok
debug::write float 32 $var 1.1;
debug::write($var);
$t->checkOutput('Line '.(__LINE__-1).',1.1'); 
[0.099 ms]
[29.04.2024 00:45:24,680][+147 μs](776k/960k) Debug::write "phpcheck.class.debug.php" Line 33
0double1.1
Ok
debug::write float result 37 $var 0.7 0.1;
debug::write($var);
$t->checkOutput('Line '.(__LINE__-1).',0.799'); 
[0.025 ms]
[29.04.2024 00:45:24,680][+111 μs](778k/960k) Debug::write "phpcheck.class.debug.php" Line 38
0double0.7999999999999999
Ok
debug::write ASCII string 42 $var "ASCII-String";
debug::write($var);
$t->checkOutput('string(12),ASCII'); 
[0.802 ms]
[29.04.2024 00:45:24,680][+35 μs](780k/960k) Debug::write "phpcheck.class.debug.php" Line 43
0string(12) ASCII"ASCII-String"
Ok
debug::write string, integer 47 $var 6789;
debug::write('Ein Integer:',$var);
$t->checkOutput(6789); 
[0.049 ms]
[29.04.2024 00:45:24,681][+831 μs](781k/960k) Debug::write "phpcheck.class.debug.php" Line 48
0string(12) ASCII"Ein Integer:"
1integer6789 [00001A85h]
Ok
debug::write UTF8 string 52 $var "Umlaute äöü";
debug::write($var);
$t->checkOutput('string(14),UTF,äöü'); 
[0.025 ms]
[29.04.2024 00:45:24,681][+56 μs](784k/960k) Debug::write "phpcheck.class.debug.php" Line 53
0string(14) UTF-8"Umlaute äöü"
Ok
debug::write UTF8 BOM 57 $var "\xEF\xBB\xBFUmlaute äöü";
debug::write($var);
$t->checkOutput('UTF,BOM,äöü'); 
[0.034 ms]
[29.04.2024 00:45:24,681][+35 μs](785k/960k) Debug::write "phpcheck.class.debug.php" Line 58
0string(17) UTF-8 BOM"\xef\xbb\xbfUmlaute äöü"
Ok
debug::write UTF-8mb3 62 $var "1€";
debug::write($var);
$t->checkOutput('UTF-8mb3,1€'); 
[0.024 ms]
[29.04.2024 00:45:24,681][+43 μs](787k/960k) Debug::write "phpcheck.class.debug.php" Line 63
0string(4) UTF-8mb3"1€"
Ok
debug::write ISO-String 67 $string "text mit Umlauten äöü";
$iso mb_convert_encoding($string,"ISO-8859-1","UTF8");
debug::write($iso);
$t->checkOutput('ISO-8859-1'); 
[0.089 ms]
[29.04.2024 00:45:24,681][+63 μs](789k/960k) Debug::write "phpcheck.class.debug.php" Line 69
0string(21) ISO-8859-1"text mit Umlauten \xe4\xf6\xfc"
Ok
debug::write CP1252-String 73 $utf8 "text mit Umlauten äöü und € Symbol";
$str mb_convert_encoding($utf8,"CP1252","UTF8");
debug::write($str);
$t->checkOutput('CP1252'); 
[0.067 ms]
[29.04.2024 00:45:24,681][+85 μs](791k/960k) Debug::write "phpcheck.class.debug.php" Line 75
0string(34) CP1252"text mit Umlauten \xe4\xf6\xfc und \x80 Symbol"
Ok
debug::write Binary String 79 $var chr(0x7F).chr(3)."\t\r\n";
debug::write($var);
$t->checkOutput('\x7f,\x03,\t,\r,\n'); 
[0.026 ms]
[29.04.2024 00:45:24,681][+58 μs](793k/960k) Debug::write "phpcheck.class.debug.php" Line 80
0string(5) ASCII"\x7f\x03\t\r\n"
Ok
debug::write Binary String with \0 84 $var chr(0)."abc"."\0";
debug::write($var);
$t->checkOutput('\x00,abc'); 
[0.024 ms]
[29.04.2024 00:45:24,681][+36 μs](795k/960k) Debug::write "phpcheck.class.debug.php" Line 85
0string(5) ASCII"\x00abc\x00"
Ok
debug::write String with Backlash 89 $var "a".chr(0x5C)."b";  //'a\b' 3 chars
debug::write($var);
$t->checkOutput('string(3),'."a".chr(0x5C).chr(0x5C).'b'); 
[0.020 ms]
[29.04.2024 00:45:24,681][+31 μs](796k/960k) Debug::write "phpcheck.class.debug.php" Line 90
0string(3) ASCII"a\\b"
Ok
debug::write String with Backlash 94 $var "a\\b";  //'a\b' 3 chars
debug::write($var);
$t->checkOutput('string(3),'."a".chr(0x5C).chr(0x5C).'b'); 
[0.018 ms]
[29.04.2024 00:45:24,681][+28 μs](798k/960k) Debug::write "phpcheck.class.debug.php" Line 95
0string(3) ASCII"a\\b"
Ok
debug::write String with Single Quotes 99 $var "test's"
debug::write($var);
$t->checkOutput('string(6),'."test's"); 
[0.019 ms]
[29.04.2024 00:45:24,681][+25 μs](800k/960k) Debug::write "phpcheck.class.debug.php" Line 100
0string(6) ASCII"test's"
Ok
debug::write String with Double Quotes 104 $var "test \"hochkomma\""
debug::write($var);
$t->checkOutput('string(16),test,\"hochkomma'); 
[0.019 ms]
[29.04.2024 00:45:24,681][+27 μs](802k/960k) Debug::write "phpcheck.class.debug.php" Line 105
0string(16) ASCII"test \"hochkomma\""
Ok
debug::write String with many Spaces 109 $var "five     spaces"
debug::write($var);
$t->checkOutput('five,\x20\x20\x20\x20 '); 
[0.019 ms]
[29.04.2024 00:45:24,681][+26 μs](804k/960k) Debug::write "phpcheck.class.debug.php" Line 110
0string(15) ASCII"five\x20\x20\x20\x20 spaces"
Ok
debug::writePre Text 114 $sqlString "SELECT
  id, eventdate, eventdesc
FROM
  tab
LIMIT
  100;
"

debug::writePre($sqlString);
//check if 2 blank spaces in front of 100
$t->checkOutput('SELECT,  100'); 
[0.019 ms]
[29.04.2024 00:45:24,681][+30 μs](805k/960k) Debug::writePre "phpcheck.class.debug.php" Line 121
0string(58) ASCII
SELECT
  id, eventdate, eventdesc
FROM
  tab
LIMIT
  100;
Ok
debug::writeHex 126 $string "012";
debug::writeHex($string);
$t->checkOutput('\x30\x31\x32'); 
[0.024 ms]
[29.04.2024 00:45:24,682][+28 μs](807k/960k) Debug::writeHex "phpcheck.class.debug.php" Line 127
0string(3) ASCII
\x30\x31\x32
Ok
debug::writeUni 131 $string "0123\r\naöäü€ def";
debug::writeUni($string);
$t->checkOutput('0123\\x0d\\x0aa\\u{f6}\\u{e4}\\u{fc}\\u{20ac}\\x20def'); 
[0.129 ms]
[29.04.2024 00:45:24,682][+30 μs](809k/960k) Debug::writeUni "phpcheck.class.debug.php" Line 132
0string(20) UTF-8mb3
0123\x0d\x0aa\u{f6}\u{e4}\u{fc}\u{20ac}\x20def
Ok
debug::writeUni utf8mb4 136 $string "'takriLetterA:𑚀'";
debug::writeUni($string);
$t->checkOutput('takriLetterA:\u{11680}'); 
[0.036 ms]
[29.04.2024 00:45:24,682][+138 μs](811k/960k) Debug::writeUni "phpcheck.class.debug.php" Line 137
0string(19) UTF-8mb4
'takriLetterA:\u{11680}'
Ok
debug::writeIf: false 141 debug::save('first Info');
//with condition==false save-Info will be remove
$condition false;
debug::writeIf($condition,'second Info');
$t->checkEqual($t->getOutput(), ""); 
[0.029 ms]
Ok
debug::writeIf: true 148 debug::save('1.Info');
$condition true;
debug::writeIf($condition,'2.Info');
$t->checkOutput("save,1.Info,write,2.Info"); 
[0.043 ms]
[29.04.2024 00:45:24,682][+45 μs](813k/960k) Debug::save "phpcheck.class.debug.php" Line 148
0string(6) ASCII"1.Info"
[29.04.2024 00:45:24,682][+23 μs](814k/960k) Debug::writeIf "phpcheck.class.debug.php" Line 150
0string(6) ASCII"2.Info"
Ok
debug::write array 157 $var = array("a" => 1"b" => 5.6"string" => "text");
debug::write($var);
$t->checkOutput('array(3)'); 
[0.047 ms]
[29.04.2024 00:45:24,682][+30 μs](816k/960k) Debug::write "phpcheck.class.debug.php" Line 158
0array(3)
array (
  'a' => 1,
  'b' => 5.6,
  'string' => "text",
)
Ok
debug::writeHex array 162 $var = array("a" => 1"b" => 5.6"string" => "text");
debug::writeHex($var);
$t->checkOutput('array(3),\x74'); 
[0.054 ms]
[29.04.2024 00:45:24,682][+56 μs](818k/960k) Debug::writeHex "phpcheck.class.debug.php" Line 163
0array(3)
array (
  'a' => 1,
  'b' => 5.6,
  'string' => "\x74\x65\x78\x74",
)
Ok
debug::write Array with Recursion 167 $var = array("a","b");
$var['c'] = & $var;
debug::write($var);
$t->checkOutput('array'); 
[0.027 ms]
[29.04.2024 00:45:24,682][+70 μs](820k/960k) Debug::write "phpcheck.class.debug.php" Line 169
0array(3)
Array
(
    [0] => a
    [1] => b
    [c] => Array
 *RECURSION*
)
Ok
debug::write object 173 class data{
  public 
$p1 23;
  public 
$p2 "test_p2";
}
$var = new data;
debug::write($var);
$t->checkOutput('data::'); 
[0.040 ms]
[29.04.2024 00:45:24,682][+29 μs](822k/960k) Debug::write "phpcheck.class.debug.php" Line 178
0object(data)#2 (2)
\data::__set_state(array(
   'p1' => 23,
   'p2' => "test_p2",
))
Ok
debug::write object with *RECURSION* 182 $var->$var;
debug::write($var);
$t->checkOutput('data,RECURSION'); 
Unknown error 8192: Creation of dynamic property data::$c is deprecated (phpcheck.class.debug.php line 182)
[0.085 ms]
Deprecated: Creation of dynamic property data::$c is deprecated in /mnt/web313/c0/70/5508370/htdocs/pju24/check/phpcheck.class.debug.php on line 182
[29.04.2024 00:45:24,682][+109 μs](825k/960k) Debug::write "phpcheck.class.debug.php" Line 183
0object(data)#2 (3)
data Object
(
    [p1] => 23
    [p2] => test_p2
    [c] => data Object
 *RECURSION*
)
Ok
debug::write date-time object 187 $date = new DateTime();
debug::write($date);
$t->checkOutput(array('date',date("Y-m-d"))); 
[0.076 ms]
[29.04.2024 00:45:24,682][+60 μs](827k/960k) Debug::write "phpcheck.class.debug.php" Line 188
0object(DateTime)#3 (3)
\DateTime::__set_state(array(
   'date' => "2024-04-29 00:45:24.682641",
   'timezone_type' => 3,
   'timezone' => "UTC",
))
Ok
debug::write Simple XML 192 $strXml '<root><div attr="abc">45</div></root>';
$xml simplexml_load_string($strXml);
debug::write($xml);
$t->checkOutput('abc,45'); 
[0.475 ms]
[29.04.2024 00:45:24,682][+283 μs](829k/960k) Debug::write "phpcheck.class.debug.php" Line 194
0object(SimpleXMLElement)#4 (1)
<?xml version="1.0"?>
<root>
  <div attr="abc">45</div>
</root>
Ok
debug::write Simple XML attributes 198 debug::write($xml->div->attributes());
$t->checkOutput('abc'); 
[0.143 ms]
[29.04.2024 00:45:24,683][+287 μs](831k/960k) Debug::write "phpcheck.class.debug.php" Line 198
0object(SimpleXMLElement)#7 (1)
array(
   '@attributes' => 
  array (
    'attr' => "abc",
  ),
)
Ok
debug::write DOMDocument 202 $str "<!DOCTYPE html><div>test3</div>";
$doc = new DOMDocument();
$doc->loadHTML($str);
debug::write($doc);
$t->checkOutput('DOMDocument,&lt;div,test3,/div'); 
[0.133 ms]
[29.04.2024 00:45:24,683][+236 μs](834k/960k) Debug::write "phpcheck.class.debug.php" Line 205
0object(DOMDocument)#7 (0)
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE html>
<html>
  <body>
    <div>test3</div>
  </body>
</html>
Ok
debug::write DOMNodeList 209 $str "<!DOCTYPE html><div>test4</div>";
$doc = new DOMDocument();
$doc->loadHTML($str);
$nodeList $doc->getElementsByTagName('div');
debug::write($nodeList);
$t->checkOutput('DOMNodeList,&lt;div,test4,/div'); 
[0.092 ms]
[29.04.2024 00:45:24,683][+71 μs](836k/960k) Debug::write "phpcheck.class.debug.php" Line 213
0object(DOMNodeList)#7 (1)
array(
  DOMElement::'<div>test4</div>'
)
Ok
function socket_create not exists for test 225   $t->checkEqual(function_exists('socket_create'),true);  [0.002 ms]
false
Error
debug::write resource(gd) 230 $img imagecreate(100 50);
ImageColorAllocate($img02550);
debug::write($img);
$expectedOutput intval(PHP_VERSION) >= 
  
'object(GdImage)'
  
:  'resource(gd)'
;
$t->checkOutput($expectedOutput); 
[0.369 ms]
[29.04.2024 00:45:24,683][+113 μs](852k/960k) Debug::write "phpcheck.class.debug.php" Line 232
0object(GdImage)#8 (0)
 100 x 50 px (Error Creation of dynamic property data::$c is deprecated)
Ok
debug::write resource(gd) with error 240 $img imagecreate(50 50);
debug::write($img);
$t->checkOutput($expectedOutput); 
Warning: imagepng(): gd-png error: no colors in palette (class.debug.php line 868)
[0.043 ms]
[29.04.2024 00:45:24,684][+370 μs](851k/960k) Debug::write "phpcheck.class.debug.php" Line 241
0object(GdImage)#6 (0)
 50 x 50 px (Error imagepng(): gd-png error: no colors in palette)
Ok
debug::write truecolor resource gd 245 $img imagecreatetruecolor(50 50); 
$green ImageColorAllocate($img02550);
$blue imagecolorallocate($img00255);
imagefill($img00$green);
imagefilledrectangle($img101040,40$blue);
debug::write($img);
$t->checkOutput($expectedOutput); 
[9.775 ms]
[29.04.2024 00:45:24,684][+116 μs](862k/960k) Debug::write "phpcheck.class.debug.php" Line 250
0object(GdImage)#8 (0)
 50 x 50 px
Ok
debug::write gd with transparent 255 imagecolortransparent($img$blue);
debug::write($img);
$t->checkOutput($expectedOutput); 
[0.563 ms]
[29.04.2024 00:45:24,693][+9745 μs](864k/960k) Debug::write "phpcheck.class.debug.php" Line 256
0object(GdImage)#8 (0)
 50 x 50 px
Ok
setImgStyle new background 260 debug::setImgStyle('
  max-height:20rem;
  max-width:20rem;
  background-image: repeating-linear-gradient(-45deg, white, #88f 6px);
'
);
debug::write($img);
$t->checkOutput($expectedOutput); 
[0.512 ms]
[29.04.2024 00:45:24,694][+585 μs](866k/960k) Debug::write "phpcheck.class.debug.php" Line 265
0object(GdImage)#8 (0)
 50 x 50 px
Ok
debug::write inside function 269 function testFct1($par1,$par2) {
  
debug::write($par1,$par2);
}
testFct1("abc",78);
$t->checkOutput('testFct1(,abc,78'); 
[0.132 ms]
[29.04.2024 00:45:24,694][+530 μs](869k/960k) Debug::write "phpcheck.class.debug.php" Line 270 <= Line 272 testFct1("abc", 78)
0string(3) ASCII"abc"
1integer78 [0000004Eh]
Ok
debug::write inside object method 276 class testClass1{
  private 
$dateTimeObj;
  public function 
__construct(DateTime $par){
    
debug::write('$par,$this',$par,$this);
  }
}
$myclass = new testClass1(new datetime);
$t->checkOutput('__construct'); 
[0.094 ms]
[29.04.2024 00:45:24,695][+152 μs](872k/960k) Debug::write "phpcheck.class.debug.php" Line 279 <= Line 282 testClass1 {testClass1} -> __construct(object)
0string(10) ASCII"$par,$this"
1object(DateTime)#9 (3)
\DateTime::__set_state(array(
   'date' => "2024-04-29 00:45:24.695128",
   'timezone_type' => 3,
   'timezone' => "UTC",
))
2object(testClass1)#6 (1)
\testClass1::__set_state(array(
   'dateTimeObj' => NULL,
))
Ok
debug::write inside closure 286 $testFct2 = function ($par1,$par2) {
  
debug::write($par1,$par2);
};
$testFct2("text\r\n",95);
$t->checkOutput('closure,text,95'); 
[0.077 ms]
[29.04.2024 00:45:24,695][+93 μs](875k/960k) Debug::write "phpcheck.class.debug.php" Line 287 <= Line 289 {closure}("text\r\n", 95)
0string(6) ASCII"text\r\n"
1integer95 [0000005Fh]
Ok
debug::save 293 debug::save("Save into buffer, Output with next write");
debug::write();
$t->checkOutput('Debug::save,Save into'); 
[0.029 ms]
[29.04.2024 00:45:24,695][+87 μs](877k/960k) Debug::save "phpcheck.class.debug.php" Line 293
0string(40) ASCII"Save into buffer, Output with next write"
[29.04.2024 00:45:24,695][+19 μs](878k/960k) Debug::write "phpcheck.class.debug.php" Line 294
Ok
debug::clear 298 debug::save("Save Info, do not know if it is needed");
debug::clear(); // delete all save-infos !
debug::write('First information is not output');
$t->checkOutput('Debug::write,not output'); 
[0.036 ms]
[29.04.2024 00:45:24,695][+19 μs](879k/960k) Debug::write "phpcheck.class.debug.php" Line 300
0string(31) ASCII"First information is not output"
Ok
debug::stop at once 304 try{
  
debug::stop(true,"Stop at once");
} catch(
exception $e){
  echo 
"stop_exception";
}
$t->checkOutput('Stop at once,stop_exception'); 
[0.047 ms]
[29.04.2024 00:45:24,695][+31 μs](881k/960k) Debug::stop "phpcheck.class.debug.php" Line 305
0string(12) ASCII"Stop at once"
stop_exception
Ok
debug::stop at 4. cycle 312 try{
  for(
$i=1;$i<10;$i++){
    
debug::stop(4,"Stop at cycle",$i);
  }
} catch(
exception $e){
  echo 
"stop_exception at cycle ".$i;
}
$t->checkOutput('stop_exception at cycle 4'); 
[0.038 ms]
[29.04.2024 00:45:24,695][+61 μs](884k/960k) Debug::stop "phpcheck.class.debug.php" Line 314
0string(13) ASCII"Stop at cycle"
1integer4 [00000004h]
stop_exception at cycle 4
Ok
write with red background 322 debug::wrc('important message');
$t->checkOutput('wrc'); 
[0.071 ms]
[29.04.2024 00:45:24,695][+88 μs](886k/960k) Debug::wrc "phpcheck.class.debug.php" Line 322
0string(17) ASCII"important message"
Ok
get debug info as html 326 $result debug::html('a info');
$t->checkContains($result,'a info'); 
[0.020 ms]
[29.04.2024 00:45:24,695][+33 μs](872k/960k) Debug::html "phpcheck.class.debug.php" Line 326
0string(6) ASCII"a info"
Ok
strhex: 330 $result debug::strhex("test\r\n");
$t->checkEqual($result'\x74\x65\x73\x74\x0d\x0a'); 
[0.005 ms]
\x74\x65\x73\x74\x0d\x0a
Ok
systeminfo 334 debug::systeminfo();
$t->checkOutput(); 
[0.029 ms]
[29.04.2024 00:45:24,695][+47 μs](891k/960k) Debug::write "class.debug.php" Line 396 <="phpcheck.class.debug.php" Line 334 Debug :: systeminfo()
0string(25) ASCII"Linux PHP 8.2.18 (64Bit) "
Ok
set and get timestamps 338 debug::setTimestamp(0);
debug::microSleep(10000);
$result debug::getTimestampDiff(0);
$t->check($result,$result-10000 150); 
[10.0 ms]
10014
Ok
get diff timestamp 344 $result debug::getTimestampDiff(0);
$t->check($result,$result>10000); 
[0.002 ms]
10056
Ok
debug::switchLog - enable 348 //Simulate extern task to enable output
file_put_contents(__DIR__.'/debug.switch',"1");
debug::switchLog(); //refresh Switch
debug::write("This information is shown");
$t->checkOutput('Debug::write,This information is shown'); 
[5.897 ms]
[29.04.2024 00:45:24,711][+15 ms](893k/960k) Debug::write "phpcheck.class.debug.php" Line 351
0string(25) ASCII"This information is shown"
Ok
debug::switchLog - disable 355 //Simulate extern task to disable output
file_put_contents(__DIR__.'/debug.switch',"0");
debug::switchLog();
debug::write("Info is not shown");
$t->checkOutput(''); 
[1.788 ms]
Ok
debug::switchLog - enable permanent 362 debug::switchLog(true); //enable,ignore extern file
debug::write("This information is also shown");
$t->checkOutput('Debug::write,also'); 
[0.080 ms]
[29.04.2024 00:45:24,713][+1942 μs](896k/960k) Debug::write "phpcheck.class.debug.php" Line 363
0string(30) ASCII"This information is also shown"
Ok
debug::log("TMP") - log into tempfile 367 debug::log("TMP");
debug::write('LOGINFO');
$tmpFileName debug::getLogFileName();
$logContent file_get_contents($tmpFileName);  //read file
$testOk strpos($logContent,"LOGINFO") > 0;
$t->check($logContent$testOk); 
[6.090 ms]
Debug Log TMP
[29.04.2024 00:45:24,717][+3542 μs](881k/960k) Debug::write "phpcheck.class.debug.php" Line 368
0string(7) ASCII"LOGINFO"
Ok
Delete temp. Logfile 375 debug::deleteLogFile();
$t->check($tmpFileName, !file_exists($tmpFileName)); 
[5.420 ms]
log20240429004524_7135.html
Ok
Get 32-bit CRC of String, Object, Array 379 $result debug::crc('abc');
$t->checkEqual($result'2E5A7DD1'); 
[0.016 ms]
2E5A7DD1
Ok
Get TypeInfo of String Variable 383 $result debug::TypeInfo('abc');
$t->checkContains($result'string,3'); 
[0.018 ms]
string(3) ASCII
Ok
Get TypeInfo of Class Instance 387 $object = (object)array(1,2);
$result debug::TypeInfo($object);
$t->checkContains($result'object(stdClass),(2)'); 
[0.007 ms]
object(stdClass)#10 (2)
Ok
Get TypeInfo of Class implements Countable 392 class counter implements Countable {
    #[
\ReturnTypeWillChange]
    public function 
count() {
       return 
17
    }
}
$object = new counter();
$result debug::TypeInfo($object);
$t->checkContains($result'object(counter),(17)'); 
[0.017 ms]
object(counter)#12 (17)
Ok
Get TypeInfo of DOMNodeList 403 $html ='<li>Text1-1</li><li>Text2-2</li>';
$doc = new DOMDocument();
$r $doc->loadHTML($html);
$nodelist $doc -> getElementsByTagName("li");
$result debug::TypeInfo($nodelist);
$t->checkContains($result'object(DOMNodeList),(2)'); 
[0.084 ms]
object(DOMNodeList)#13 (2)
Ok
strToUnicode 412 $result debug::strToUnicode('A');
$t->checkEqual($result'A'); 
[0.007 ms]
A
Ok
strToUnicode with " ans space 416 $result debug::strToUnicode(' !"#A~');
$t->checkEqual($result'\x20!\x22#A~'); 
[0.010 ms]
\x20!\x22#A~
Ok
strToUnicode 420 $result debug::strToUnicode("ä\x80𑚀€");
$t->checkEqual($result'\u{e4}\x80\u{11680}\u{20ac}'); 
[0.020 ms]
\u{e4}\x80\u{11680}\u{20ac}
Ok
strToUnicode contain UTF8-Fragment 424 $string "ä".substr("€",0,1)."äx";
$result debug::strToUnicode($string);
$t->checkEqual($result'\u{e4}\xe2\u{e4}x'); 
[0.011 ms]
\u{e4}\xe2\u{e4}x
Ok
strToUnicode contain UTF8-Fragment 429 $string "ä".substr("€",0,2)."äY";
$result debug::strToUnicode($string);
$t->checkEqual($result'\u{e4}\xe2\x82\u{e4}Y'); 
[0.009 ms]
\u{e4}\xe2\x82\u{e4}Y
Ok
strToUnicode check control chars 434 $result debug::strToUnicode("\x03\r\n");
$expected '\x03\x0d\x0a';
$t->checkEqual($result,$expected); 
[0.005 ms]
\x03\x0d\x0a
Ok
unicodeToString 440 $code 'a\x42\u{e4}\u{20ac}';  //not parsed in single quotes
$result debug::unicodeToString($code);
$t->checkEqual($result"aBä€"); 
[0.106 ms]
aBä€
Ok
UniDecode 446 $result debug::UniDecode('U+0041');
$t->checkEqual($result'A'); 
[0.034 ms]
A
Ok
UniDecode 4 Byte UTF 450 $result debug::UniDecode('U+1F603');
$t->checkEqual($result'😃'); 
[0.002 ms]
😃
Ok
UniDecode invalid Notation 454 $result debug::UniDecode('U+1F60X');
$t->checkEqual($resultfalse); 
[0.001 ms]
false
Ok
detect_encoding ASCII 459 $string "Ein ASCII String";
$result debug::detect_encoding($string);
$t->checkEqual($result'ASCII'); 
[0.006 ms]
ASCII
Ok
detect_encoding UTF-8 464 $string "German ä is a UTF-8 character";
$result debug::detect_encoding($string);
$t->checkEqual($result'UTF-8'); 
[0.003 ms]
UTF-8
Ok
detect_encoding UTF-8mb3 469 $string "€ ist a 3 byte UTF-8 character";
$result debug::detect_encoding($string);
$t->checkEqual($result'UTF-8mb3'); 
[0.003 ms]
UTF-8mb3
Ok
is header sent 475 $t->checkEqual(debug::isHeaderSent(), false);  [0.004 ms]
false
Ok
headerInfo() 478 $result debug::headerInfo();
$t->check($resultis_array($result)); 
[0.008 ms]
array (
  'headerSent' => false,
  'fileName' => '',
  'line' => 0,
  'output_buffering' => '',
  'bytes output buffer' => false,
  'headers' => 
  array (
    0 => 'X-Powered-By: PHP/8.2.18',
    1 => 'Content-Type: text/html; charset=UTF-8',
  ),
)
Ok
detect UTF16LE 483 $str 'A Teststring with characters € + äöü';
$test mb_convert_encoding($str'UTF-16LE','UTF-8');
$result debug::detectUTFencoding($test);
$t->checkEqual($result'UTF-16LE'); 
[0.117 ms]
UTF-16LE
Ok
detect UTF16LE with BOM 489 $test "\xff\xfe".mb_convert_encoding($str'UTF-16LE','UTF-8');
$result debug::detectUTFencoding($test);
$t->checkEqual($result'UTF-16LE_BOM'); 
[0.005 ms]
UTF-16LE_BOM
Ok
detect UTF16BE 494 $str 'A Teststring with characters € + äöü';
$test mb_convert_encoding($str'UTF-16BE','UTF-8');
$result debug::detectUTFencoding($test);
$t->checkEqual($result'UTF-16BE'); 
[0.011 ms]
UTF-16BE
Ok
detect UTF16BE with BOM 500 $test "\xfe\xff".mb_convert_encoding($str'UTF-16BE','UTF-8');
$result debug::detectUTFencoding($test);
$t->checkEqual($result'UTF-16BE_BOM'); 
[0.004 ms]
UTF-16BE_BOM
Ok
detect UTF32LE 505 $str 'A Teststring with characters € + äöü';
$test mb_convert_encoding($str'UTF-32LE','UTF-8');
$result debug::detectUTFencoding($test);
$t->checkEqual($result'UTF-32LE'); 
[0.008 ms]
UTF-32LE
Ok
detect UTF32LE with BOM 511 $test "\xff\xfe\x00\x00".mb_convert_encoding($str'UTF-32LE','UTF-8');
$result debug::detectUTFencoding($test);
$t->checkEqual($result'UTF-32LE_BOM'); 
[0.002 ms]
UTF-32LE_BOM
Ok
detect UTF32BE 516 $str 'A Teststring with characters € + äöü';
$test mb_convert_encoding($str'UTF-32BE','UTF-8');
$result debug::detectUTFencoding($test);
$t->checkEqual($result'UTF-32BE'); 
[0.007 ms]
UTF-32BE
Ok
detect UTF32BE with BOM 522 $test "\x00\x00\xfe\xff".mb_convert_encoding($str'UTF-32BE','UTF-8');
$result debug::detectUTFencoding($test);
$t->checkEqual($result'UTF-32BE_BOM'); 
[0.002 ms]
UTF-32BE_BOM
Ok
detect UTF8 527 $str 'A Teststring with characters € + äöü';
$test $str;
$result debug::detectUTFencoding($test);
$t->checkEqual($result'UTF-8'); 
[0.007 ms]
UTF-8
Ok
detect UTF8 with BOM 533 $test "\xef\xbb\xbf".$str;
$result debug::detectUTFencoding($test);
$t->checkEqual($result'UTF-8_BOM'); 
[0.002 ms]
UTF-8_BOM
Ok
detect other 538 $str 'A Teststring with characters € + äöü';
//$test = utf8_decode($str);  //deprecated PHP 8.2
$test mb_convert_encoding($str'ISO-8859-1''UTF-8');
$result debug::detectUTFencoding($test);
$t->checkEqual($result'Other'); 
[0.008 ms]
Other
Ok