3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = 'Cession de Fonds de commerce / activité'; $length = 100; $diff = strlen($value) - mb_strlen($value, 'UTF-8'); $padChar='-'; $padType = PAD_RIGHT; $value = substr(str_pad($value, $length + $diff, $padChar, $padType), 0, $length + $diff); var_dump($value, strlen($value));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k5eIL
function name:  (null)
number of ops:  32
compiled vars:  !0 = $value, !1 = $length, !2 = $diff, !3 = $padChar, !4 = $padType
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Cession+de+Fonds+de+commerce+%2F+activit%C3%A9'
    4     1        ASSIGN                                                   !1, 100
    5     2        STRLEN                                           ~7      !0
          3        INIT_FCALL                                               'mb_strlen'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 'UTF-8'
          6        DO_ICALL                                         $8      
          7        SUB                                              ~9      ~7, $8
          8        ASSIGN                                                   !2, ~9
    6     9        ASSIGN                                                   !3, '-'
    7    10        FETCH_CONSTANT                                   ~12     'PAD_RIGHT'
         11        ASSIGN                                                   !4, ~12
    9    12        INIT_FCALL                                               'substr'
         13        INIT_FCALL                                               'str_pad'
         14        SEND_VAR                                                 !0
         15        ADD                                              ~14     !1, !2
         16        SEND_VAL                                                 ~14
         17        SEND_VAR                                                 !3
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                         $15     
         20        SEND_VAR                                                 $15
         21        SEND_VAL                                                 0
         22        ADD                                              ~16     !1, !2
         23        SEND_VAL                                                 ~16
         24        DO_ICALL                                         $17     
         25        ASSIGN                                                   !0, $17
   10    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !0
         28        STRLEN                                           ~19     !0
         29        SEND_VAL                                                 ~19
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.7 ms | 1396 KiB | 21 Q