|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesprotectedConstruct (last revision 2014-03-23 12:50 UTC by ian dot email at qq dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-03-23 12:56 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2014-03-23 12:56 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 14:00:01 2025 UTC |
Description: ------------ class A{ protected function __construct(){} } why can't set private/protected construct $method=$class->getmethod('__construct'); $method->setAccessible(true); $fuc=$class->newInstance(true); Test script: --------------- class A{ protected function __construct(){} } why can't set private/protected construct $method=$class->getmethod('__construct'); $method->setAccessible(true); $fuc=$class->newInstance(true); Expected result: ---------------- class A{ protected function __construct(){} } why can't set private/protected construct $method=$class->getmethod('__construct'); $method->setAccessible(true); $fuc=$class->newInstance(true); Actual result: -------------- class A{ protected function __construct(){} } why can't set private/protected construct $method=$class->getmethod('__construct'); $method->setAccessible(true); $fuc=$class->newInstance(true);