1
0
mirror of https://github.com/danog/PHPStruct.git synced 2024-11-30 04:19:08 +01:00

Simplify and speed up binary addition and NOT

This commit is contained in:
Daniil Gentili 2018-06-03 12:26:50 +02:00
parent a82605840a
commit 794445b60c
2 changed files with 242 additions and 197 deletions

386
composer.lock generated
View File

@ -4,38 +4,37 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "73b93d737f11821625bd5ba0f6f60bd0",
"content-hash": "9d39c313319b5e233fd3b3d80982d2f7", "content-hash": "9d39c313319b5e233fd3b3d80982d2f7",
"packages": [], "packages": [],
"packages-dev": [ "packages-dev": [
{ {
"name": "doctrine/instantiator", "name": "doctrine/instantiator",
"version": "1.0.5", "version": "1.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/instantiator.git", "url": "https://github.com/doctrine/instantiator.git",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3,<8.0-DEV" "php": "^7.1"
}, },
"require-dev": { "require-dev": {
"athletic/athletic": "~0.1.8", "athletic/athletic": "~0.1.8",
"ext-pdo": "*", "ext-pdo": "*",
"ext-phar": "*", "ext-phar": "*",
"phpunit/phpunit": "~4.0", "phpunit/phpunit": "^6.2.3",
"squizlabs/php_codesniffer": "~2.0" "squizlabs/php_codesniffer": "^3.0.2"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.0.x-dev" "dev-master": "1.2.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -60,41 +59,47 @@
"constructor", "constructor",
"instantiate" "instantiate"
], ],
"time": "2015-06-14 21:17:01" "time": "2017-07-22T11:58:36+00:00"
}, },
{ {
"name": "myclabs/deep-copy", "name": "myclabs/deep-copy",
"version": "1.5.1", "version": "1.8.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/myclabs/DeepCopy.git", "url": "https://github.com/myclabs/DeepCopy.git",
"reference": "a8773992b362b58498eed24bf85005f363c34771" "reference": "478465659fd987669df0bd8a9bf22a8710e5f1b6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a8773992b362b58498eed24bf85005f363c34771", "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/478465659fd987669df0bd8a9bf22a8710e5f1b6",
"reference": "a8773992b362b58498eed24bf85005f363c34771", "reference": "478465659fd987669df0bd8a9bf22a8710e5f1b6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.4.0" "php": "^7.1"
},
"replace": {
"myclabs/deep-copy": "self.version"
}, },
"require-dev": { "require-dev": {
"doctrine/collections": "1.*", "doctrine/collections": "^1.0",
"phpunit/phpunit": "~4.1" "doctrine/common": "^2.6",
"phpunit/phpunit": "^7.1"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"DeepCopy\\": "src/DeepCopy/" "DeepCopy\\": "src/DeepCopy/"
} },
"files": [
"src/DeepCopy/deep_copy.php"
]
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
"description": "Create deep copies (clones) of your objects", "description": "Create deep copies (clones) of your objects",
"homepage": "https://github.com/myclabs/DeepCopy",
"keywords": [ "keywords": [
"clone", "clone",
"copy", "copy",
@ -102,20 +107,20 @@
"object", "object",
"object graph" "object graph"
], ],
"time": "2015-11-20 12:04:31" "time": "2018-05-29T17:25:09+00:00"
}, },
{ {
"name": "phpdocumentor/reflection-common", "name": "phpdocumentor/reflection-common",
"version": "1.0", "version": "1.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionCommon.git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
"reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
"reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -156,33 +161,39 @@
"reflection", "reflection",
"static analysis" "static analysis"
], ],
"time": "2015-12-27 11:43:31" "time": "2017-09-11T18:02:19+00:00"
}, },
{ {
"name": "phpdocumentor/reflection-docblock", "name": "phpdocumentor/reflection-docblock",
"version": "3.1.0", "version": "4.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "9270140b940ff02e58ec577c237274e92cd40cdd" "reference": "94fd0001232e47129dd3504189fa1c7225010d08"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08",
"reference": "9270140b940ff02e58ec577c237274e92cd40cdd", "reference": "94fd0001232e47129dd3504189fa1c7225010d08",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.5", "php": "^7.0",
"phpdocumentor/reflection-common": "^1.0@dev", "phpdocumentor/reflection-common": "^1.0.0",
"phpdocumentor/type-resolver": "^0.2.0", "phpdocumentor/type-resolver": "^0.4.0",
"webmozart/assert": "^1.0" "webmozart/assert": "^1.0"
}, },
"require-dev": { "require-dev": {
"mockery/mockery": "^0.9.4", "doctrine/instantiator": "~1.0.5",
"phpunit/phpunit": "^4.4" "mockery/mockery": "^1.0",
"phpunit/phpunit": "^6.4"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.x-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"phpDocumentor\\Reflection\\": [ "phpDocumentor\\Reflection\\": [
@ -201,24 +212,24 @@
} }
], ],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2016-06-10 09:48:41" "time": "2017-11-30T07:14:17+00:00"
}, },
{ {
"name": "phpdocumentor/type-resolver", "name": "phpdocumentor/type-resolver",
"version": "0.2", "version": "0.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git", "url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7",
"reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.5", "php": "^5.5 || ^7.0",
"phpdocumentor/reflection-common": "^1.0" "phpdocumentor/reflection-common": "^1.0"
}, },
"require-dev": { "require-dev": {
@ -248,36 +259,37 @@
"email": "me@mikevanriel.com" "email": "me@mikevanriel.com"
} }
], ],
"time": "2016-06-10 07:14:17" "time": "2017-07-14T14:27:02+00:00"
}, },
{ {
"name": "phpspec/prophecy", "name": "phpspec/prophecy",
"version": "v1.6.1", "version": "1.7.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpspec/prophecy.git", "url": "https://github.com/phpspec/prophecy.git",
"reference": "58a8137754bc24b25740d4281399a4a3596058e0" "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
"reference": "58a8137754bc24b25740d4281399a4a3596058e0", "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/instantiator": "^1.0.2", "doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0", "php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
"sebastian/comparator": "^1.1", "sebastian/comparator": "^1.1|^2.0|^3.0",
"sebastian/recursion-context": "^1.0" "sebastian/recursion-context": "^1.0|^2.0|^3.0"
}, },
"require-dev": { "require-dev": {
"phpspec/phpspec": "^2.0" "phpspec/phpspec": "^2.5|^3.2",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.6.x-dev" "dev-master": "1.7.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -310,39 +322,39 @@
"spy", "spy",
"stub" "stub"
], ],
"time": "2016-06-07 08:13:47" "time": "2018-04-18T13:57:24+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "4.0.1", "version": "4.0.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "5f3f7e736d6319d5f1fc402aff8b026da26709a3" "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5f3f7e736d6319d5f1fc402aff8b026da26709a3", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
"reference": "5f3f7e736d6319d5f1fc402aff8b026da26709a3", "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-dom": "*",
"ext-xmlwriter": "*",
"php": "^5.6 || ^7.0", "php": "^5.6 || ^7.0",
"phpunit/php-file-iterator": "~1.3", "phpunit/php-file-iterator": "^1.3",
"phpunit/php-text-template": "~1.2", "phpunit/php-text-template": "^1.2",
"phpunit/php-token-stream": "^1.4.2", "phpunit/php-token-stream": "^1.4.2 || ^2.0",
"sebastian/code-unit-reverse-lookup": "~1.0", "sebastian/code-unit-reverse-lookup": "^1.0",
"sebastian/environment": "^1.3.2 || ^2.0", "sebastian/environment": "^1.3.2 || ^2.0",
"sebastian/version": "~1.0|~2.0" "sebastian/version": "^1.0 || ^2.0"
}, },
"require-dev": { "require-dev": {
"ext-xdebug": ">=2.1.4", "ext-xdebug": "^2.1.4",
"phpunit/phpunit": "^5.4" "phpunit/phpunit": "^5.7"
}, },
"suggest": { "suggest": {
"ext-dom": "*", "ext-xdebug": "^2.5.1"
"ext-xdebug": ">=2.4.0",
"ext-xmlwriter": "*"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -373,20 +385,20 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2016-07-26 14:39:29" "time": "2017-04-02T07:44:40+00:00"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
"version": "1.4.1", "version": "1.4.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -420,7 +432,7 @@
"filesystem", "filesystem",
"iterator" "iterator"
], ],
"time": "2015-06-21 13:08:43" "time": "2017-11-27T13:52:08+00:00"
}, },
{ {
"name": "phpunit/php-text-template", "name": "phpunit/php-text-template",
@ -461,29 +473,34 @@
"keywords": [ "keywords": [
"template" "template"
], ],
"time": "2015-06-21 13:50:34" "time": "2015-06-21T13:50:34+00:00"
}, },
{ {
"name": "phpunit/php-timer", "name": "phpunit/php-timer",
"version": "1.0.8", "version": "1.0.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git", "url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
"reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": "^5.3.3 || ^7.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4|~5" "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": { "autoload": {
"classmap": [ "classmap": [
"src/" "src/"
@ -505,33 +522,33 @@
"keywords": [ "keywords": [
"timer" "timer"
], ],
"time": "2016-05-12 18:03:57" "time": "2017-02-26T11:10:40+00:00"
}, },
{ {
"name": "phpunit/php-token-stream", "name": "phpunit/php-token-stream",
"version": "1.4.8", "version": "2.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git", "url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" "reference": "791198a2c6254db10131eecfe8c06670700904db"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db",
"reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "reference": "791198a2c6254db10131eecfe8c06670700904db",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-tokenizer": "*", "ext-tokenizer": "*",
"php": ">=5.3.3" "php": "^7.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.2" "phpunit/phpunit": "^6.2.4"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.4-dev" "dev-master": "2.0-dev"
} }
}, },
"autoload": { "autoload": {
@ -554,7 +571,7 @@
"keywords": [ "keywords": [
"tokenizer" "tokenizer"
], ],
"time": "2015-09-15 10:49:45" "time": "2017-11-27T05:48:46+00:00"
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
@ -632,27 +649,27 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2016-07-26 14:48:00" "time": "2016-07-26T14:48:00+00:00"
}, },
{ {
"name": "phpunit/phpunit-mock-objects", "name": "phpunit/phpunit-mock-objects",
"version": "3.2.3", "version": "3.4.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "b13d0d9426ced06958bd32104653526a6c998a52" "reference": "a23b761686d50a560cc56233b9ecf49597cc9118"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b13d0d9426ced06958bd32104653526a6c998a52", "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118",
"reference": "b13d0d9426ced06958bd32104653526a6c998a52", "reference": "a23b761686d50a560cc56233b9ecf49597cc9118",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/instantiator": "^1.0.2", "doctrine/instantiator": "^1.0.2",
"php": "^5.6 || ^7.0", "php": "^5.6 || ^7.0",
"phpunit/php-text-template": "^1.2", "phpunit/php-text-template": "^1.2",
"sebastian/exporter": "^1.2" "sebastian/exporter": "^1.2 || ^2.0"
}, },
"conflict": { "conflict": {
"phpunit/phpunit": "<5.4.0" "phpunit/phpunit": "<5.4.0"
@ -691,27 +708,27 @@
"mock", "mock",
"xunit" "xunit"
], ],
"time": "2016-06-12 07:37:26" "time": "2017-06-30T09:13:00+00:00"
}, },
{ {
"name": "sebastian/code-unit-reverse-lookup", "name": "sebastian/code-unit-reverse-lookup",
"version": "1.0.0", "version": "1.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
"reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe" "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe", "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
"reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe", "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.6" "php": "^5.6 || ^7.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~5" "phpunit/phpunit": "^5.7 || ^6.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -736,26 +753,26 @@
], ],
"description": "Looks up which function or method a line of code belongs to", "description": "Looks up which function or method a line of code belongs to",
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
"time": "2016-02-13 06:45:14" "time": "2017-03-04T06:30:41+00:00"
}, },
{ {
"name": "sebastian/comparator", "name": "sebastian/comparator",
"version": "1.2.0", "version": "1.2.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git", "url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22" "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22", "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3", "php": ">=5.3.3",
"sebastian/diff": "~1.2", "sebastian/diff": "~1.2",
"sebastian/exporter": "~1.2" "sebastian/exporter": "~1.2 || ~2.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.4" "phpunit/phpunit": "~4.4"
@ -800,27 +817,27 @@
"compare", "compare",
"equality" "equality"
], ],
"time": "2015-07-26 15:48:44" "time": "2017-01-29T09:50:25+00:00"
}, },
{ {
"name": "sebastian/diff", "name": "sebastian/diff",
"version": "1.4.1", "version": "1.4.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/diff.git", "url": "https://github.com/sebastianbergmann/diff.git",
"reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": "^5.3.3 || ^7.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.8" "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -852,32 +869,32 @@
"keywords": [ "keywords": [
"diff" "diff"
], ],
"time": "2015-12-08 07:14:41" "time": "2017-05-22T07:24:03+00:00"
}, },
{ {
"name": "sebastian/environment", "name": "sebastian/environment",
"version": "1.3.7", "version": "2.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/environment.git", "url": "https://github.com/sebastianbergmann/environment.git",
"reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
"reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": "^5.6 || ^7.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.4" "phpunit/phpunit": "^5.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.3.x-dev" "dev-master": "2.0.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -902,7 +919,7 @@
"environment", "environment",
"hhvm" "hhvm"
], ],
"time": "2016-05-17 03:18:57" "time": "2016-11-26T07:53:53+00:00"
}, },
{ {
"name": "sebastian/exporter", "name": "sebastian/exporter",
@ -969,7 +986,7 @@
"export", "export",
"exporter" "exporter"
], ],
"time": "2016-06-17 09:04:28" "time": "2016-06-17T09:04:28+00:00"
}, },
{ {
"name": "sebastian/global-state", "name": "sebastian/global-state",
@ -1020,7 +1037,7 @@
"keywords": [ "keywords": [
"global state" "global state"
], ],
"time": "2015-10-12 03:26:01" "time": "2015-10-12T03:26:01+00:00"
}, },
{ {
"name": "sebastian/object-enumerator", "name": "sebastian/object-enumerator",
@ -1066,20 +1083,20 @@
], ],
"description": "Traverses array structures and object graphs to enumerate all referenced objects", "description": "Traverses array structures and object graphs to enumerate all referenced objects",
"homepage": "https://github.com/sebastianbergmann/object-enumerator/", "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"time": "2016-01-28 13:25:10" "time": "2016-01-28T13:25:10+00:00"
}, },
{ {
"name": "sebastian/recursion-context", "name": "sebastian/recursion-context",
"version": "1.0.2", "version": "1.0.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git", "url": "https://github.com/sebastianbergmann/recursion-context.git",
"reference": "913401df809e99e4f47b27cdd781f4a258d58791" "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
"reference": "913401df809e99e4f47b27cdd781f4a258d58791", "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1119,7 +1136,7 @@
], ],
"description": "Provides functionality to recursively process PHP variables", "description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context", "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"time": "2015-11-11 19:50:13" "time": "2016-10-03T07:41:43+00:00"
}, },
{ {
"name": "sebastian/resource-operations", "name": "sebastian/resource-operations",
@ -1161,20 +1178,20 @@
], ],
"description": "Provides a list of PHP built-in functions that operate on resources", "description": "Provides a list of PHP built-in functions that operate on resources",
"homepage": "https://www.github.com/sebastianbergmann/resource-operations", "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
"time": "2015-07-28 20:34:47" "time": "2015-07-28T20:34:47+00:00"
}, },
{ {
"name": "sebastian/version", "name": "sebastian/version",
"version": "2.0.0", "version": "2.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/version.git", "url": "https://github.com/sebastianbergmann/version.git",
"reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5" "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019",
"reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1204,29 +1221,94 @@
], ],
"description": "Library that helps with managing the version number of Git-hosted PHP projects", "description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version", "homepage": "https://github.com/sebastianbergmann/version",
"time": "2016-02-04 12:56:52" "time": "2016-10-03T07:35:21+00:00"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/polyfill-ctype",
"version": "v3.1.3", "version": "v1.8.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "1819adf2066880c7967df7180f4f662b6f0567ac" "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/1819adf2066880c7967df7180f4f662b6f0567ac", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae",
"reference": "1819adf2066880c7967df7180f4f662b6f0567ac", "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.5.9" "php": ">=5.3.3"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "3.1-dev" "dev-master": "1.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
},
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"time": "2018-04-30T19:57:29+00:00"
},
{
"name": "symfony/yaml",
"version": "v3.4.11",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/c5010cc1692ce1fa328b1fb666961eb3d4a85bb0",
"reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0",
"shasum": ""
},
"require": {
"php": "^5.5.9|>=7.0.8",
"symfony/polyfill-ctype": "~1.8"
},
"conflict": {
"symfony/console": "<3.4"
},
"require-dev": {
"symfony/console": "~3.4|~4.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
} }
}, },
"autoload": { "autoload": {
@ -1253,24 +1335,24 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2016-07-17 14:02:08" "time": "2018-05-03T23:18:14+00:00"
}, },
{ {
"name": "webmozart/assert", "name": "webmozart/assert",
"version": "1.1.0", "version": "1.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/webmozart/assert.git", "url": "https://github.com/webmozart/assert.git",
"reference": "bb2d123231c095735130cc8f6d31385a44c7b308" "reference": "0df1908962e7a3071564e857d86874dad1ef204a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308", "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a",
"reference": "bb2d123231c095735130cc8f6d31385a44c7b308", "reference": "0df1908962e7a3071564e857d86874dad1ef204a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^5.3.3|^7.0" "php": "^5.3.3 || ^7.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^4.6", "phpunit/phpunit": "^4.6",
@ -1279,7 +1361,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.2-dev" "dev-master": "1.3-dev"
} }
}, },
"autoload": { "autoload": {
@ -1303,7 +1385,7 @@
"check", "check",
"validate" "validate"
], ],
"time": "2016-08-09 15:02:57" "time": "2018-01-29T19:49:41+00:00"
} }
], ],
"aliases": [], "aliases": [],

