3v4l.org

run code in 300+ PHP versions simultaneously
<?php function colorSequences($i1,$i2) { $m = strlen($i1); $n = strlen($i2); $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($i1, $i2); } print_r( colorSequences("xa","asdf")); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ViVLA
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     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                                                 
   35     7      > RETURN                                                   1

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

End of function colorsequences

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.08 ms | 1398 KiB | 20 Q