3v4l.org

run code in 300+ PHP versions simultaneously
<?php function commonCharacterCount($s1, $s2) { $a1 = str_split($s1); $a2 = str_split($s2); $common = array_intersect($a1, $a2); var_dump($a1, $a2); return count($common); } var_dump(str_split("aabcc")); // var_dump(commonCharacterCount("aabcc", "adcaa"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FvC2W
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'str_split'
          2        SEND_VAL                                                 'aabcc'
          3        DO_ICALL                                         $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   15     6      > RETURN                                                   1

Function commoncharactercount:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FvC2W
function name:  commonCharacterCount
number of ops:  22
compiled vars:  !0 = $s1, !1 = $s2, !2 = $a1, !3 = $a2, !4 = $common
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'str_split'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !2, $5
    5     6        INIT_FCALL                                               'str_split'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !3, $7
    6    10        INIT_FCALL                                               'array_intersect'
         11        SEND_VAR                                                 !2
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $9      
         14        ASSIGN                                                   !4, $9
    8    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !2
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                                 
   10    19        COUNT                                            ~12     !4
         20      > RETURN                                                   ~12
   11    21*     > RETURN                                                   null

End of function commoncharactercount

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.29 ms | 1013 KiB | 16 Q