3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rev($str) { return $str ? rev(substr($str, 1)) : ""; } $txt = "Thomas"; echo rev($txt);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ERfcQ
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 = 11
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ERfcQ
function name:  rev
number of ops:  14
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1      > JMPZ                                                     !0, ->11
          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        QM_ASSIGN                                        ~3      $2
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~3      ''
         12    > > RETURN                                                   ~3
    5    13*     > RETURN                                                   null

End of function rev

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.37 ms | 1398 KiB | 16 Q