3v4l.org

run code in 300+ PHP versions simultaneously
<?php $remove = '300'; $values = ['300','200','400', '500']; //---- remove list of values (accepts array of values to remove) ---- $new = array_diff($values, (array) $remove); print_r($new); echo \PHP_EOL; $values = ['200', '300', '400','500']; //move the value somewhere else; $new = array_diff($values, (array) $remove); print_r($new); echo \PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oDqMj
function name:  (null)
number of ops:  24
compiled vars:  !0 = $remove, !1 = $values, !2 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '300'
    4     1        ASSIGN                                                   !1, <array>
    7     2        INIT_FCALL                                               'array_diff'
          3        SEND_VAR                                                 !1
          4        CAST                                          7  ~5      !0
          5        SEND_VAL                                                 ~5
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !2, $6
    8     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
    9    11        ECHO                                                     '%0A'
   11    12        ASSIGN                                                   !1, <array>
   12    13        INIT_FCALL                                               'array_diff'
         14        SEND_VAR                                                 !1
         15        CAST                                          7  ~10     !0
         16        SEND_VAL                                                 ~10
         17        DO_ICALL                                         $11     
         18        ASSIGN                                                   !2, $11
   13    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                                 
   14    22        ECHO                                                     '%0A'
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.15 ms | 1395 KiB | 17 Q