3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_delete($array, $element) { return array_diff($array, [$element]); } print_r(array_delete( [312, 401, 401, 1599, 3], 401 )); // returns [312, 1599, 3]
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1kXM
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'array_delete'
          2        SEND_VAL                                                 <array>
          3        SEND_VAL                                                 401
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function array_delete:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1kXM
function name:  array_delete
number of ops:  9
compiled vars:  !0 = $array, !1 = $element
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'array_diff'
          3        SEND_VAR                                                 !0
          4        INIT_ARRAY                                       ~2      !1
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                         $3      
          7      > RETURN                                                   $3
    5     8*     > RETURN                                                   null

End of function array_delete

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.29 ms | 1397 KiB | 18 Q