Doc #65042 [Asn->Csd]: Protected, private __invoke() magic method raises Warning

From: Date: Mon, 31 Dec 2018 20:01:09 +0000
Subject: Doc #65042 [Asn->Csd]: Protected, private __invoke() magic method raises Warning
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16263@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65042&edit=1

 ID:                 65042
 Updated by:         cmb@php.net
 Reported by:        pha dot bridgman at gmail dot com
 Summary:            Protected, private __invoke() magic method raises
                     Warning
-Status:             Assigned
+Status:             Closed
 Type:               Documentation Problem
 Package:            Class/Object related
 Operating System:   N/A
 PHP Version:        Irrelevant
 Assigned To:        girgias
 Block user comment: N
 Private report:     N

 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


Previous Comments:
------------------------------------------------------------------------
[2018-12-31 19:59:39] cmb@php.net

Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=346507
Log: Fix #65042: Protected, private __invoke() magic method raises Warning

Patch provided by girgias.

------------------------------------------------------------------------
[2018-12-30 14:50:19] girgias@php.net

The following patch has been added/updated:

Patch Name: magic-method-must-constant
Revision:   1546181419
URL:        https://bugs.php.net/patch-display.php?bug=65042&patch=magic-method-must-constant&revision=1546181419

------------------------------------------------------------------------
[2013-06-16 20:19:39] pha dot bridgman at gmail dot com

Point taken with regard to consistency; perhaps I would have better expressed myself by saying that
allowing magic methods with restricted visibility would be more consistent with the expected
operation of class methods.

I understand from reading bug #61025 that in 5.5 (as in previous versions) these magic methods are
forcibly public; perhaps as a future project the ability to restrict their visibility could be
realised.

------------------------------------------------------------------------
[2013-06-16 18:14:40] bjori@php.net

See also bug#61025

------------------------------------------------------------------------
[2013-06-16 18:10:24] bjori@php.net

zend_error(E_WARNING, "The magic method __call() must have public visibility and 
cannot be static");
zend_error(E_WARNING, "The magic method __callStatic() must have public 
visibility and be static");
zend_error(E_WARNING, "The magic method __get() must have public visibility and 
cannot be static");
zend_error(E_WARNING, "The magic method __set() must have public visibility and 
cannot be static");
zend_error(E_WARNING, "The magic method __unset() must have public visibility and 
cannot be static");
zend_error(E_WARNING, "The magic method __isset() must have public visibility and 
cannot be static");
zend_error(E_WARNING, "The magic method __toString() must have public visibility 
and cannot be static");
zend_error(E_WARNING, "The magic method __invoke() must have public visibility 
and cannot be static");
zend_error(E_WARNING, "The magic method __call() must have public visibility and 
cannot be static");
zend_error(E_WARNING, "The magic method __callStatic() must have public 
visibility and be static");
zend_error(E_WARNING, "The magic method __get() must have public visibility and 
cannot be static");
zend_error(E_WARNING, "The magic method __set() must have public visibility and 
cannot be static");
zend_error(E_WARNING, "The magic method __unset() must have public visibility and 
cannot be static");
zend_error(E_WARNING, "The magic method __isset() must have public visibility and 
cannot be static");
zend_error(E_WARNING, "The magic method __toString() must have public visibility 
and cannot be static");
zend_error(E_WARNING, "The magic method __invoke() must have public visibility 
and cannot be static");

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=65042


--
Edit this bug report at https://bugs.php.net/bug.php?id=65042&edit=1


Thread (6 messages)

« previous php.doc.bugs (#16263) next »