php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #81098 shmop_close is deprecated because shmop uses objects
Submitted: 2021-06-02 01:41 UTC Modified: 2021-09-22 09:20 UTC
From: santiagopereyra dot 95 at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 8.0.6 OS: Linux
Private report: No CVE-ID: None
 [2021-06-02 01:41 UTC] 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 [...]

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-06-02 01:46 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2021-06-02 01:46 UTC] requinix@php.net
function_exists returns whether the function exists. Deprecated functions still exist.
 [2021-06-02 01:47 UTC] 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 02:08 UTC] 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 02:16 UTC] requinix@php.net
-Summary: shmop_close returns deprecated but function_exists recognizes as valid +Summary: shmop_close is deprecated because shmop uses objects -Status: Not a bug +Status: Verified -Type: Bug +Type: Documentation Problem -Package: *General Issues +Package: Unknown/Other Function
 [2021-06-02 02:16 UTC] 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-09-22 09:20 UTC] cmb@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-09-22 09:20 UTC] cmb@php.net
The documentation has been updated in the meantime.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 04:01:28 2024 UTC