3v4l.org

run code in 300+ PHP versions simultaneously
<?php function reverseString(string $text): string { $string = ''; for ($i = strlen($text); $i >= 0; $i--) { $string .= strlen($text, $i, 1); } return $string; throw new BadFunctionCallException("Please implement the reverseString method!"); } reverseString("hello");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bN5U7
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'reversestring'
          1        SEND_VAL                                                 'hello'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function reversestring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 5
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 5
Branch analysis from position: 14
Branch analysis from position: 5
filename:       /in/bN5U7
function name:  reverseString
number of ops:  22
compiled vars:  !0 = $text, !1 = $string, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, ''
    6     2        STRLEN                                           ~4      !0
          3        ASSIGN                                                   !2, ~4
          4      > JMP                                                      ->12
    8     5    >   INIT_FCALL                                               'strlen'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !2
          8        SEND_VAL                                                 1
          9        DO_ICALL                                         $6      
         10        ASSIGN_OP                                     8          !1, $6
    6    11        PRE_DEC                                                  !2
         12    >   IS_SMALLER_OR_EQUAL                                      0, !2
         13      > JMPNZ                                                    ~9, ->5
   10    14    >   VERIFY_RETURN_TYPE                                       !1
         15      > RETURN                                                   !1
   12    16*       NEW                                              $10     'BadFunctionCallException'
         17*       SEND_VAL_EX                                              'Please+implement+the+reverseString+method%21'
         18*       DO_FCALL                                      0          
         19*       THROW                                         0          $10
   13    20*       VERIFY_RETURN_TYPE                                       
         21*     > RETURN                                                   null

End of function reversestring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.06 ms | 1440 KiB | 15 Q