Bug #74162 [Opn->Nab]: ... operator exception on special version 5.6.6
| From: | requinix@php.net | Date: | Fri, 24 Feb 2017 06:20:12 +0000 |
| Subject: | Bug #74162 [Opn->Nab]: ... operator exception on special version 5.6.6 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207538@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74162&edit=1
ID: 74162
Updated by: requinix@php.net
Reported by: hushuilong at gmail dot com
Summary: ... operator exception on special version 5.6.6
-Status: Open
+Status: Not a bug
Type: Bug
Package: Output Control
Operating System: Debian
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
.
Previous Comments:
------------------------------------------------------------------------
[2017-02-24 04:15:24] hushuilong at gmail dot com
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
------------------------------------------------------------------------
[2017-02-24 02:36:41] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74162&edit=1