3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str1 = 'Hello world!'; //coming from the database $str2 = 'hello'; // coming from $_GET user input function str_contains_old(string $hay, string $needle) { return mb_stripos($hay, $needle) !== false; } var_dump(str_contains_old($str1, $str2)); var_dump(str_contains($str1, $str2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LCa5e
function name:  (null)
number of ops:  14
compiled vars:  !0 = $str1, !1 = $str2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Hello+world%21'
    4     1        ASSIGN                                                       !1, 'hello'
   10     2        INIT_FCALL                                                   'var_dump'
          3        INIT_FCALL                                                   'str_contains_old'
          4        SEND_VAR                                                     !0
          5        SEND_VAR                                                     !1
          6        DO_FCALL                                          0  $4      
          7        SEND_VAR                                                     $4
          8        DO_ICALL                                                     
   11     9        INIT_FCALL                                                   'var_dump'
         10        FRAMELESS_ICALL_2                str_contains        ~6      !0, !1
         11        SEND_VAL                                                     ~6
         12        DO_ICALL                                                     
         13      > RETURN                                                       1

Function str_contains_old:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LCa5e
function name:  str_contains_old
number of ops:  9
compiled vars:  !0 = $hay, !1 = $needle
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    7     2        INIT_FCALL                                                   'mb_stripos'
          3        SEND_VAR                                                     !0
          4        SEND_VAR                                                     !1
          5        DO_ICALL                                             $2      
          6        TYPE_CHECK                                      1018  ~3      $2
          7      > RETURN                                                       ~3
    8     8*     > RETURN                                                       null

End of function str_contains_old

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.25 ms | 2110 KiB | 16 Q