3v4l.org

run code in 300+ PHP versions simultaneously
#!/usr/bin/env php <?php /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz RumiƄski <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED); set_error_handler(static function ($severity, $message, $file, $line) { if ($severity & error_reporting()) { throw new ErrorException($message, 0, $severity, $file, $line); } }); // check environment requirements (function () { if (defined('HHVM_VERSION_ID')) { fwrite(STDERR, "HHVM is not supported.\n"); if (getenv('PHP_CS_FIXER_IGNORE_ENV')) { fwrite(STDERR, "Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.\n"); } else { exit(1); } } elseif (!defined('PHP_VERSION_ID')) { // PHP_VERSION_ID is available as of PHP 5.2.7 fwrite(STDERR, 'PHP version no supported, please update. Current PHP version: '.PHP_VERSION.".\n"); exit(1); } elseif (\PHP_VERSION_ID === 80000) { fwrite(STDERR, "PHP CS Fixer is not able run on PHP 8.0.0 due to bug in PHP tokenizer (https://bugs.php.net/bug.php?id=80462).\n"); fwrite(STDERR, "Update PHP version to unblock execution.\n"); exit(1); } elseif ( \PHP_VERSION_ID < 70400 || \PHP_VERSION_ID >= 80200 ) { fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.1.*.\n"); fwrite(STDERR, 'Current PHP version: '.PHP_VERSION.".\n"); if (getenv('PHP_CS_FIXER_IGNORE_ENV')) { fwrite(STDERR, "Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.\n"); } else { fwrite(STDERR, "To ignore this requirement please set `PHP_CS_FIXER_IGNORE_ENV`.\n"); fwrite(STDERR, "If you use PHP version higher than supported, you may experience code modified in a wrong way.\n"); fwrite(STDERR, "Please report such cases at https://github.com/FriendsOfPHP/PHP-CS-Fixer .\n"); exit(1); } } foreach (['json', 'tokenizer'] as $extension) { if (!extension_loaded($extension)) { fwrite(STDERR, sprintf("PHP extension ext-%s is missing from your system. Install or enable it.\n", $extension)); if (getenv('PHP_CS_FIXER_IGNORE_ENV')) { fwrite(STDERR, "Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.\n"); } else { exit(1); } } } })(); // load dependencies (function () { $require = true; if (class_exists('Phar')) { // Maybe this file is used as phar-stub? Let's try! try { Phar::mapPhar('php-cs-fixer.phar'); require_once 'phar://php-cs-fixer.phar/vendor/autoload.php'; $require = false; } catch (PharException $e) { } } if ($require) { // OK, it's not, let give Composer autoloader a try! $possibleFiles = [__DIR__.'/../../autoload.php', __DIR__.'/../autoload.php', __DIR__.'/vendor/autoload.php']; $file = null; foreach ($possibleFiles as $possibleFile) { if (file_exists($possibleFile)) { $file = $possibleFile; break; } } if (null === $file) { throw new RuntimeException('Unable to locate autoload.php file.'); } require_once $file; } })(); use Composer\XdebugHandler\XdebugHandler; use PhpCsFixer\Console\Application; // Restart if xdebug is loaded, unless the environment variable PHP_CS_FIXER_ALLOW_XDEBUG is set. $xdebug = new XdebugHandler('PHP_CS_FIXER'); $xdebug->check(); unset($xdebug); $application = new Application(); $application->run(); __HALT_COMPILER();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/67j6J
function name:  (null)
number of ops:  26
compiled vars:  !0 = $xdebug, !1 = $application
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 8191
          2        DO_ICALL                                                 
   16     3        INIT_FCALL                                               'set_error_handler'
          4        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
   20     5        SEND_VAL                                                 ~3
   16     6        DO_ICALL                                                 
   23     7        DECLARE_LAMBDA_FUNCTION                          ~5      [1]
   70     8        INIT_DYNAMIC_CALL                                        ~5
          9        DO_FCALL                                      0          
   73    10        DECLARE_LAMBDA_FUNCTION                          ~7      [2]
  104    11        INIT_DYNAMIC_CALL                                        ~7
         12        DO_FCALL                                      0          
  110    13        NEW                                              $9      'Composer%5CXdebugHandler%5CXdebugHandler'
         14        SEND_VAL_EX                                              'PHP_CS_FIXER'
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !0, $9
  111    17        INIT_METHOD_CALL                                         !0, 'check'
         18        DO_FCALL                                      0          
  112    19        UNSET_CV                                                 !0
  114    20        NEW                                              $13     'PhpCsFixer%5CConsole%5CApplication'
         21        DO_FCALL                                      0          
         22        ASSIGN                                                   !1, $13
  115    23        INIT_METHOD_CALL                                         !1, 'run'
         24        DO_FCALL                                      0          
  117    25      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/67j6J
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $severity, !1 = $message, !2 = $file, !3 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   17     4        INIT_FCALL                                               'error_reporting'
          5        DO_ICALL                                         $4      
          6        BW_AND                                           ~5      !0, $4
          7      > JMPZ                                                     ~5, ->16
   18     8    >   NEW                                              $6      'ErrorException'
          9        SEND_VAR_EX                                              !1
         10        SEND_VAL_EX                                              0
         11        SEND_VAR_EX                                              !0
         12        SEND_VAR_EX                                              !2
         13        SEND_VAR_EX                                              !3
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $6
   20    16    > > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 19
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 77
Branch analysis from position: 77
2 jumps found. (Code = 77) Position 1 = 78, Position 2 = 105
Branch analysis from position: 78
2 jumps found. (Code = 78) Position 1 = 79, Position 2 = 105
Branch analysis from position: 79
2 jumps found. (Code = 43) Position 1 = 84, Position 2 = 104
Branch analysis from position: 84
2 jumps found. (Code = 43) Position 1 = 97, Position 2 = 103
Branch analysis from position: 97
1 jumps found. (Code = 42) Position 1 = 104
Branch analysis from position: 104
1 jumps found. (Code = 42) Position 1 = 78
Branch analysis from position: 78
Branch analysis from position: 103
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 104
Branch analysis from position: 105
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 105
Branch analysis from position: 17
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 27
Branch analysis from position: 20
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 40
Branch analysis from position: 28
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 77
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 61
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 77
Branch analysis from position: 77
Branch analysis from position: 61
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 77
filename:       /in/67j6J
function name:  {closure}
number of ops:  107
compiled vars:  !0 = $extension
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   DEFINED                                                  'HHVM_VERSION_ID'
          1      > JMPZ                                                     ~1, ->19
   25     2    >   INIT_FCALL                                               'fwrite'
          3        FETCH_CONSTANT                                   ~2      'STDERR'
          4        SEND_VAL                                                 ~2
          5        SEND_VAL                                                 'HHVM+is+not+supported.%0A'
          6        DO_ICALL                                                 
   27     7        INIT_FCALL                                               'getenv'
          8        SEND_VAL                                                 'PHP_CS_FIXER_IGNORE_ENV'
          9        DO_ICALL                                         $4      
         10      > JMPZ                                                     $4, ->17
   28    11    >   INIT_FCALL                                               'fwrite'
         12        FETCH_CONSTANT                                   ~5      'STDERR'
         13        SEND_VAL                                                 ~5
         14        SEND_VAL                                                 'Ignoring+environment+requirements+because+%60PHP_CS_FIXER_IGNORE_ENV%60+is+set.+Execution+may+be+unstable.%0A'
         15        DO_ICALL                                                 
   27    16      > JMP                                                      ->18
   30    17    > > EXIT                                                     1
   24    18    > > JMP                                                      ->77
   32    19    > > JMPZ                                                     <false>, ->27
   33    20    >   INIT_FCALL                                               'fwrite'
         21        FETCH_CONSTANT                                   ~7      'STDERR'
         22        SEND_VAL                                                 ~7
         23        SEND_VAL                                                 'PHP+version+no+supported%2C+please+update.+Current+PHP+version%3A+8.3.0.%0A'
         24        DO_ICALL                                                 
   35    25      > EXIT                                                     1
   32    26*       JMP                                                      ->77
   36    27    > > JMPZ                                                     <false>, ->40
   37    28    >   INIT_FCALL                                               'fwrite'
         29        FETCH_CONSTANT                                   ~9      'STDERR'
         30        SEND_VAL                                                 ~9
         31        SEND_VAL                                                 'PHP+CS+Fixer+is+not+able+run+on+PHP+8.0.0+due+to+bug+in+PHP+tokenizer+%28https%3A%2F%2Fbugs.php.net%2Fbug.php%3Fid%3D80462%29.%0A'
         32        DO_ICALL                                                 
   38    33        INIT_FCALL                                               'fwrite'
         34        FETCH_CONSTANT                                   ~11     'STDERR'
         35        SEND_VAL                                                 ~11
         36        SEND_VAL                                                 'Update+PHP+version+to+unblock+execution.%0A'
         37        DO_ICALL                                                 
   40    38      > EXIT                                                     1
   36    39*       JMP                                                      ->77
   43    40    > > JMPZ                                                     <true>, ->77
   45    41    >   INIT_FCALL                                               'fwrite'
         42        FETCH_CONSTANT                                   ~13     'STDERR'
         43        SEND_VAL                                                 ~13
         44        SEND_VAL                                                 'PHP+needs+to+be+a+minimum+version+of+PHP+7.4.0+and+maximum+version+of+PHP+8.1.%2A.%0A'
         45        DO_ICALL                                                 
   46    46        INIT_FCALL                                               'fwrite'
         47        FETCH_CONSTANT                                   ~15     'STDERR'
         48        SEND_VAL                                                 ~15
         49        SEND_VAL                                                 'Current+PHP+version%3A+8.3.0.%0A'
         50        DO_ICALL                                                 
   48    51        INIT_FCALL                                               'getenv'
         52        SEND_VAL                                                 'PHP_CS_FIXER_IGNORE_ENV'
         53        DO_ICALL                                         $17     
         54      > JMPZ                                                     $17, ->61
   49    55    >   INIT_FCALL                                               'fwrite'
         56        FETCH_CONSTANT                                   ~18     'STDERR'
         57        SEND_VAL                                                 ~18
         58        SEND_VAL                                                 'Ignoring+environment+requirements+because+%60PHP_CS_FIXER_IGNORE_ENV%60+is+set.+Execution+may+be+unstable.%0A'
         59        DO_ICALL                                                 
   48    60      > JMP                                                      ->77
   51    61    >   INIT_FCALL                                               'fwrite'
         62        FETCH_CONSTANT                                   ~20     'STDERR'
         63        SEND_VAL                                                 ~20
         64        SEND_VAL                                                 'To+ignore+this+requirement+please+set+%60PHP_CS_FIXER_IGNORE_ENV%60.%0A'
         65        DO_ICALL                                                 
   52    66        INIT_FCALL                                               'fwrite'
         67        FETCH_CONSTANT                                   ~22     'STDERR'
         68        SEND_VAL                                                 ~22
         69        SEND_VAL                                                 'If+you+use+PHP+version+higher+than+supported%2C+you+may+experience+code+modified+in+a+wrong+way.%0A'
         70        DO_ICALL                                                 
   53    71        INIT_FCALL                                               'fwrite'
         72        FETCH_CONSTANT                                   ~24     'STDERR'
         73        SEND_VAL                                                 ~24
         74        SEND_VAL                                                 'Please+report+such+cases+at+https%3A%2F%2Fgithub.com%2FFriendsOfPHP%2FPHP-CS-Fixer+.%0A'
         75        DO_ICALL                                                 
   55    76      > EXIT                                                     1
   59    77    > > FE_RESET_R                                       $26     <array>, ->105
         78    > > FE_FETCH_R                                               $26, !0, ->105
   60    79    >   INIT_FCALL                                               'extension_loaded'
         80        SEND_VAR                                                 !0
         81        DO_ICALL                                         $27     
         82        BOOL_NOT                                         ~28     $27
         83      > JMPZ                                                     ~28, ->104
   61    84    >   INIT_FCALL                                               'fwrite'
         85        FETCH_CONSTANT                                   ~29     'STDERR'
         86        SEND_VAL                                                 ~29
         87        INIT_FCALL                                               'sprintf'
         88        SEND_VAL                                                 'PHP+extension+ext-%25s+is+missing+from+your+system.+Install+or+enable+it.%0A'
         89        SEND_VAR                                                 !0
         90        DO_ICALL                                         $30     
         91        SEND_VAR                                                 $30
         92        DO_ICALL                                                 
   63    93        INIT_FCALL                                               'getenv'
         94        SEND_VAL                                                 'PHP_CS_FIXER_IGNORE_ENV'
         95        DO_ICALL                                         $32     
         96      > JMPZ                                                     $32, ->103
   64    97    >   INIT_FCALL                                               'fwrite'
         98        FETCH_CONSTANT                                   ~33     'STDERR'
         99        SEND_VAL                                                 ~33
        100        SEND_VAL                                                 'Ignoring+environment+requirements+because+%60PHP_CS_FIXER_IGNORE_ENV%60+is+set.+Execution+may+be+unstable.%0A'
        101        DO_ICALL                                                 
   63   102      > JMP                                                      ->104
   66   103    > > EXIT                                                     1
   59   104    > > JMP                                                      ->78
        105    >   FE_FREE                                                  $26
   70   106      > RETURN                                                   null

