3v4l.org

run code in 300+ PHP versions simultaneously
<?php $charmap = [ 'NUL' => "\x00", // NULL (U+0000) 'SOH' => "\x01", // START OF HEADING (U+0001) 'STX' => "\x02", // START OF TEXT (U+0002) 'ETX' => "\x03", // END OF TEXT (U+0003) 'EOT' => "\x04", // END OF TRANSMISSION (U+0004) 'ENQ' => "\x05", // ENQUIRY (U+0005) 'HT' => "\x09", // HORIZONTAL TAB (U+0009) 'LF' => "\x0a", // LINE FEED (U+000A) 'VT' => "\x0b", // VERTICAL TAB (U+000B) 'CR' => "\x0d", // CARRIAGE RETURN (U+000D) 'ETB' => "\x17", // END OF TRANSMISSION BLOCK (U+0017) 'SP' => "\x20", // SPACE (U+0020) 'ZWS' => "\xe2\x80\x8b", // ZERO WIDTH SPACE (U+200B) 'MSBS' => "\xf0\x9d\x85\xb7", // MUSICAL SYMBOL BEGIN SLUR (U+1D177) 'MSBP' => "\xf0\x9d\x85\xb9", // MUSICAL SYMBOL BEGIN PHRASE (U+1D179) ]; foreach ($charmap as $k => $v) { define($k, $v); } $strings = [ 'user6003859' => LF . LF . LF . 'a' . SP . 'b'. SP . SP . 'c' . SP . SP . SP . LF . SP . 'd' . SP . SP . SP . SP . 'e' . LF . MSBS . 'f' . MSBS . 'g' . MSBS . MSBS . 'h' . MSBS . MSBS . ZWS . ZWS . MSBP . MSBP . 'i' . MSBP . SP . MSBP . SP . 'j' . LF . LF . LF . LF . LF . 'k' . SP . 'l' . SP . 'm' . SP . 'n' . SP . SP . SP . LF . MSBP . 'o' . MSBP . MSBP . 'p' . LF . LF . LF . LF, 'mickmackusa' => NUL . LF . LF . SOH . LF . CR . LF . VT . ETB . 'a' . SP . 'ab' . CR . LF . HT . HT . CR . CR . LF . 'cà' . SOH . 'ê߀' . NUL . NUL . 'abcbc'. SP . SP . SP . 'd' . LF . LF . HT . CR . LF . ENQ . SP . SP . SP . 'e' . STX . LF . ETX . LF . EOT . LF ]; function display($str, $charmap) { $converter = array_map(function ($i) { return '{'.$i.'}'; }, array_flip($charmap)); $handle = fopen("data:text/plain,$str", 'r'); while ( false !== $line = fgets($handle) ) { echo strtr($line, $converter), PHP_EOL; } fclose($handle); } class Replacements { const FUNC = 0; const REGEX = 1; protected $patterns; protected $replacements; protected $func; protected $typeRegex; public function __construct($arg) { if ( is_array($arg) ) { $this->type = self::REGEX; $this->patterns = []; $this->replacements = []; $this->addPatterns($arg); } elseif ( is_callable($arg) ) { $this->type = self::FUNC; $this->addFunction($arg); } else throw new Exception('invalid argument type'); } protected function addPatterns($replacements) { foreach($replacements as $pattern => $replacement) { $this->patterns[] = $pattern; $this->replacements[] = $replacement; } } protected function addFunction($func) { $this->func = $func; } public function execute($str) { if ( $this->type === self::REGEX ) return preg_replace($this->patterns, $this->replacements, $str); return call_user_func_array($this->func, [&$str]); } }; $original = new Replacements([ '~\R~u' => "\n", '/(?:^((\pZ)+|((?!\n)\pC)+)(?1)*)|((?1)$)|(?:((?2)+|(?3)+)(?=(?2)|(?3)))/um' => '', '/(\pZ+)|((?!\n)\pC)/u' => ' ', '/(^\n+)|(\n+$)|(\n(?=\n{2}))/u' => '' ]); $simple = new Replacements([ '~\A[\pZ\pC]+|[\pZ\pC]+\z~u' => '', # trim the string '~\R~u' => "\n", # normalize newlines '~\pZ+|[^\n\PC]+~u' => ' ', # replace Z and C with space '~^ +| +$| \K +~m' => '', # trim lines, delete consecutive spaces '~\n\n\K\n+~' => '' # removes more than 2 consecutives newlines ]); $optimized = new Replacements([ '~\r\n?|\x0b|\f|\xe2\x80[\xa8\xa9]~S' => "\n", '~ [^\pZ\pC]+ \K \pZ* (?:[^\PC\n]+\pZ*)* (?: (\n) \pZ*+ (?:[^\PC\n]+\pZ*)*+ (?: (\n) [\pZ\pC]* )?+ (?!\z) | [\pZ\pC]+ )? | [\pZ\pC]+ ~Aux' => '$1$2 ', '~ (?:$|(?<=^ ))~m' => '' ]); // tests $tests = ['original' => $original, 'simple' => $simple, 'optimized' => $optimized]; $str = $strings['user6003859'] . $strings['mickmackusa']; $str = str_repeat($str, 10); $res = []; foreach ($tests as $k=>&$test) { $res[$k] = $test->execute($str); } echo 'same result: ', var_dump(count(array_unique($res)) === 1); $names = array_keys($tests); $times = array_fill_keys($names, 0); define('REPETITIONS', 100); for ($i=0; $i < REPETITIONS; $i++) { shuffle($names); foreach ($names as $name) { $start = microtime(true); $tests[$name]->execute($str); $stop = microtime(true); $times[$name] += $stop - $start; } } foreach($times as $k=>$v) { printf("%-12s: %.2es\n", $k, $v/REPETITIONS); } // display($res['optimized'], $charmap);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
2 jumps found. (Code = 125) Position 1 = 235, Position 2 = 243
Branch analysis from position: 235
2 jumps found. (Code = 126) Position 1 = 236, Position 2 = 243
Branch analysis from position: 236
1 jumps found. (Code = 42) Position 1 = 235
Branch analysis from position: 235
Branch analysis from position: 243
1 jumps found. (Code = 42) Position 1 = 292
Branch analysis from position: 292
2 jumps found. (Code = 44) Position 1 = 295, Position 2 = 269
Branch analysis from position: 295
2 jumps found. (Code = 77) Position 1 = 296, Position 2 = 306
Branch analysis from position: 296
2 jumps found. (Code = 78) Position 1 = 297, Position 2 = 306
Branch analysis from position: 297
1 jumps found. (Code = 42) Position 1 = 296
Branch analysis from position: 296
Branch analysis from position: 306
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 306
Branch analysis from position: 269
2 jumps found. (Code = 77) Position 1 = 273, Position 2 = 290
Branch analysis from position: 273
2 jumps found. (Code = 78) Position 1 = 274, Position 2 = 290
Branch analysis from position: 274
1 jumps found. (Code = 42) Position 1 = 273
Branch analysis from position: 273
Branch analysis from position: 290
2 jumps found. (Code = 44) Position 1 = 295, Position 2 = 269
Branch analysis from position: 295
Branch analysis from position: 269
Branch analysis from position: 290
Branch analysis from position: 243
Branch analysis from position: 9
filename:       /in/B0smh
function name:  (null)
number of ops:  308
compiled vars:  !0 = $charmap, !1 = $v, !2 = $k, !3 = $strings, !4 = $original, !5 = $simple, !6 = $optimized, !7 = $tests, !8 = $str, !9 = $res, !10 = $test, !11 = $names, !12 = $times, !13 = $i, !14 = $name, !15 = $start, !16 = $stop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   21     1      > FE_RESET_R                                       $18     !0, ->9
          2    > > FE_FETCH_R                                       ~19     $18, !1, ->9
          3    >   ASSIGN                                                   !2, ~19
   22     4        INIT_FCALL                                               'define'
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
   21     8      > JMP                                                      ->2
          9    >   FE_FREE                                                  $18
   27    10        FETCH_CONSTANT                                   ~22     'LF'
   28    11        FETCH_CONSTANT                                   ~23     'LF'
         12        CONCAT                                           ~24     ~22, ~23
   29    13        FETCH_CONSTANT                                   ~25     'LF'
         14        CONCAT                                           ~26     ~24, ~25
   30    15        CONCAT                                           ~27     ~26, 'a'
         16        FETCH_CONSTANT                                   ~28     'SP'
         17        CONCAT                                           ~29     ~27, ~28
         18        CONCAT                                           ~30     ~29, 'b'
         19        FETCH_CONSTANT                                   ~31     'SP'
         20        CONCAT                                           ~32     ~30, ~31
         21        FETCH_CONSTANT                                   ~33     'SP'
         22        CONCAT                                           ~34     ~32, ~33
         23        CONCAT                                           ~35     ~34, 'c'
         24        FETCH_CONSTANT                                   ~36     'SP'
         25        CONCAT                                           ~37     ~35, ~36
         26        FETCH_CONSTANT                                   ~38     'SP'
         27        CONCAT                                           ~39     ~37, ~38
         28        FETCH_CONSTANT                                   ~40     'SP'
         29        CONCAT                                           ~41     ~39, ~40
         30        FETCH_CONSTANT                                   ~42     'LF'
         31        CONCAT                                           ~43     ~41, ~42
   31    32        FETCH_CONSTANT                                   ~44     'SP'
         33        CONCAT                                           ~45     ~43, ~44
         34        CONCAT                                           ~46     ~45, 'd'
         35        FETCH_CONSTANT                                   ~47     'SP'
         36        CONCAT                                           ~48     ~46, ~47
         37        FETCH_CONSTANT                                   ~49     'SP'
         38        CONCAT                                           ~50     ~48, ~49
         39        FETCH_CONSTANT                                   ~51     'SP'
         40        CONCAT                                           ~52     ~50, ~51
         41        FETCH_CONSTANT                                   ~53     'SP'
         42        CONCAT                                           ~54     ~52, ~53
         43        CONCAT                                           ~55     ~54, 'e'
         44        FETCH_CONSTANT                                   ~56     'LF'
         45        CONCAT                                           ~57     ~55, ~56
   32    46        FETCH_CONSTANT                                   ~58     'MSBS'
         47        CONCAT                                           ~59     ~57, ~58
         48        CONCAT                                           ~60     ~59, 'f'
         49        FETCH_CONSTANT                                   ~61     'MSBS'
         50        CONCAT                                           ~62     ~60, ~61
         51        CONCAT                                           ~63     ~62, 'g'
         52        FETCH_CONSTANT                                   ~64     'MSBS'
         53        CONCAT                                           ~65     ~63, ~64
         54        FETCH_CONSTANT                                   ~66     'MSBS'
         55        CONCAT                                           ~67     ~65, ~66
         56        CONCAT                                           ~68     ~67, 'h'
         57        FETCH_CONSTANT                                   ~69     'MSBS'
         58        CONCAT                                           ~70     ~68, ~69
         59        FETCH_CONSTANT                                   ~71     'MSBS'
         60        CONCAT                                           ~72     ~70, ~71
         61        FETCH_CONSTANT                                   ~73     'ZWS'
         62        CONCAT                                           ~74     ~72, ~73
         63        FETCH_CONSTANT                                   ~75     'ZWS'
         64        CONCAT                                           ~76     ~74, ~75
         65        FETCH_CONSTANT                                   ~77     'MSBP'
         66        CONCAT                                           ~78     ~76, ~77
         67        FETCH_CONSTANT                                   ~79     'MSBP'
         68        CONCAT                                           ~80     ~78, ~79
         69        CONCAT                                           ~81     ~80, 'i'
         70        FETCH_CONSTANT                                   ~82     'MSBP'
         71        CONCAT                                           ~83     ~81, ~82
         72        FETCH_CONSTANT                                   ~84     'SP'
         73        CONCAT                                           ~85     ~83, ~84
         74        FETCH_CONSTANT                                   ~86     'MSBP'
         75        CONCAT                                           ~87     ~85, ~86
         76        FETCH_CONSTANT                                   ~88     'SP'
         77        CONCAT                                           ~89     ~87, ~88
         78        CONCAT                                           ~90     ~89, 'j'
         79        FETCH_CONSTANT                                   ~91     'LF'
         80        CONCAT                                           ~92     ~90, ~91
   33    81        FETCH_CONSTANT                                   ~93     'LF'
         82        CONCAT                                           ~94     ~92, ~93
   34    83        FETCH_CONSTANT                                   ~95     'LF'
         84        CONCAT                                           ~96     ~94, ~95
   35    85        FETCH_CONSTANT                                   ~97     'LF'
         86        CONCAT                                           ~98     ~96, ~97
   36    87        FETCH_CONSTANT                                   ~99     'LF'
         88        CONCAT                                           ~100    ~98, ~99
   37    89        CONCAT                                           ~101    ~100, 'k'
         90        FETCH_CONSTANT                                   ~102    'SP'
         91        CONCAT                                           ~103    ~101, ~102
         92        CONCAT                                           ~104    ~103, 'l'
         93        FETCH_CONSTANT                                   ~105    'SP'
         94        CONCAT                                           ~106    ~104, ~105
         95        CONCAT                                           ~107    ~106, 'm'
         96        FETCH_CONSTANT                                   ~108    'SP'
         97        CONCAT                                           ~109    ~107, ~108
         98        CONCAT                                           ~110    ~109, 'n'
         99        FETCH_CONSTANT                                   ~111    'SP'
        100        CONCAT                                           ~112    ~110, ~111
        101        FETCH_CONSTANT                                   ~113    'SP'
        102        CONCAT                                           ~114    ~112, ~113
        103        FETCH_CONSTANT                                   ~115    'SP'
        104        CONCAT                                           ~116    ~114, ~115
        105        FETCH_CONSTANT                                   ~117    'LF'
        106        CONCAT                                           ~118    ~116, ~117
   38   107        FETCH_CONSTANT                                   ~119    'MSBP'
        108        CONCAT                                           ~120    ~118, ~119
        109        CONCAT                                           ~121    ~120, 'o'
        110        FETCH_CONSTANT                                   ~122    'MSBP'
        111        CONCAT                                           ~123    ~121, ~122
        112        FETCH_CONSTANT                                   ~124    'MSBP'
        113        CONCAT                                           ~125    ~123, ~124
        114        CONCAT                                           ~126    ~125, 'p'
        115        FETCH_CONSTANT                                   ~127    'LF'
        116        CONCAT                                           ~128    ~126, ~127
   39   117        FETCH_CONSTANT                                   ~129    'LF'
        118        CONCAT                                           ~130    ~128, ~129
   40   119        FETCH_CONSTANT                                   ~131    'LF'
        120        CONCAT                                           ~132    ~130, ~131
   41   121        FETCH_CONSTANT                                   ~133    'LF'
        122        CONCAT                                           ~134    ~132, ~133
        123        INIT_ARRAY                                       ~135    ~134, 'user6003859'
   44   124        FETCH_CONSTANT                                   ~136    'NUL'
        125        FETCH_CONSTANT                                   ~137    'LF'
        126        CONCAT                                           ~138    ~136, ~137
   45   127        FETCH_CONSTANT                                   ~139    'LF'
        128        CONCAT                                           ~140    ~138, ~139
   46   129        FETCH_CONSTANT                                   ~141    'SOH'
        130        CONCAT                                           ~142    ~140, ~141
        131        FETCH_CONSTANT                                   ~143    'LF'
        132        CONCAT                                           ~144    ~142, ~143
   47   133        FETCH_CONSTANT                                   ~145    'CR'
        134        CONCAT                                           ~146    ~144, ~145
        135        FETCH_CONSTANT                                   ~147    'LF'
        136        CONCAT                                           ~148    ~146, ~147
   48   137        FETCH_CONSTANT                                   ~149    'VT'
        138        CONCAT                                           ~150    ~148, ~149
   49   139        FETCH_CONSTANT                                   ~151    'ETB'
        140        CONCAT                                           ~152    ~150, ~151
        141        CONCAT                                           ~153    ~152, 'a'
        142        FETCH_CONSTANT                                   ~154    'SP'
        143        CONCAT                                           ~155    ~153, ~154
        144        CONCAT                                           ~156    ~155, 'ab'
        145        FETCH_CONSTANT                                   ~157    'CR'
        146        CONCAT                                           ~158    ~156, ~157
        147        FETCH_CONSTANT                                   ~159    'LF'
        148        CONCAT                                           ~160    ~158, ~159
   50   149        FETCH_CONSTANT                                   ~161    'HT'
        150        CONCAT                                           ~162    ~160, ~161
        151        FETCH_CONSTANT                                   ~163    'HT'
        152        CONCAT                                           ~164    ~162, ~163
        153        FETCH_CONSTANT                                   ~165    'CR'
        154        CONCAT                                           ~166    ~164, ~165
   51   155        FETCH_CONSTANT                                   ~167    'CR'
        156        CONCAT                                           ~168    ~166, ~167
        157        FETCH_CONSTANT                                   ~169    'LF'
        158        CONCAT                                           ~170    ~168, ~169
   52   159        CONCAT                                           ~171    ~170, 'c%C3%A0'
        160        FETCH_CONSTANT                                   ~172    'SOH'
        161        CONCAT                                           ~173    ~171, ~172
        162        CONCAT                                           ~174    ~173, '%C3%AA%C3%9F%E2%82%AC'
        163        FETCH_CONSTANT                                   ~175    'NUL'
        164        CONCAT                                           ~176    ~174, ~175
        165        FETCH_CONSTANT                                   ~177    'NUL'
        166        CONCAT                                           ~178    ~176, ~177
        167        CONCAT                                           ~179    ~178, 'abcbc'
        168        FETCH_CONSTANT                                   ~180    'SP'
        169        CONCAT                                           ~181    ~179, ~180
        170        FETCH_CONSTANT                                   ~182    'SP'
        171        CONCAT                                           ~183    ~181, ~182
        172        FETCH_CONSTANT                                   ~184    'SP'
        173        CONCAT                                           ~185    ~183, ~184
        174        CONCAT                                           ~186    ~185, 'd'
        175        FETCH_CONSTANT                                   ~187    'LF'
        176        CONCAT                                           ~188    ~186, ~187
   53   177        FETCH_CONSTANT                                   ~189    'LF'
        178        CONCAT                                           ~190    ~188, ~189
   54   179        FETCH_CONSTANT                                   ~191    'HT'
        180        CONCAT                                           ~192    ~190, ~191
        181        FETCH_CONSTANT                                   ~193    'CR'
        182        CONCAT                                           ~194    ~192, ~193
        183        FETCH_CONSTANT                                   ~195    'LF'
        184        CONCAT                                           ~196    ~194, ~195
   55   185        FETCH_CONSTANT                                   ~197    'ENQ'
        186        CONCAT                                           ~198    ~196, ~197
        187        FETCH_CONSTANT                                   ~199    'SP'
        188        CONCAT                                           ~200    ~198, ~199
        189        FETCH_CONSTANT                                   ~201    'SP'
        190        CONCAT                                           ~202    ~200, ~201
        191        FETCH_CONSTANT                                   ~203    'SP'
        192        CONCAT                                           ~204    ~202, ~203
        193        CONCAT                                           ~205    ~204, 'e'
        194        FETCH_CONSTANT                                   ~206    'STX'
        195        CONCAT                                           ~207    ~205, ~206
        196        FETCH_CONSTANT                                   ~208    'LF'
        197        CONCAT                                           ~209    ~207, ~208
   56   198        FETCH_CONSTANT                                   ~210    'ETX'
        199        CONCAT                                           ~211    ~209, ~210
        200        FETCH_CONSTANT                                   ~212    'LF'
        201        CONCAT                                           ~213    ~211, ~212
   57   202        FETCH_CONSTANT                                   ~214    'EOT'
        203        CONCAT                                           ~215    ~213, ~214
        204        FETCH_CONSTANT                                   ~216    'LF'
        205        CONCAT                                           ~217    ~215, ~216
        206        ADD_ARRAY_ELEMENT                                ~135    ~217, 'mickmackusa'
   25   207        ASSIGN                                                   !3, ~135
  111   208        NEW                                              $219    'Replacements'
  112   209        SEND_VAL_EX                                              <array>
  111   210        DO_FCALL                                      0          
        211        ASSIGN                                                   !4, $219
  118   212        NEW                                              $222    'Replacements'
  119   213        SEND_VAL_EX                                              <array>
  118   214        DO_FCALL                                      0          
        215        ASSIGN                                                   !5, $222
  126   216        NEW                                              $225    'Replacements'
  127   217        SEND_VAL_EX                                              <array>
  126   218        DO_FCALL                                      0          
        219        ASSIGN                                                   !6, $225
  140   220        INIT_ARRAY                                       ~228    !4, 'original'
        221        ADD_ARRAY_ELEMENT                                ~228    !5, 'simple'
        222        ADD_ARRAY_ELEMENT                                ~228    !6, 'optimized'
        223        ASSIGN                                                   !7, ~228
  142   224        FETCH_DIM_R                                      ~230    !3, 'user6003859'
        225        FETCH_DIM_R                                      ~231    !3, 'mickmackusa'
        226        CONCAT                                           ~232    ~230, ~231
        227        ASSIGN                                                   !8, ~232
  143   228        INIT_FCALL                                               'str_repeat'
        229        SEND_VAR                                                 !8
        230        SEND_VAL                                                 10
        231        DO_ICALL                                         $234    
        232        ASSIGN                                                   !8, $234
  145   233        ASSIGN                                                   !9, <array>
  146   234      > FE_RESET_RW                                      $237    !7, ->243
        235    > > FE_FETCH_RW                                      ~238    $237, !10, ->243
        236    >   ASSIGN                                                   !2, ~238
  147   237        INIT_METHOD_CALL                                         !10, 'execute'
        238        SEND_VAR_EX                                              !8
        239        DO_FCALL                                      0  $241    
        240        ASSIGN_DIM                                               !9, !2
        241        OP_DATA                                                  $241
  146   242      > JMP                                                      ->235
        243    >   FE_FREE                                                  $237
  150   244        ECHO                                                     'same+result%3A+'
        245        INIT_FCALL                                               'var_dump'
        246        INIT_FCALL                                               'array_unique'
        247        SEND_VAR                                                 !9
        248        DO_ICALL                                         $242    
        249        COUNT                                            ~243    $242
        250        IS_IDENTICAL                                     ~244    ~243, 1
        251        SEND_VAL                                                 ~244
        252        DO_ICALL                                         $245    
        253        ECHO                                                     $245
  152   254        INIT_FCALL                                               'array_keys'
        255        SEND_VAR                                                 !7
        256        DO_ICALL                                         $246    
        257        ASSIGN                                                   !11, $246
  153   258        INIT_FCALL                                               'array_fill_keys'
        259        SEND_VAR                                                 !11
        260        SEND_VAL                                                 0
        261        DO_ICALL                                         $248    
        262        ASSIGN                                                   !12, $248
  154   263        INIT_FCALL                                               'define'
        264        SEND_VAL                                                 'REPETITIONS'
        265        SEND_VAL                                                 100
        266        DO_ICALL                                                 
  155   267        ASSIGN                                                   !13, 0
        268      > JMP                                                      ->292
  156   269    >   INIT_FCALL                                               'shuffle'
        270        SEND_REF                                                 !11
        271        DO_ICALL                                                 
  157   272      > FE_RESET_R                                       $253    !11, ->290
        273    > > FE_FETCH_R                                               $253, !14, ->290
  158   274    >   INIT_FCALL                                               'microtime'
        275        SEND_VAL                                                 <true>
        276        DO_ICALL                                         $254    
        277        ASSIGN                                                   !15, $254
  159   278        FETCH_DIM_R                                      ~256    !7, !14
        279        INIT_METHOD_CALL                                         ~256, 'execute'
        280        SEND_VAR_EX                                              !8
        281        DO_FCALL                                      0          
  160   282        INIT_FCALL                                               'microtime'
        283        SEND_VAL                                                 <true>
        284        DO_ICALL                                         $258    
        285        ASSIGN                                                   !16, $258
  161   286        SUB                                              ~261    !16, !15
        287        ASSIGN_DIM_OP                +=               1          !12, !14
        288        OP_DATA                                                  ~261
  157   289      > JMP                                                      ->273
        290    >   FE_FREE                                                  $253
  155   291        PRE_INC                                                  !13
        292    >   FETCH_CONSTANT                                   ~263    'REPETITIONS'
        293        IS_SMALLER                                               !13, ~263
        294      > JMPNZ                                                    ~264, ->269
  165   295    > > FE_RESET_R                                       $265    !12, ->306
        296    > > FE_FETCH_R                                       ~266    $265, !1, ->306
        297    >   ASSIGN                                                   !2, ~266
  166   298        INIT_FCALL                                               'printf'
        299        SEND_VAL                                                 '%25-12s%3A+%25.2es%0A'
        300        SEND_VAR                                                 !2
        301        FETCH_CONSTANT                                   ~268    'REPETITIONS'
        302        DIV                                              ~269    !1, ~268
        303        SEND_VAL                                                 ~269
        304        DO_ICALL                                                 
  165   305      > JMP                                                      ->296
        306    >   FE_FREE                                                  $265
  169   307      > RETURN                                                   1

Function display:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 19
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 19
Branch analysis from position: 31
Branch analysis from position: 19
filename:       /in/B0smh
function name:  display
number of ops:  35
compiled vars:  !0 = $str, !1 = $charmap, !2 = $converter, !3 = $handle, !4 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   61     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   62     2        INIT_FCALL                                               'array_map'
          3        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
          4        SEND_VAL                                                 ~5
          5        INIT_FCALL                                               'array_flip'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $6      
          8        SEND_VAR                                                 $6
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !2, $7
   63    11        INIT_FCALL                                               'fopen'
         12        NOP                                                      
         13        FAST_CONCAT                                      ~9      'data%3Atext%2Fplain%2C', !0
         14        SEND_VAL                                                 ~9
         15        SEND_VAL                                                 'r'
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !3, $10
   64    18      > JMP                                                      ->25
   65    19    >   INIT_FCALL                                               'strtr'
         20        SEND_VAR                                                 !4
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $12     
         23        ECHO                                                     $12
         24        ECHO                                                     '%0A'
   64    25    >   INIT_FCALL                                               'fgets'
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                         $13     
         28        ASSIGN                                           ~14     !4, $13
         29        TYPE_CHECK                                  1018          ~14
         30      > JMPNZ                                                    ~15, ->19
   67    31    >   INIT_FCALL                                               'fclose'
         32        SEND_VAR                                                 !3
         33        DO_ICALL                                                 
   68    34      > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B0smh
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   62     0  E >   RECV                                             !0      
          1        CONCAT                                           ~1      '%7B', !0
          2        CONCAT                                           ~2      ~1, '%7D'
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of Dynamic Function 0

End of function display

Class Replacements:
Function __construct:
Finding entry points
Branch analysis from position:

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
133.04 ms | 1048 KiB | 28 Q