3v4l.org

run code in 300+ PHP versions simultaneously
<?php function testMetaphone($s1 = "", $s2 = "", $phonemes = 4) { if (empty($s1) || empty($s2)) { return false; } $m1 = metaphone($s1, $phonemes); $m2 = metaphone($s2, $phonemes); $sim = similar_text($m1, $m2, $perc); $logMessage = "M1: {$m1}, M2: {$m2}, Similarity: $sim ($perc %) - Originals text: {$s1} | {$s2}"; echo("testMetaphone: " . $logMessage); // Test accuracy if ($perc >= 85) { return true; } else { return false; } } $answerCheck = testMetaphone("Toyota", "Totota", 6); var_dump($answerCheck);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KceXD
function name:  (null)
number of ops:  10
compiled vars:  !0 = $answerCheck
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'testmetaphone'
          1        SEND_VAL                                                 'Toyota'
          2        SEND_VAL                                                 'Totota'
          3        SEND_VAL                                                 6
          4        DO_FCALL                                      0  $1      
          5        ASSIGN                                                   !0, $1
   24     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function testmetaphone:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 44
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/KceXD
function name:  testMetaphone
number of ops:  46
compiled vars:  !0 = $s1, !1 = $s2, !2 = $phonemes, !3 = $m1, !4 = $m2, !5 = $sim, !6 = $perc, !7 = $logMessage
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      ''
          1        RECV_INIT                                        !1      ''
          2        RECV_INIT                                        !2      4
    5     3        ISSET_ISEMPTY_CV                                 ~8      !0
          4      > JMPNZ_EX                                         ~8      ~8, ->7
          5    >   ISSET_ISEMPTY_CV                                 ~9      !1
          6        BOOL                                             ~8      ~9
          7    > > JMPZ                                                     ~8, ->9
    6     8    > > RETURN                                                   <false>
    9     9    >   INIT_FCALL                                               'metaphone'
         10        SEND_VAR                                                 !0
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !3, $10
   10    14        INIT_FCALL                                               'metaphone'
         15        SEND_VAR                                                 !1
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $12     
         18        ASSIGN                                                   !4, $12
   11    19        INIT_FCALL                                               'similar_text'
         20        SEND_VAR                                                 !3
         21        SEND_VAR                                                 !4
         22        SEND_REF                                                 !6
         23        DO_ICALL                                         $14     
         24        ASSIGN                                                   !5, $14
   12    25        ROPE_INIT                                    12  ~17     'M1%3A+'
         26        ROPE_ADD                                      1  ~17     ~17, !3
         27        ROPE_ADD                                      2  ~17     ~17, '%2C+M2%3A+'
         28        ROPE_ADD                                      3  ~17     ~17, !4
         29        ROPE_ADD                                      4  ~17     ~17, '%2C+Similarity%3A+'
         30        ROPE_ADD                                      5  ~17     ~17, !5
         31        ROPE_ADD                                      6  ~17     ~17, '+%28'
         32        ROPE_ADD                                      7  ~17     ~17, !6
         33        ROPE_ADD                                      8  ~17     ~17, '+%25%29+-+Originals+text%3A+'
         34        ROPE_ADD                                      9  ~17     ~17, !0
         35        ROPE_ADD                                     10  ~17     ~17, '+%7C+'
         36        ROPE_END                                     11  ~16     ~17, !1
         37        ASSIGN                                                   !7, ~16
   13    38        CONCAT                                           ~24     'testMetaphone%3A+', !7
         39        ECHO                                                     ~24
   15    40        IS_SMALLER_OR_EQUAL                                      85, !6
         41      > JMPZ                                                     ~25, ->44
   16    42    > > RETURN                                                   <true>
   15    43*       JMP                                                      ->45
   18    44    > > RETURN                                                   <false>
   20    45*     > RETURN                                                   null

End of function testmetaphone

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.58 ms | 1011 KiB | 17 Q