3v4l.org

run code in 300+ PHP versions simultaneously
<?php $profileSubscriptions = ['one' => false, 'two' => true, 'three'=>true]; $lookup = ['one' => 'subscription', 'two' => 'marketing']; $subscriptions = array_filter($profileSubscriptions); $lists = array_intersect_key($lookup, $subscriptions); $diff = array_diff_key($subscriptions, $lists); echo 'Subscriptions do not exist for ' . implode(', ', $diff); var_dump($lists);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FCV0q
function name:  (null)
number of ops:  26
compiled vars:  !0 = $profileSubscriptions, !1 = $lookup, !2 = $subscriptions, !3 = $lists, !4 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !2, $7
    7     6        INIT_FCALL                                               'array_intersect_key'
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $9      
         10        ASSIGN                                                   !3, $9
   10    11        INIT_FCALL                                               'array_diff_key'
         12        SEND_VAR                                                 !2
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !4, $11
   11    16        INIT_FCALL                                               'implode'
         17        SEND_VAL                                                 '%2C+'
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                         $13     
         20        CONCAT                                           ~14     'Subscriptions+do+not+exist+for+', $13
         21        ECHO                                                     ~14
   13    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.67 ms | 1395 KiB | 23 Q