box-project / box

📦🚀 Fast, zero config application bundler with PHARs.
https://box-project.github.io/box
MIT License
1.13k stars 100 forks source link

__autoload() is deprecated, use spl_autoload_register() instead #439

Closed maks-rafalko closed 4 years ago

maks-rafalko commented 5 years ago

Bug report

Question Answer
Box version 3.8.0@e7d8df3 2019-06-08 14:25:00 UTC
PHP version PHP 7.2.19-1+ubuntu16.04.1+deb.sury.org+1
Platform with version Ubuntu
Github Repo infection/infection
box.json.dist ```json { "output": "build/infection.phar", "git-version": "package_version", "compression": "GZ", "compactors": [ "KevinGH\\Box\\Compactor\\Json", "KevinGH\\Box\\Compactor\\Php", "KevinGH\\Box\\Compactor\\PhpScoper" ], "files": ["resources/schema.json"] } ```
scoper.inc.php ```php [ "Safe\\*" ], ]; ```

When the phar is compiled and executed, the following deprecation warnings are displayed:

PHP Deprecated:  __autoload() is deprecated, use spl_autoload_register() instead in phar:///infection/build/infection.phar/vendor/autoload.php on line 78

Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in phar:///infection/build/infection.phar/vendor/autoload.php on line 78
You are running Infection with PCOV enabled.
     ____      ____          __  _
    /  _/___  / __/__  _____/ /_(_)___  ____
    / // __ \/ /_/ _ \/ ___/ __/ / __ \/ __ \
  _/ // / / / __/  __/ /__/ /_/ / /_/ / / / /
 /___/_/ /_/_/  \___/\___/\__/_/\____/_/ /_/

Running initial test suite...

This issue is not reproduced without scoper.inc.php

Related to https://github.com/infection/infection/issues/795

sanmai commented 5 years ago

This is the issue: https://github.com/justinrainbow/json-schema/issues/574

The problem goes away should one replace __autoload with spl_autoload_register in bin/validate-json

sanmai commented 5 years ago

https://github.com/justinrainbow/json-schema/pull/589 should fix the problem