3v4l.org

run code in 300+ PHP versions simultaneously
<?php function FirstReverse($str) { $length = strlen($str)-1; $rstr = NULL; for ($i = $length; $i > -1; $i--) { $rstr .= $str[$i]; } // code goes here return $rstr; } // keep this function call here // to see how to enter arguments in PHP scroll down echo FirstReverse(fgets(fopen('php://stdin', 'r')));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DrrU3
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'firstreverse'
          1        INIT_FCALL                                               'fgets'
          2        INIT_FCALL                                               'fopen'
          3        SEND_VAL                                                 'php%3A%2F%2Fstdin'
          4        SEND_VAL                                                 'r'
          5        DO_ICALL                                         $0      
          6        SEND_VAR                                                 $0
          7        DO_ICALL                                         $1      
          8        SEND_VAR                                                 $1
          9        DO_FCALL                                      0  $2      
         10        ECHO                                                     $2
         11      > RETURN                                                   1

Function firstreverse:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 7
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 7
Branch analysis from position: 12
Branch analysis from position: 7
filename:       /in/DrrU3
function name:  FirstReverse
number of ops:  14
compiled vars:  !0 = $str, !1 = $length, !2 = $rstr, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        STRLEN                                           ~4      !0
          2        SUB                                              ~5      ~4, 1
          3        ASSIGN                                                   !1, ~5
    6     4        ASSIGN                                                   !2, null
    7     5        ASSIGN                                                   !3, !1
          6      > JMP                                                      ->10
    8     7    >   FETCH_DIM_R                                      ~9      !0, !3
          8        ASSIGN_OP                                     8          !2, ~9
    7     9        PRE_DEC                                                  !3
         10    >   IS_SMALLER                                               -1, !3
         11      > JMPNZ                                                    ~12, ->7
   11    12    > > RETURN                                                   !2
   12    13*     > RETURN                                                   null

End of function firstreverse

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.36 ms | 1399 KiB | 18 Q