3v4l.org

run code in 300+ PHP versions simultaneously
<?php function colorSequences($i1,$i2) { $m = strlen($i1); $n = strlen($i2); $am = str_split($i1); $at = str_split($i2); $count = 0; /*for($i=0;$i<$m;$i++){ if(count($i2) > 0){ if( in_array($i1[$i],$at) ){ $key = array_search($i1[$i],$at); unset($at[$key]); }else{ $count++; } }else{ $count++; } } return $count+(count($at))-$m;*/ return array_diff($at, $am); } print_r( colorSequences("xa","asdf")); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GsuAH
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'colorsequences'
          2        SEND_VAL                                                 'xa'
          3        SEND_VAL                                                 'asdf'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
   36     7      > RETURN                                                   1

Function colorsequences:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GsuAH
function name:  colorSequences
number of ops:  21
compiled vars:  !0 = $i1, !1 = $i2, !2 = $m, !3 = $n, !4 = $am, !5 = $at, !6 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        STRLEN                                           ~7      !0
          3        ASSIGN                                                   !2, ~7
    7     4        STRLEN                                           ~9      !1
          5        ASSIGN                                                   !3, ~9
    8     6        INIT_FCALL                                               'str_split'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $11     
          9        ASSIGN                                                   !4, $11
    9    10        INIT_FCALL                                               'str_split'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $13     
         13        ASSIGN                                                   !5, $13
   10    14        ASSIGN                                                   !6, 0
   26    15        INIT_FCALL                                               'array_diff'
         16        SEND_VAR                                                 !5
         17        SEND_VAR                                                 !4
         18        DO_ICALL                                         $16     
         19      > RETURN                                                   $16
   27    20*     > RETURN                                                   null

End of function colorsequences

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.37 ms | 944 KiB | 21 Q