3v4l.org

run code in 300+ PHP versions simultaneously
<?php function endsWith($haystack, $needle) { return $needle === "" || substr($haystack, -strlen($needle)) === $needle; } var_dump(endsWith('gdjsidfg9ud@gmail.com_deleted', '_deleted'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bB1J0
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'endswith'
          2        SEND_VAL                                                 'gdjsidfg9ud%40gmail.com_deleted'
          3        SEND_VAL                                                 '_deleted'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
          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/bB1J0
function name:  endsWith
number of ops:  14
compiled vars:  !0 = $haystack, !1 = $needle
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     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
    5    13*     > RETURN                                                   null

End of function endswith

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.62 ms | 1398 KiB | 18 Q