"Fossies" - the Fresh Open Source Software Archive

Member "php-8.0.28-src/ext/sysvmsg/tests/001.phpt" (14 Feb 2023, 461 Bytes) of package /windows/www/php-8.0.28-src.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 --TEST--
    2 send/receive serialized message.
    3 --SKIPIF--
    4 <?php
    5 if (!extension_loaded("sysvmsg")) print "skip"; ?>
    6 --FILE--
    7 <?php
    8 $key = ftok(__DIR__ . "/001.phpt", "p");
    9 $q = msg_get_queue($key);
   10 msg_send($q, 1, "hello") or print "FAIL\n";
   11 $type = null;
   12 if (msg_receive($q, 0, $type, 1024, $message)) {
   13     echo "TYPE: $type\n";
   14     echo "DATA: $message\n";
   15 }
   16 if (!msg_remove_queue($q)) {
   17     echo "BAD: queue removal failed\n";
   18 }
   19 ?>
   20 --EXPECT--
   21 TYPE: 1
   22 DATA: hello