"Fossies" - the Fresh Open Source Software Archive

Member "php-7.4.1/ext/sysvmsg/tests/001.phpt" (17 Dec 2019, 452 Bytes) of package /linux/www/php-7.4.1.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "001.phpt": 7.3.12_vs_7.4.0.

    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