3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_field($field, $post_id, $format = true) { return [ 'project_manager' => [33, 9, 21], 'architect' => [], 'contractor' => [17, 16] ][$field]; } function update_field($field, $payload, $post_id, $format = true) { var_export($payload); } function my_acf_save_post_31($post_id) { update_field( 'project_user_select', array_filter([ ...get_field('project_manager', $post_id, false), ...get_field('architect', $post_id, false), ...get_field('contractor', $post_id, false) ]), $post_id ); } my_acf_save_post_31(1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CONmO
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'my_acf_save_post_31'
          1        SEND_VAL                                                 1
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function get_field:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CONmO
function name:  get_field
number of ops:  6
compiled vars:  !0 = $field, !1 = $post_id, !2 = $format
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      <true>
    8     3        FETCH_DIM_R                                      ~3      <array>, !0
          4      > RETURN                                                   ~3
    9     5*     > RETURN                                                   null

End of function get_field

Function update_field:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CONmO
function name:  update_field
number of ops:  8
compiled vars:  !0 = $field, !1 = $payload, !2 = $post_id, !3 = $format
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      <true>
   12     4        INIT_FCALL                                               'var_export'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                                 
   13     7      > RETURN                                                   null

End of function update_field

Function my_acf_save_post_31:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CONmO
function name:  my_acf_save_post_31
number of ops:  29
compiled vars:  !0 = $post_id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        INIT_FCALL                                               'update_field'
   17     2        SEND_VAL                                                 'project_user_select'
   18     3        INIT_FCALL                                               'array_filter'
   19     4        INIT_FCALL                                               'get_field'
          5        SEND_VAL                                                 'project_manager'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 <false>
          8        DO_FCALL                                      0  $1      
          9        INIT_ARRAY                                       ~2      
         10        ADD_ARRAY_UNPACK                                 ~2      $1
   20    11        INIT_FCALL                                               'get_field'
         12        SEND_VAL                                                 'architect'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 <false>
         15        DO_FCALL                                      0  $3      
         16        ADD_ARRAY_UNPACK                                 ~2      $3
   21    17        INIT_FCALL                                               'get_field'
         18        SEND_VAL                                                 'contractor'
         19        SEND_VAR                                                 !0
         20        SEND_VAL                                                 <false>
         21        DO_FCALL                                      0  $4      
         22        ADD_ARRAY_UNPACK                                 ~2      $4
         23        SEND_VAL                                                 ~2
   18    24        DO_ICALL                                         $5      
   21    25        SEND_VAR                                                 $5
   23    26        SEND_VAR                                                 !0
   16    27        DO_FCALL                                      0          
   25    28      > RETURN                                                   null

End of function my_acf_save_post_31

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.73 ms | 1013 KiB | 20 Q