3v4l.org

run code in 300+ PHP versions simultaneously
<?php function endsWith($haystack, $needle) { return $needle === "" || substr($haystack, -strlen($needle)) === $needle; } $path = 'http://acc.telemundo.com/sites/nbcutelemundo/files/sites/nbcutelemundo/files/images/brand/07_FandangoCine_Logo_2.svg'; if(endsWith($path, '.svg')) { print "done"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/ZKQGC
function name:  (null)
number of ops:  8
compiled vars:  !0 = $path
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Facc.telemundo.com%2Fsites%2Fnbcutelemundo%2Ffiles%2Fsites%2Fnbcutelemundo%2Ffiles%2Fimages%2Fbrand%2F07_FandangoCine_Logo_2.svg'
    9     1        INIT_FCALL                                               'endswith'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '.svg'
          4        DO_FCALL                                      0  $2      
          5      > JMPZ                                                     $2, ->7
   10     6    >   ECHO                                                     'done'
   11     7    > > RETURN                                                   1

Function endswith:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/ZKQGC
function name:  endsWith
number of ops:  14
compiled vars:  !0 = $haystack, !1 = $needle
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        IS_IDENTICAL                                     ~2      !1, ''
          3      > JMPNZ_EX                                         ~2      ~2, ->12
          4    >   INIT_FCALL                                               'substr'
          5        SEND_VAR                                                 !0
          6        STRLEN                                           ~3      !1
          7        MUL                                              ~4      ~3, -1
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                         $5      
         10        IS_IDENTICAL                                     ~6      !1, $5
         11        BOOL                                             ~2      ~6
         12    > > RETURN                                                   ~2
    6    13*     > RETURN                                                   null

End of function endswith

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.75 ms | 1398 KiB | 16 Q