3v4l.org

run code in 300+ PHP versions simultaneously
<?php function format_str($number, $maxLen){ $len = strlen($number); $padding = $maxLen-$len; if($padding > 0){ return "<span>".str_pad ('' , $padding, '0', STR_PAD_LEFT)."</span>".$number; } return $number; } echo format_str(1,6)."\n"; echo format_str(10,6)."\n"; echo format_str(152,6)."\n"; echo format_str(32152,6)."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fJHXW
function name:  (null)
number of ops:  25
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'format_str'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 6
          3        DO_FCALL                                      0  $0      
          4        CONCAT                                           ~1      $0, '%0A'
          5        ECHO                                                     ~1
   14     6        INIT_FCALL                                               'format_str'
          7        SEND_VAL                                                 10
          8        SEND_VAL                                                 6
          9        DO_FCALL                                      0  $2      
         10        CONCAT                                           ~3      $2, '%0A'
         11        ECHO                                                     ~3
   15    12        INIT_FCALL                                               'format_str'
         13        SEND_VAL                                                 152
         14        SEND_VAL                                                 6
         15        DO_FCALL                                      0  $4      
         16        CONCAT                                           ~5      $4, '%0A'
         17        ECHO                                                     ~5
   16    18        INIT_FCALL                                               'format_str'
         19        SEND_VAL                                                 32152
         20        SEND_VAL                                                 6
         21        DO_FCALL                                      0  $6      
         22        CONCAT                                           ~7      $6, '%0A'
         23        ECHO                                                     ~7
         24      > RETURN                                                   1

Function format_str:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fJHXW
function name:  format_str
number of ops:  20
compiled vars:  !0 = $number, !1 = $maxLen, !2 = $len, !3 = $padding
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        STRLEN                                           ~4      !0
          3        ASSIGN                                                   !2, ~4
    5     4        SUB                                              ~6      !1, !2
          5        ASSIGN                                                   !3, ~6
    6     6        IS_SMALLER                                               0, !3
          7      > JMPZ                                                     ~8, ->18
    7     8    >   INIT_FCALL                                               'str_pad'
          9        SEND_VAL                                                 ''
         10        SEND_VAR                                                 !3
         11        SEND_VAL                                                 '0'
         12        SEND_VAL                                                 0
         13        DO_ICALL                                         $9      
         14        CONCAT                                           ~10     '%3Cspan%3E', $9
         15        CONCAT                                           ~11     ~10, '%3C%2Fspan%3E'
         16        CONCAT                                           ~12     ~11, !0
         17      > RETURN                                                   ~12
   10    18    > > RETURN                                                   !0
   11    19*     > RETURN                                                   null

End of function format_str

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.14 ms | 1009 KiB | 18 Q