3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = '1-2-3-4-5'; echo substr($str, strrpos($str, '-') + 1)."\n\n"; echo substr($str, strrpos($str, ';') + 1)."\n\n"; $str = '1-2-3-4-5'; if (($pos = strrpos($str, ';')) !== false) echo substr($str, $pos + 1); else echo $str;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ihtf2
function name:  (null)
number of ops:  31
compiled vars:  !0 = $str, !1 = $pos
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '1-2-3-4-5'
    4     1        INIT_FCALL                                                   'strrpos'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     '-'
          4        DO_ICALL                                             $3      
          5        ADD                                                  ~4      $3, 1
          6        FRAMELESS_ICALL_2                substr              ~5      !0, ~4
          7        CONCAT                                               ~6      ~5, '%0A%0A'
          8        ECHO                                                         ~6
    5     9        INIT_FCALL                                                   'strrpos'
         10        SEND_VAR                                                     !0
         11        SEND_VAL                                                     '%3B'
         12        DO_ICALL                                             $7      
         13        ADD                                                  ~8      $7, 1
         14        FRAMELESS_ICALL_2                substr              ~9      !0, ~8
         15        CONCAT                                               ~10     ~9, '%0A%0A'
         16        ECHO                                                         ~10
    7    17        ASSIGN                                                       !0, '1-2-3-4-5'
    8    18        INIT_FCALL                                                   'strrpos'
         19        SEND_VAR                                                     !0
         20        SEND_VAL                                                     '%3B'
         21        DO_ICALL                                             $12     
         22        ASSIGN                                               ~13     !1, $12
         23        TYPE_CHECK                                      1018          ~13
         24      > JMPZ                                                         ~14, ->29
    9    25    >   ADD                                                  ~15     !1, 1
         26        FRAMELESS_ICALL_2                substr              ~16     !0, ~15
         27        ECHO                                                         ~16
    8    28      > JMP                                                          ->30
   11    29    >   ECHO                                                         !0
   12    30    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.29 ms | 2102 KiB | 14 Q