3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* if (isset(static::$attrAccessible)) { if (is_array(static::$attrAccessible) && count(static::$attrAccessible) > 0) { $checkArray = array_fill_keys(static::$attrAccessible, 0); $attributes = array_intersect_key($attributes, $checkArray); } } elseif (isset(static::$attrProtected)) { if (is_array(static::$attrProtected) && count(static::$attrProtected) > 0) { $checkArray = array_fill_keys(static::$attrProtected, 0); $attributes = array_diff_key($attributes, $checkArray); } } */ $attrAccessible = array('name', 'age', 'location'); $attributes = array('id', 'name', 'age', 'location', 'updated_at', 'created_at'); $checkArray = array_fill_keys($attrAccessible, 0); $purgedArray = array_diff_key($attributes, $checkArray); echo implode(', ', $attributes); echo "\n"; echo implode(', ', $purgedArray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kXJRT
function name:  (null)
number of ops:  24
compiled vars:  !0 = $attrAccessible, !1 = $attributes, !2 = $checkArray, !3 = $purgedArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, <array>
   18     1        ASSIGN                                                   !1, <array>
   20     2        INIT_FCALL                                               'array_fill_keys'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
   21     7        INIT_FCALL                                               'array_diff_key'
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !3, $8
   23    12        INIT_FCALL                                               'implode'
         13        SEND_VAL                                                 '%2C+'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $10     
         16        ECHO                                                     $10
   24    17        ECHO                                                     '%0A'
   25    18        INIT_FCALL                                               'implode'
         19        SEND_VAL                                                 '%2C+'
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                         $11     
         22        ECHO                                                     $11
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.82 ms | 1386 KiB | 19 Q