3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach (range(1,1000) as $int) { echo base64_encode($int)."\n"; $trimmed = base64_decode(trim(base64_encode($int), '=')); $untrimmed = base64_decode(base64_encode($int)); echo "{$int}: TRIMMED:" . ($trimmed == $int ? 'Pass' : 'Fail') . " ({$trimmed}) " . " UNTRIMMED: " . ($untrimmed == $int ? 'Pass' : 'Fail') . "({$untrimmed})" . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 55
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 55
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 46
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 46
Branch analysis from position: 44
Branch analysis from position: 46
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
filename:       /in/eGGXW
function name:  (null)
number of ops:  57
compiled vars:  !0 = $int, !1 = $trimmed, !2 = $untrimmed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 1000
          3        DO_ICALL                                         $3      
          4      > FE_RESET_R                                       $4      $3, ->55
          5    > > FE_FETCH_R                                               $4, !0, ->55
    3     6    >   INIT_FCALL                                               'base64_encode'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9        CONCAT                                           ~6      $5, '%0A'
         10        ECHO                                                     ~6
    4    11        INIT_FCALL                                               'base64_decode'
         12        INIT_FCALL                                               'trim'
         13        INIT_FCALL                                               'base64_encode'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $7      
         16        SEND_VAR                                                 $7
         17        SEND_VAL                                                 '%3D'
         18        DO_ICALL                                         $8      
         19        SEND_VAR                                                 $8
         20        DO_ICALL                                         $9      
         21        ASSIGN                                                   !1, $9
    5    22        INIT_FCALL                                               'base64_decode'
         23        INIT_FCALL                                               'base64_encode'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                         $11     
         26        SEND_VAR                                                 $11
         27        DO_ICALL                                         $12     
         28        ASSIGN                                                   !2, $12
    6    29        NOP                                                      
         30        FAST_CONCAT                                      ~14     !0, '%3A+TRIMMED%3A'
         31        IS_EQUAL                                                 !1, !0
         32      > JMPZ                                                     ~15, ->35
         33    >   QM_ASSIGN                                        ~16     'Pass'
         34      > JMP                                                      ->36
         35    >   QM_ASSIGN                                        ~16     'Fail'
         36    >   CONCAT                                           ~17     ~14, ~16
         37        ROPE_INIT                                     3  ~19     '+%28'
         38        ROPE_ADD                                      1  ~19     ~19, !1
         39        ROPE_END                                      2  ~18     ~19, '%29+'
         40        CONCAT                                           ~21     ~17, ~18
    7    41        CONCAT                                           ~22     ~21, '+UNTRIMMED%3A+'
         42        IS_EQUAL                                                 !2, !0
         43      > JMPZ                                                     ~23, ->46
         44    >   QM_ASSIGN                                        ~24     'Pass'
         45      > JMP                                                      ->47
         46    >   QM_ASSIGN                                        ~24     'Fail'
         47    >   CONCAT                                           ~25     ~22, ~24
         48        ROPE_INIT                                     3  ~27     '%28'
         49        ROPE_ADD                                      1  ~27     ~27, !2
         50        ROPE_END                                      2  ~26     ~27, '%29'
         51        CONCAT                                           ~29     ~25, ~26
   10    52        CONCAT                                           ~30     ~29, '%0A'
         53        ECHO                                                     ~30
    2    54      > JMP                                                      ->5
         55    >   FE_FREE                                                  $4
   12    56      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153 ms | 1400 KiB | 21 Q