Voting

: max(five, eight)?
(Example: nine)

The Note You're Voting On

jasonrlester at yahoo dot com
17 years ago
sadly troy is right

the following script will return:

resource(5) of type (stream)
int(0)

<?php

define
("FOPEN_RESOURCE", 1);
define("FOPEN_FILEPATH", "/path/to/file");

$fopen_resource = fopen(FOPEN_FILEPATH, "w");

var_dump($fopen_resource);

$shm_id = shm_attach(1);
if (
$shm_id === false)
{
echo
"Fail to attach shared memory.\n";
}

if (!
shm_put_var($shm_id, FOPEN_RESOURCE, $fopen_resource))
{
echo
"Failed to put var 1 in shared memory $shm_id.\n";
}

$sm_fopen_resource = shm_get_var($shm_id, FOPEN_RESOURCE);
if (
$sm_fopen_resource === false)
{
echo
"Failed to retreive fopen_resource from Shared memory\r\n";
}

var_dump($sm_fopen_resource);

if(
$shm_id) shm_remove($shm_id);
if(
$fopen_resource) fclose($fopen_resource);

?>

<< Back to user notes page

To Top