3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = array("one", "two", "three", "four", "five", "six"); ///with str_pad foreach ($str as $value) { if (strlen($value) <= 5) { $pad_str = str_pad($value, 6, " ", STR_PAD_RIGHT); $result = $pad_str.'bar'; echo $result.PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 18
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 17
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/8fJbk
function name:  (null)
number of ops:  20
compiled vars:  !0 = $str, !1 = $value, !2 = $pad_str, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    7     1      > FE_RESET_R                                       $5      !0, ->18
          2    > > FE_FETCH_R                                               $5, !1, ->18
    8     3    >   STRLEN                                           ~6      !1
          4        IS_SMALLER_OR_EQUAL                                      ~6, 5
          5      > JMPZ                                                     ~7, ->17
    9     6    >   INIT_FCALL                                               'str_pad'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 6
          9        SEND_VAL                                                 '+'
         10        SEND_VAL                                                 1
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !2, $8
   10    13        CONCAT                                           ~10     !2, 'bar'
         14        ASSIGN                                                   !3, ~10
   11    15        CONCAT                                           ~12     !3, '%0A'
         16        ECHO                                                     ~12
    7    17    > > JMP                                                      ->2
         18    >   FE_FREE                                                  $5
   13    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.71 ms | 1009 KiB | 14 Q