3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159 ms | 1400 KiB | 23 Q