3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rev($str) { return $str?rev(substr($str,1)).$str[0]:''; } $txt = "Thomas"; echo rev($txt);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UtHHs
function name:  (null)
number of ops:  6
compiled vars:  !0 = $txt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 'Thomas'
    8     1        INIT_FCALL                                               'rev'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function rev:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 13
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UtHHs
function name:  rev
number of ops:  16
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1      > JMPZ                                                     !0, ->13
          2    >   INIT_FCALL_BY_NAME                                       'rev'
          3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $1      
          7        SEND_VAR_NO_REF_EX                                       $1
          8        DO_FCALL                                      0  $2      
          9        FETCH_DIM_R                                      ~3      !0, 0
         10        CONCAT                                           ~4      $2, ~3
         11        QM_ASSIGN                                        ~5      ~4
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~5      ''
         14    > > RETURN                                                   ~5
    5    15*     > RETURN                                                   null

End of function rev

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.94 ms | 1398 KiB | 16 Q