发表文章

[PHP] 在 php 中为 foreach () 提供的参数无效. php: 1282 Invalid argument supplied for foreach() in PHP.php:1282[MadelineProto]

incubus 2017-10-9 68

你好!

我收到了 Invalid argument supplied for foreach() 与最新主控形状有关的错误消息。

$ php -v
PHP 7.2.0beta3 (cli) (built: Aug 23 2017 09:46:51) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0-dev, Copyright (c) 1998-2017 Zend Technologies
AuthKeyHandler:   Executing p/g checks (1/2)...
Exception:        Invalid argument supplied for foreach() in PHP.php:1282
AuthKeyHandler:   An exception occurred while generating the authorization key: Invalid argument supplied for foreach() in PHP on line 1282. Retrying...
PHP Fatal error:  Uncaught danog\MadelineProto\SecurityException: Auth Failed in /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php:418
Stack trace:
#0 /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProto.php(695): danog\MadelineProto\MTProto->create_auth_key(-1, 2)
#1 /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProto.php(667): danog\MadelineProto\MTProto->init_authorization()
#2 /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProto.php(242): danog\MadelineProto\MTProto->connect_to_all_dcs()
#3 /Users/incubus/workspace/test/vendor/MadelineProto/vendor/danog/magicalserializer/src/danog/Serializable.php(35): danog\MadelineProto\MTProto->___construct(Array)
#4 /Us in /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php on line 418

Fatal error: Uncaught danog\MadelineProto\SecurityException: Auth Failed in /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php:418
Stack trace:
#0 /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProto.php(695): danog\MadelineProto\MTProto->create_auth_key(-1, 2)
#1 /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProto.php(667): danog\MadelineProto\MTProto->init_authorization()
#2 /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProto.php(242): danog\MadelineProto\MTProto->connect_to_all_dcs()
#3 /Users/incubus/workspace/test/vendor/MadelineProto/vendor/danog/magicalserializer/src/danog/Serializable.php(35): danog\MadelineProto\MTProto->___construct(Array)
#4 /Us in /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php on line 418
原文:

Hi!

I get Invalid argument supplied for foreach() error message with the latest master.

$ php -v
PHP 7.2.0beta3 (cli) (built: Aug 23 2017 09:46:51) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0-dev, Copyright (c) 1998-2017 Zend Technologies
AuthKeyHandler:   Executing p/g checks (1/2)...
Exception:        Invalid argument supplied for foreach() in PHP.php:1282
AuthKeyHandler:   An exception occurred while generating the authorization key: Invalid argument supplied for foreach() in PHP on line 1282. Retrying...
PHP Fatal error:  Uncaught danog\MadelineProto\SecurityException: Auth Failed in /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php:418
Stack trace:
#0 /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProto.php(695): danog\MadelineProto\MTProto->create_auth_key(-1, 2)
#1 /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProto.php(667): danog\MadelineProto\MTProto->init_authorization()
#2 /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProto.php(242): danog\MadelineProto\MTProto->connect_to_all_dcs()
#3 /Users/incubus/workspace/test/vendor/MadelineProto/vendor/danog/magicalserializer/src/danog/Serializable.php(35): danog\MadelineProto\MTProto->___construct(Array)
#4 /Us in /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php on line 418

Fatal error: Uncaught danog\MadelineProto\SecurityException: Auth Failed in /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php:418
Stack trace:
#0 /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProto.php(695): danog\MadelineProto\MTProto->create_auth_key(-1, 2)
#1 /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProto.php(667): danog\MadelineProto\MTProto->init_authorization()
#2 /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProto.php(242): danog\MadelineProto\MTProto->connect_to_all_dcs()
#3 /Users/incubus/workspace/test/vendor/MadelineProto/vendor/danog/magicalserializer/src/danog/Serializable.php(35): danog\MadelineProto\MTProto->___construct(Array)
#4 /Us in /Users/incubus/workspace/test/vendor/MadelineProto/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php on line 418
相关推荐
最新评论 (9)
mugavri 2017-10-9
1

我有完全相同的问题, 请帮助

原文:

I have exactly the same problem, please help

wecanco 2017-10-9
2

发送代码的 lines1270 到 1290 php. php 文件要检查。

