3v4l.org

run code in 300+ PHP versions simultaneously
<?php $valid_strings = array("<p>","&nbsp;"); $test1 = '<p>asdasdasdasdasdasdasd</p>'; $test2 = '<p>&nbsp;&nbsp;&nbsp;&nbsp;</p>'; echo ContainsAnythingElseThan($test1,$valid_strings); echo ContainsAnythingElseThan($test2,$valid_strings); function ContainsAnythingElseThan($the_string,$the_valid_strings_array) { return count(str_replace($the_valid_strings_array,'',$the_string))!=0; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tM0VF
function name:  (null)
number of ops:  14
compiled vars:  !0 = $valid_strings, !1 = $test1, !2 = $test2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, '%3Cp%3Easdasdasdasdasdasdasd%3C%2Fp%3E'
    7     2        ASSIGN                                                   !2, '%3Cp%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2Fp%3E'
   10     3        INIT_FCALL_BY_NAME                                       'ContainsAnythingElseThan'
          4        SEND_VAR_EX                                              !1
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $6      
          7        ECHO                                                     $6
   12     8        INIT_FCALL_BY_NAME                                       'ContainsAnythingElseThan'
          9        SEND_VAR_EX                                              !2
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0  $7      
         12        ECHO                                                     $7
   19    13      > RETURN                                                   1

Function containsanythingelsethan:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tM0VF
function name:  ContainsAnythingElseThan
number of ops:  11
compiled vars:  !0 = $the_string, !1 = $the_valid_strings_array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        COUNT                                            ~3      $2
          8        IS_NOT_EQUAL                                     ~4      ~3, 0
          9      > RETURN                                                   ~4
   19    10*     > RETURN                                                   null

End of function containsanythingelsethan

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.11 ms | 1387 KiB | 15 Q