3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string1 = "Hello how are you doing"; $string2 = " hi, how are you"; $words1 = str_word_count($string1, 1); $words2 = str_word_count($string2, 1); var_export( count(array_intersect($words1, $words2)) / count($words1) * 100 );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nAb27
function name:  (null)
number of ops:  24
compiled vars:  !0 = $string1, !1 = $string2, !2 = $words1, !3 = $words2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Hello+how+are+you+doing'
    4     1        ASSIGN                                                   !1, '+hi%2C+how+are+you'
    6     2        INIT_FCALL                                               'str_word_count'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 1
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
    7     7        INIT_FCALL                                               'str_word_count'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 1
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !3, $8
    9    12        INIT_FCALL                                               'var_export'
   10    13        INIT_FCALL                                               'array_intersect'
         14        SEND_VAR                                                 !2
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                         $10     
         17        COUNT                                            ~11     $10
         18        COUNT                                            ~12     !2
         19        DIV                                              ~13     ~11, ~12
         20        MUL                                              ~14     ~13, 100
         21        SEND_VAL                                                 ~14
    9    22        DO_ICALL                                                 
   11    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.83 ms | 1003 KiB | 16 Q