View File

@ -726,7 +726,7 @@ class StructTools
foreach (str_split(strrev($binary)) as $n => $bit) { foreach (str_split(strrev($binary)) as $n => $bit) {
if ($bit == 1) { if ($bit == 1) {
$decimal += (pow(2, $n) * $bit); $decimal += pow(2, $n);
} }
} }
@ -777,17 +777,11 @@ class StructTools
$result = ''; $result = '';
$carry = 0; $carry = 0;
foreach (array_reverse($this->range(0, $maxlen)) as $i) { for ($i = $maxlen-1; $i >= 0; $i--) {
$r = $carry; $r = (int) ($carry + $x[$i] + $y[$i]);
$r += ($x[$i] == '1') ? 1 : 0;
$r += ($y[$i] == '1') ? 1 : 0;
// r can be 0,1,2,3 (carry + x[i] + y[i]) $result = ($r & 1).$result;
// and among these, for r==1 and r==3 you will have result bit = 1 $carry = $r >> 1;
// for r==2 and r==3 you will have carry = 1
$result = (($r % 2 == 1) ? '1' : '0').$result;
$carry = ($r < 2) ? 0 : 1;
} }
if ($carry != 0) { if ($carry != 0) {
$result = '1'.$result; $result = '1'.$result;
@ -865,7 +859,9 @@ class StructTools
$s .= chr($this->bindec($byte)); $s .= chr($this->bindec($byte));
} }
$break = true; $break = true;
foreach ($this->range(strlen($s)) as $i) {
$l = strlen($s);
for ($i = 0; $i < $l; $i++) {
if ($s[$i] != pack('@')[0]) { if ($s[$i] != pack('@')[0]) {
$break = false; $break = false;
break; break;
@ -963,39 +959,6 @@ class StructTools
return $count; return $count;
} }
/**
* range.
*
* Generate range
*
* @param $start Beginning of the range (or stop if no other params are specified)
* @param $stop End of the range
* @param $step Step to use in range
*
* @return array with the range
**/
public function range($start, $stop = null, $step = 1)
{
if ($stop === null) {
$stop = $start;
$start = 0;
}
if ($stop <= $start && $step < 0) {
$arr = range($stop, $start, -$step);
array_pop($arr);
return array_reverse($arr, false);
}
if ($step > 1 && $step > ($stop - $start)) {
$arr = [$start];
} else {
$arr = range($start, $stop, $step);
array_pop($arr);
}
return $arr;
}
/** /**
* count. * count.
* *