3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'abscdefs'; if((strlen($string)-1) == strrpos($string,'s')){ echo substr($string, 0, strlen($string)-1); }else{ echo 'nada'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K6pmC
function name:  (null)
number of ops:  20
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'abscdefs'
    3     1        STRLEN                                           ~2      !0
          2        SUB                                              ~3      ~2, 1
          3        INIT_FCALL                                               'strrpos'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 's'
          6        DO_ICALL                                         $4      
          7        IS_EQUAL                                                 $4, ~3
          8      > JMPZ                                                     ~5, ->18
    4     9    >   INIT_FCALL                                               'substr'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 0
         12        STRLEN                                           ~6      !0
         13        SUB                                              ~7      ~6, 1
         14        SEND_VAL                                                 ~7
         15        DO_ICALL                                         $8      
         16        ECHO                                                     $8
         17      > JMP                                                      ->19
    6    18    >   ECHO                                                     'nada'
    7    19    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
189.68 ms | 1395 KiB | 17 Q