note 120702 deleted from migration56.new-features by sobak

From: Date: Sat, 25 Feb 2017 05:58:17 +0000
Subject: note 120702 deleted from migration56.new-features by sobak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-208836@lists.php.net to get a copy of this message
Note Submitter: hushuilong at g-mail dot com ---- <?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: '.Phalcon\Version::get() : 'no phalcon'; ?> =========================== it seems that phalcon extension changes the behavior of __call. ➜ 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 phalcon: 1.3.5%

« previous php.notes (#208836) next »