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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hushuilong at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Thu Dec 26 12:01:30 2024 UTC