note 2956 modified in function.shm-remove by felipe

From: Date: Sun, 20 Jul 2008 23:19:53 +0000
Subject: note 2956 modified in function.shm-remove by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-142343@lists.php.net to get a copy of this message
Though it says **shm_identifier** in int shm_remove(int shm_identifier); and shm_attach() returns an **id** that that can be used to access the System V... a snippet like this: <?php $key = 1234; $shm=shm_attach($key); // do whatever... shm_remove($shm); ?> produces an error like Warning: 2(which is the value of $shm) is not a existing SysV shared memory key in /usr/cu/web/sema.php on line 44... The documentation confused me a bit. I thought shm_remove would get the shm handle/id that returns from shm_attach, not the key given to shm_attach. So, use instead: shm_remove($key); which is what is intended indeed. --was-- Though it says **shm_identifier** in <PRE> int shm_remove(int shm_identifier); </PRE> and <PRE> shm_attach() returns an **id** that that can be used to access the System V... </PRE> a snippet like this: <PRE> $key = 1234; $shm=shm_attach($key); // do whatever... shm_remove($shm); </PRE> produces an error like Warning: 2(which is the value of $shm) is not a existing SysV shared memory key in /usr/cu/web/sema.php on line 44... The documentation confused me a bit. I thought shm_remove would get the shm handle/id that returns from shm_attach, not the key given to shm_attach. So, use instead: <PRE> shm_remove($key); </PRE> which is what is intended indeed. http://php.net/manual/en/function.shm-remove.php

« previous php.notes (#142343) next »