3v4l.org

run code in 300+ PHP versions simultaneously
<?php # Null Coalescing Assignment Operator # OLD WAY (PHP < 7.4 ) $data['comments']['user_id'] = $data['comments']['user_id'] ?? 'PlaceHoldered value...'; var_dump($data['comments']['user_id']); $data = null; # PHP 7.4 + syntax to use new assigment operator without unecessary tests. $data['comments']['user_id'] ??= 'PlaceHoldered value...'; var_dump($data['comments']['user_id']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pV6PF
function name:  (null)
number of ops:  27
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_DIM_IS                                     ~3      !0, 'comments'
          1        FETCH_DIM_IS                                     ~4      ~3, 'user_id'
          2        COALESCE                                         ~5      ~4
          3        QM_ASSIGN                                        ~5      'PlaceHoldered+value...'
          4        FETCH_DIM_W                                      $1      !0, 'comments'
          5        ASSIGN_DIM                                               $1, 'user_id'
          6        OP_DATA                                                  ~5
    6     7        INIT_FCALL                                               'var_dump'
          8        FETCH_DIM_R                                      ~6      !0, 'comments'
          9        FETCH_DIM_R                                      ~7      ~6, 'user_id'
         10        SEND_VAL                                                 ~7
         11        DO_ICALL                                                 
    7    12        ASSIGN                                                   !0, null
   10    13        FETCH_DIM_IS                                     ~10     !0, 'comments'
         14        FETCH_DIM_IS                                     ~11     ~10, 'user_id'
         15        COALESCE                                         ~12     ~11
         16        FETCH_DIM_W                                      $13     !0, 'comments'
         17        ASSIGN_DIM                                       ~14     $13, 'user_id'
         18        OP_DATA                                                  'PlaceHoldered+value...'
         19        QM_ASSIGN                                        ~12     ~14
         20        FREE                                                     ~12
   11    21        INIT_FCALL                                               'var_dump'
         22        FETCH_DIM_R                                      ~15     !0, 'comments'
         23        FETCH_DIM_R                                      ~16     ~15, 'user_id'
         24        SEND_VAL                                                 ~16
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.82 ms | 1000 KiB | 14 Q