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); 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/08EQ6
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 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 6
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 6
Branch analysis from position: 29
Branch analysis from position: 6
filename:       /in/08EQ6
function name:  f
number of ops:  30
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                                                      ->27
    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        DO_ICALL                                         $11     
         14        ASSIGN                                                   !4, $11
    8    15        INIT_FCALL                                               'str_repeat'
         16        SEND_VAL                                                 '%2C'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                         $13     
         19        INIT_FCALL                                               'strrev'
         20        SEND_VAR                                                 !4
         21        DO_ICALL                                         $14     
         22        CONCAT                                           ~15     $13, $14
         23        CONCAT                                           ~16     ~15, !4
         24        CONCAT                                           ~17     ~16, '%0A'
         25        ECHO                                                     ~17
    5    26        PRE_INC                                                  !2
         27    >   IS_SMALLER                                               !2, !1
         28      > JMPNZ                                                    ~19, ->6
   10    29    > > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.03 ms | 1403 KiB | 22 Q