3v4l.org

run code in 500+ PHP versions simultaneously
<?php error_reporting(0); function f($s){for($i=-($l=strlen($s));$i<$l;$I=abs(++$i)){$t=substr($s,$I);echo str_repeat(' ',$I).strrev($t).substr($t,1)."\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/9Vvkm
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                                   'error_reporting'
          1        SEND_VAL                                                     0
          2        DO_ICALL                                                     
    6     3        ECHO                                                         '------------%0A'
    7     4        INIT_FCALL                                                   'f'
          5        SEND_VAL                                                     '+desserts'
          6        DO_FCALL                                          0          
    8     7        ECHO                                                         '------------%0A'
          8      > RETURN                                                       1

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

End of function f

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.62 ms | 2859 KiB | 18 Q