Doc #80515 [Com]: The behavior of ReflectionClass::getMethods() changed in 7.4
| From: | mark at fastmail dot net | Date: | Mon, 14 Dec 2020 20:13:03 +0000 |
| Subject: | Doc #80515 [Com]: The behavior of ReflectionClass::getMethods() changed in 7.4 | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-18260@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80515&edit=1
ID: 80515
Comment by: mark at fastmail dot net
Reported by: mark at fastmail dot net
Summary: The behavior of ReflectionClass::getMethods()
changed in 7.4
Status: Not a bug
Type: Documentation Problem
Package: Reflection related
Operating System: Windows
PHP Version: 7.4.13
Block user comment: N
Private report: N
New Comment:
Thanks very much for pointing that mistake out. I suppose that means the behavior of
"$reflectionClass->getMethods(true)" is really what changed. I have noticed that
undocumented "features" are sometimes mentioned in "Backward Incompatible
Changes", but I'm guessing this wouldn't be a common/risky enough case to make the
list.
Previous Comments:
------------------------------------------------------------------------
[2020-12-14 19:57:20] requinix@php.net
|| is *boolean* OR
| is *bitwise* OR
You should have been using the latter.
------------------------------------------------------------------------
[2020-12-14 19:51:28] mark at fastmail dot net
Description:
------------
Specifying logically ORed filter arguments results in "and" behavior in 7.3, but results
in "or" behavior in 7.4. The provided test script returns both methods in 7.4, but only
the first method in 7.3. Should this change be added to the "Backward Incompatible
Changes" page?
Test script:
---------------
<?php
class A{
static function one(){}
function two(){}
}
$class = new ReflectionClass(A::class);
var_dump($class->getMethods(ReflectionMethod::IS_PUBLIC || ReflectionMethod::IS_STATIC));
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80515&edit=1