php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74162 ... operator exception on special version 5.6.6
Submitted: 2017-02-24 02:36 UTC Modified: 2017-02-24 06:20 UTC
From: hushuilong at gmail dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: Irrelevant OS: Debian
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
21 + 13 = ?
Subscribe to this entry?

 
 [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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-02-24 04:15 UTC] 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 06:20 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2017-02-24 06:20 UTC] requinix@php.net
.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC