3v4l.org

run code in 300+ PHP versions simultaneously
<?php function AlphabetSoup($data,$currentValues) { $result =[]; foreach ($currentValues as $key => $value){ if($data[$key] == $value) continue; $result[$key] = $value; // if($data['allocation_even'] ==! $currentValues['allocation_even']) { // $result['allocation_even'] = $data['allocation_even']; // } // $differences = array_merge(array_diff(explode(',', $data['os_targeting']), explode(',' , $currentValues['os_targeting'])) // , array_diff(explode(',', $currentValues['os_targeting']), explode(',' ,$data['os_targeting']))); // if(!empty($differences)) { // $result['os_targeting'] = $data['os_targeting']; } return $result; } $data = [ 'allocation_even' => '1' , 'os_targeting' => 'Mac_OS_X,Linux,Win']; $current = [ 'allocation_even' => '1' , 'os_targeting' => 'Win,Mac_OS_X,Linux', 'other_value'=>0]; print_r( AlphabetSoup($data,$current));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B91CN
function name:  (null)
number of ops:  10
compiled vars:  !0 = $data, !1 = $current
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, <array>
   18     1        ASSIGN                                                   !1, <array>
   19     2        INIT_FCALL                                               'print_r'
          3        INIT_FCALL                                               'alphabetsoup'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function alphabetsoup:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/B91CN
function name:  AlphabetSoup
number of ops:  16
compiled vars:  !0 = $data, !1 = $currentValues, !2 = $result, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        ASSIGN                                                   !2, <array>
    4     3      > FE_RESET_R                                       $6      !1, ->13
          4    > > FE_FETCH_R                                       ~7      $6, !3, ->13
          5    >   ASSIGN                                                   !4, ~7
    5     6        FETCH_DIM_R                                      ~9      !0, !4
          7        IS_EQUAL                                                 !3, ~9
          8      > JMPZ                                                     ~10, ->10
          9    > > JMP                                                      ->4
    6    10    >   ASSIGN_DIM                                               !2, !4
         11        OP_DATA                                                  !3
    4    12      > JMP                                                      ->4
         13    >   FE_FREE                                                  $6
   15    14      > RETURN                                                   !2
   16    15*     > RETURN                                                   null

End of function alphabetsoup

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.44 ms | 1399 KiB | 16 Q