3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "omceD evoL 1"; function reverseMe( String $string ) { if ( strlen($string > 1) ) { $reversedString = ReverseMe( substr($string, 1) ) . substr($string, 0, 1); } else { $reversedString = $string; } return $reversedString; } reverseMe($str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DPD0s
function name:  (null)
number of ops:  5
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'omceD+evoL+1'
   19     1        INIT_FCALL                                               'reverseme'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function reverseme:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DPD0s
function name:  reverseMe
number of ops:  22
compiled vars:  !0 = $string, !1 = $reversedString
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        IS_SMALLER                                       ~2      1, !0
          2        STRLEN                                           ~3      ~2
          3      > JMPZ                                                     ~3, ->19
    9     4    >   INIT_FCALL_BY_NAME                                       'ReverseMe'
          5        INIT_FCALL                                               'substr'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 1
          8        DO_ICALL                                         $4      
          9        SEND_VAR_NO_REF_EX                                       $4
         10        DO_FCALL                                      0  $5      
         11        INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 1
         15        DO_ICALL                                         $6      
         16        CONCAT                                           ~7      $5, $6
         17        ASSIGN                                                   !1, ~7
         18      > JMP                                                      ->20
   13    19    >   ASSIGN                                                   !1, !0
   16    20    > > RETURN                                                   !1
   17    21*     > RETURN                                                   null

End of function reverseme

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.02 ms | 1399 KiB | 16 Q