3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lesson = array("143" => array("315", "311", "176", "145"), "13" => array("27", "25") ); $user = array( array("143" => array("145" => "1", "176" => "1")), array("13" => array("25" => "1")) ); $result = array(); foreach($user as $key => $value){ foreach($value as $key2 => $value2){ $result[$key2] = array_diff($lesson[$key2], array_keys($value2)); } } echo '<pre>'; print_r($result); echo '</pre>';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 22
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 20
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 20
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 20
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/6i6NU
function name:  (null)
number of ops:  29
compiled vars:  !0 = $lesson, !1 = $user, !2 = $result, !3 = $value, !4 = $key, !5 = $value2, !6 = $key2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    7     1        ASSIGN                                                   !1, <array>
   13     2        ASSIGN                                                   !2, <array>
   14     3      > FE_RESET_R                                       $10     !1, ->22
          4    > > FE_FETCH_R                                       ~11     $10, !3, ->22
          5    >   ASSIGN                                                   !4, ~11
   15     6      > FE_RESET_R                                       $13     !3, ->20
          7    > > FE_FETCH_R                                       ~14     $13, !5, ->20
          8    >   ASSIGN                                                   !6, ~14
   16     9        INIT_FCALL                                               'array_diff'
         10        FETCH_DIM_R                                      ~17     !0, !6
         11        SEND_VAL                                                 ~17
         12        INIT_FCALL                                               'array_keys'
         13        SEND_VAR                                                 !5
         14        DO_ICALL                                         $18     
         15        SEND_VAR                                                 $18
         16        DO_ICALL                                         $19     
         17        ASSIGN_DIM                                               !2, !6
         18        OP_DATA                                                  $19
   15    19      > JMP                                                      ->7
         20    >   FE_FREE                                                  $13
   14    21      > JMP                                                      ->4
         22    >   FE_FREE                                                  $10
   20    23        ECHO                                                     '%3Cpre%3E'
   21    24        INIT_FCALL                                               'print_r'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                                 
   22    27        ECHO                                                     '%3C%2Fpre%3E'
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.35 ms | 1440 KiB | 16 Q