3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f( $str ){ $l = strlen($str); for( $i = -$l; $i < $l; $i++ ){ $I = abs($i); $s = substr($str,$I,-1); echo str_repeat(',',$I) . strrev($s) . $s . "\n"; } } echo "------------\n"; f(".desserts"); echo "------------\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v2lt2
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     '------------%0A'
   13     1        INIT_FCALL                                               'f'
          2        SEND_VAL                                                 '.desserts'
          3        DO_FCALL                                      0          
   14     4        ECHO                                                     '------------%0A'
          5      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 6
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 6
Branch analysis from position: 30
Branch analysis from position: 6
filename:       /in/v2lt2
function name:  f
number of ops:  31
compiled vars:  !0 = $str, !1 = $l, !2 = $i, !3 = $I, !4 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        STRLEN                                           ~5      !0
          2        ASSIGN                                                   !1, ~5
    5     3        MUL                                              ~7      !1, -1
          4        ASSIGN                                                   !2, ~7
          5      > JMP                                                      ->28
    6     6    >   INIT_FCALL                                               'abs'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !3, $9
    7    10        INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !3
         13        SEND_VAL                                                 -1
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !4, $11
    8    16        INIT_FCALL                                               'str_repeat'
         17        SEND_VAL                                                 '%2C'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                         $13     
         20        INIT_FCALL                                               'strrev'
         21        SEND_VAR                                                 !4
         22        DO_ICALL                                         $14     
         23        CONCAT                                           ~15     $13, $14
         24        CONCAT                                           ~16     ~15, !4
         25        CONCAT                                           ~17     ~16, '%0A'
         26        ECHO                                                     ~17
    5    27        PRE_INC                                                  !2
         28    >   IS_SMALLER                                               !2, !1
         29      > JMPNZ                                                    ~19, ->6
   10    30    > > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.95 ms | 1403 KiB | 22 Q