mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
b1223ee35f
A slight imperfection in https://github.com/php/php-src/pull/7443. As a zend_API, we should also consider other extensions that may call it in methods. This change will not break the behavior of php-src.
30 lines
611 B
PHP
30 lines
611 B
PHP
--TEST--
|
|
Zend: Test zend_forbid_dynamic_call() for methods
|
|
--EXTENSIONS--
|
|
zend_test
|
|
--FILE--
|
|
<?php
|
|
|
|
$object = new ZendTestForbidDynamicCall();
|
|
$object->call();
|
|
ZendTestForbidDynamicCall::callStatic();
|
|
|
|
try {
|
|
$call = [$object, 'call'];
|
|
$call();
|
|
} catch (Error $error) {
|
|
echo $error->getMessage(), "\n";
|
|
}
|
|
|
|
try {
|
|
$callStatic = [ZendTestForbidDynamicCall::class, 'callStatic'];
|
|
$callStatic();
|
|
} catch (Error $error) {
|
|
echo $error->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Cannot call ZendTestForbidDynamicCall::call() dynamically
|
|
Cannot call ZendTestForbidDynamicCall::callStatic() dynamically
|