3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rev($str) { return $str ? rev($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/LoMTG
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 = 8
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LoMTG
function name:  rev
number of ops:  11
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1      > JMPZ                                                     !0, ->8
          2    >   INIT_FCALL_BY_NAME                                       'rev'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAL_EX                                              1
          5        DO_FCALL                                      0  $1      
          6        QM_ASSIGN                                        ~2      $1
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~2      ''
          9    > > RETURN                                                   ~2
    5    10*     > RETURN                                                   null

End of function rev

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.19 ms | 1397 KiB | 14 Q