3v4l.org

run code in 300+ PHP versions simultaneously
<?php function strip_trailing_blank_entries($array) { if(in_array("", $array, true) === TRUE) { return array_diff($array, [""]); } } var_dump(strip_trailing_blank_entries(["foop", "nuts", "assholechickenfuck", "", ""])); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hYURv
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'strip_trailing_blank_entries'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
    9     6      > RETURN                                                   1

Function strip_trailing_blank_entries:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hYURv
function name:  strip_trailing_blank_entries
number of ops:  14
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'in_array'
          2        SEND_VAL                                                 ''
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $1      
          6        TYPE_CHECK                                    8          $1
          7      > JMPZ                                                     ~2, ->13
    5     8    >   INIT_FCALL                                               'array_diff'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 <array>
         11        DO_ICALL                                         $3      
         12      > RETURN                                                   $3
    7    13    > > RETURN                                                   null

End of function strip_trailing_blank_entries

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.38 ms | 1398 KiB | 20 Q