Doc #81098 [Ver->Csd]: shmop_close is deprecated because shmop uses objects
| From: | cmb@php.net | Date: | Wed, 22 Sep 2021 09:20:33 +0000 |
| Subject: | Doc #81098 [Ver->Csd]: shmop_close is deprecated because shmop uses objects | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-19206@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81098&edit=1
ID: 81098
Updated by: cmb@php.net
Reported by: santiagopereyra dot 95 at gmail dot com
Summary: shmop_close is deprecated because shmop uses objects
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: Unknown/Other Function
Operating System: Linux
PHP Version: 8.0.6
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The documentation has been updated in the meantime.
Previous Comments:
------------------------------------------------------------------------
[2021-06-02 02:16:31] requinix@php.net
Since PHP 8.0, the shmop functions use objects instead of resources, thus there is no need to call
shmop_close (PHP will do that automatically when the object is no longer used).
This is not currently documented.
------------------------------------------------------------------------
[2021-06-02 02:08:37] santiagopereyra dot 95 at gmail dot com
Ok it's true. My fault. Thanks for support :)
Can I ask here why is shmop_close marked as deprecated? I didn't see anything in the docs.
Can I submit an issue in the doc-en repo?
------------------------------------------------------------------------
[2021-06-02 01:47:38] ghhta at hgh dot bhg
as the function exists but is deprecated why in the world should it return anything else but true?
if it wouldn't exist you would get a fatal error
that's what deprecations all about: warning about stuff which will be removed in the future so
that you notice it and fix your code before it's removed in later releases
------------------------------------------------------------------------
[2021-06-02 01:46:10] requinix@php.net
function_exists returns whether the function exists. Deprecated functions still exist.
------------------------------------------------------------------------
[2021-06-02 01:41:15] santiagopereyra dot 95 at gmail dot com
Description:
------------
In PHP 8.0.6, shmop_close returns me a Deprecated error, but the function_exists method returns me
true. I don't know if it's an error in the shmop method, or the function_exists method.
configure line:
./configure --enable-mbstring --with-mysqli --enable-shmop --enable-pcntl
Test script:
---------------
<?php
echo var_export(function_exists("shmop_close"), true);
if (function_exists("shmop_close")) shmop_close();
Expected result:
----------------
false
Actual result:
--------------
true
Deprecated: Function shmop_close() is deprecated in [...]
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81098&edit=1