3v4l.org

run code in 300+ PHP versions simultaneously
<?php $len = 9; echo implode('', array_keys(array_fill(1, $len, ''))) . '|' . PHP_EOL; // ASCI string echo str_pad('Foo', $len) . '|' . PHP_EOL; // str_pad with utf-8 string echo str_pad('Déja vu', $len) . '|' . PHP_EOL; // str_padding a decoded string then re-encode the string echo utf8_encode(str_pad(utf8_decode('Déja vu'), $len)) . '|' . PHP_EOL; // using str_repeat and Helper::strlen echo 'Déja vu'.str_repeat(' ', $len - mb_strwidth('Déja vu', mb_detect_encoding('Déja vu'))) . '|';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Zc16L
function name:  (null)
number of ops:  59
compiled vars:  !0 = $len
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 9
    3     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 ''
          3        INIT_FCALL                                               'array_keys'
          4        INIT_FCALL                                               'array_fill'
          5        SEND_VAL                                                 1
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 ''
          8        DO_ICALL                                         $2      
          9        SEND_VAR                                                 $2
         10        DO_ICALL                                         $3      
         11        SEND_VAR                                                 $3
         12        DO_ICALL                                         $4      
         13        CONCAT                                           ~5      $4, '%7C'
         14        CONCAT                                           ~6      ~5, '%0A'
         15        ECHO                                                     ~6
    6    16        INIT_FCALL                                               'str_pad'
         17        SEND_VAL                                                 'Foo'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $7      
         20        CONCAT                                           ~8      $7, '%7C'
         21        CONCAT                                           ~9      ~8, '%0A'
         22        ECHO                                                     ~9
    9    23        INIT_FCALL                                               'str_pad'
         24        SEND_VAL                                                 'D%C3%A9ja+vu'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $10     
         27        CONCAT                                           ~11     $10, '%7C'
         28        CONCAT                                           ~12     ~11, '%0A'
         29        ECHO                                                     ~12
   12    30        INIT_FCALL                                               'utf8_encode'
         31        INIT_FCALL                                               'str_pad'
         32        INIT_FCALL                                               'utf8_decode'
         33        SEND_VAL                                                 'D%C3%A9ja+vu'
         34        DO_ICALL                                         $13     
         35        SEND_VAR                                                 $13
         36        SEND_VAR                                                 !0
         37        DO_ICALL                                         $14     
         38        SEND_VAR                                                 $14
         39        DO_ICALL                                         $15     
         40        CONCAT                                           ~16     $15, '%7C'
         41        CONCAT                                           ~17     ~16, '%0A'
         42        ECHO                                                     ~17
   15    43        INIT_FCALL                                               'str_repeat'
         44        SEND_VAL                                                 '+'
         45        INIT_FCALL                                               'mb_strwidth'
         46        SEND_VAL                                                 'D%C3%A9ja+vu'
         47        INIT_FCALL                                               'mb_detect_encoding'
         48        SEND_VAL                                                 'D%C3%A9ja+vu'
         49        DO_ICALL                                         $18     
         50        SEND_VAR                                                 $18
         51        DO_ICALL                                         $19     
         52        SUB                                              ~20     !0, $19
         53        SEND_VAL                                                 ~20
         54        DO_ICALL                                         $21     
         55        CONCAT                                           ~22     'D%C3%A9ja+vu', $21
         56        CONCAT                                           ~23     ~22, '%7C'
         57        ECHO                                                     ~23
         58      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.35 ms | 1400 KiB | 31 Q