|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-02-24 02:36 UTC] hushuilong at gmail dot com
Description: ------------ --- From manual page: http://www.php.net/migration56.new-features --- ... operator exception on special version 5.6.6 i report it because i can't google it. Test script: --------------- <?php // return $instance->$method(...$args); class Abc{ protected function prefix($parameters) { echo "xxxxxxxxxxxxxxxx\n"; var_dump($parameters); } public function __call($method, $args) { echo "****************\n"; var_dump($method, $args); // debug_zval_dump( $args ); } } $instance = new Abc; $args = ['api']; $instance->prefix(...$args); echo 'phpversion: ', phpversion(), "\n"; ?> Expected result: ---------------- ========================== output on 5.6.5: **************** string(6) "prefix" array(0) { } phpversion: 5.6.5 ========================== output on other version not 5.6.5 : **************** string(6) "prefix" array(1) { [0]=> string(3) "api" } phpversion: 5.6.24-1+b1 Actual result: -------------- ========================== output on 5.6.5: **************** string(6) "prefix" array(0) { } phpversion: 5.6.5 ========================== output on other version not 5.6.5 : **************** string(6) "prefix" array(1) { [0]=> string(3) "api" } phpversion: 5.6.24-1+b1 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
Sorry, it's not a bug, it seems that phalcon extension changes the behavior of __call. <?php // return $instance->$method(...$args); class Abc{ protected function prefix($parameters) { echo "xxxxxxxxxxxxxxxx\n"; var_dump($parameters); } public function __call($method, $args) { echo "****************\n"; var_dump($method, $args); // debug_zval_dump( $args ); } } $instance = new Abc; $args = ['api']; $instance->prefix(...$args); echo 'phpversion: ', phpversion(), "\n"; echo extension_loaded('phalcon') ? Phalcon\Version::get() : 'no phalcon'; ?> =========================== test output: ➜ php-5.6.30 phpbrew ext disable phalcon [ ] phalcon extension is disabled. ➜ php-5.6.30 php /web/test/x.php **************** string(6) "prefix" array(1) { [0]=> string(3) "api" } phpversion: 5.6.30 no phalcon ➜ php-5.6.30 phpbrew ext enable phalcon ===> Enabling extension phalcon [*] phalcon extension is enabled. ➜ php-5.6.30 php /web/test/x.php **************** string(6) "prefix" array(0) { } phpversion: 5.6.30 1.3.5