原文:

send codes of lines1270 to 1290 in PHP.php file to check.

incubus 2017-10-9
3

MadelineProto/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP.php

protected function testSmallPrimes()
    {
        if ($this->value == [1]) {
            return false;
        }
        if ($this->value == [2]) {
            return true;
        }
        if (~$this->value[0] & 1) {
            return false;
        }

        $value = $this->value;
        foreach (self::$primes as $prime) {
            list(, $r) = self::divide_digit($value, $prime);
            if (!$r) {
                return count($value) == 1 && $value[0] == $prime;
            }
        }

        return true;
    }

PHP 7.1.8 相同的问题。

原文:

MadelineProto/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP.php

protected function testSmallPrimes()
    {
        if ($this->value == [1]) {
            return false;
        }
        if ($this->value == [2]) {
            return true;
        }
        if (~$this->value[0] & 1) {
            return false;
        }

        $value = $this->value;
        foreach (self::$primes as $prime) {
            list(, $r) = self::divide_digit($value, $prime);
            if (!$r) {
                return count($value) == 1 && $value[0] == $prime;
            }
        }

        return true;
    }

Same problem with PHP 7.1.8.

wecanco 2017-10-9
4

安装 php 7.x 和测试。
也许 u 使用 php 5.x, 应该使用 php 7。x

原文:

install php 7.x and test.
maybe u use php 5.x, should use php 7.x

incubus 2017-10-9
5

我使用 PHP 7.2. 0beta3 和7.1.8。

原文:

I use PHP 7.2.0beta3 and 7.1.8.

wecanco 2017-10-9
6

更新您的马德琳 (作曲家更新);

原文:

update ur madeline (composer update);

mugavri 2017-10-9
7

@wecanco它的钢材不工作

原文:

@wecanco its stell dont working

incubus 2017-10-9
8

所有库都已更新。

$ composer show
danog/magicalserializer           dev-master fe4f6dc Serialize Volatile, Threaded or any other internal PHP class!
danog/primemodule                 dev-master 837ca72 Prime module capable of doing prime factorization of huge numbers very quickly."
erusev/parsedown                  1.6.3              Parser for Markdown.
fluent/logger                     v1.0.1             a logging library for Fluentd
paragonie/constant_time_encoding  v1.0.1             Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)
paragonie/random_compat           v2.0.11            PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phpdocumentor/reflection-common   1.0.1              Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock 3.3.0              With this component, a library can provide support for annotations via DocBlocks o...
phpdocumentor/type-resolver       0.4.0
phpseclib/phpseclib               dev-master 1a730d1 PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SF...
psr/log                           1.0.2              Common interface for logging libraries
rollbar/rollbar                   v1.3.2             Monitors errors and exceptions and reports them to Rollbar
vlucas/phpdotenv                  v2.4.0             Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` auto...
webmozart/assert                  1.2.0              Assertions to validate method input/output with nice error messages.
原文:

All libraries was updated.

$ composer show
danog/magicalserializer           dev-master fe4f6dc Serialize Volatile, Threaded or any other internal PHP class!
danog/primemodule                 dev-master 837ca72 Prime module capable of doing prime factorization of huge numbers very quickly."
erusev/parsedown                  1.6.3              Parser for Markdown.
fluent/logger                     v1.0.1             a logging library for Fluentd
paragonie/constant_time_encoding  v1.0.1             Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)
paragonie/random_compat           v2.0.11            PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phpdocumentor/reflection-common   1.0.1              Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock 3.3.0              With this component, a library can provide support for annotations via DocBlocks o...
phpdocumentor/type-resolver       0.4.0
phpseclib/phpseclib               dev-master 1a730d1 PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SF...
psr/log                           1.0.2              Common interface for logging libraries
rollbar/rollbar                   v1.3.2             Monitors errors and exceptions and reports them to Rollbar
vlucas/phpdotenv                  v2.4.0             Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` auto...
webmozart/assert                  1.2.0              Assertions to validate method input/output with nice error messages.
danog 2017-10-9
9

固定, 请 git 拉和作曲家更新

原文:

Fixed, please git pull and composer update

返回
发表文章
incubus
文章数
2
评论数
3
注册排名
60853