|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2018-07-02 18:22 UTC] nikic@php.net
-Status: Open
+Status: Wont fix
[2018-07-02 18:22 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 14:00:01 2025 UTC |
Description: ------------ Strict type declarations are not enforced when a function or method is invoked via the Reflection API. The test script generates the same result with PHP 7.0.25-dev (f48abfa9022c026c2447b14bc03c978d2b831b27), 7.1.11-dev (d8881f4eb4ec138db00d5fcf0b27a64f8986cd85), PHP 7.2.0-dev (611d117b24b58544ef69390cfe44166ba606b0ab), and PHP 7.3.0-dev (39ded1d5f85ca3358cc8a52bb37e72a5eb5ce0db). Test script: --------------- <?php declare(strict_types=1); function f(bool $a) { var_dump($a); } $f = new ReflectionFunction('f'); $f->invokeArgs([1]); // or $f->invoke(1); Expected result: ---------------- TypeError exception because int(1) does not match bool. Actual result: -------------- bool(true)