End of Dynamic Function 1

Dynamic Function 2
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 32
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 24
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 24
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 31
Branch analysis from position: 27
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 24
Branch analysis from position: 24
Branch analysis from position: 32
Branch analysis from position: 12
Found catch point at position: 11
Branch analysis from position: 11
2 jumps found. (Code = 107) Position 1 = 12, Position 2 = -2
Branch analysis from position: 12
filename:       /in/67j6J
function name:  {closure}
number of ops:  33
compiled vars:  !0 = $require, !1 = $e, !2 = $possibleFiles, !3 = $file, !4 = $possibleFile
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   74     0  E >   ASSIGN                                                   !0, <true>
   75     1        INIT_FCALL                                               'class_exists'
          2        SEND_VAL                                                 'Phar'
          3        DO_ICALL                                         $6      
          4      > JMPZ                                                     $6, ->12
   78     5    >   INIT_STATIC_METHOD_CALL                                  'Phar', 'mapPhar'
          6        SEND_VAL                                                 'php-cs-fixer.phar'
          7        DO_FCALL                                      0          
   80     8        INCLUDE_OR_EVAL                                          'phar%3A%2F%2Fphp-cs-fixer.phar%2Fvendor%2Fautoload.php', REQUIRE_ONCE
   81     9        ASSIGN                                                   !0, <false>
         10      > JMP                                                      ->12
   82    11  E > > CATCH                                       last         'PharException'
   86    12    > > JMPZ                                                     !0, ->32
   88    13    >   ASSIGN                                                   !2, <array>
   89    14        ASSIGN                                                   !3, null
   90    15      > FE_RESET_R                                       $12     !2, ->24
         16    > > FE_FETCH_R                                               $12, !4, ->24
   91    17    >   INIT_FCALL                                               'file_exists'
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                         $13     
         20      > JMPZ                                                     $13, ->23
   92    21    >   ASSIGN                                                   !3, !4
   94    22      > JMP                                                      ->24
   90    23    > > JMP                                                      ->16
         24    >   FE_FREE                                                  $12
   98    25        TYPE_CHECK                                    2          !3
         26      > JMPZ                                                     ~15, ->31
   99    27    >   NEW                                              $16     'RuntimeException'
         28        SEND_VAL_EX                                              'Unable+to+locate+autoload.php+file.'
         29        DO_FCALL                                      0          
         30      > THROW                                         0          $16
  102    31    >   INCLUDE_OR_EVAL                                          !3, REQUIRE_ONCE
  104    32    > > RETURN                                                   null

End of Dynamic Function 2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.19 ms | 1039 KiB | 21 Q