3v4l.org

run code in 300+ PHP versions simultaneously
<?php function lambda_filter_empty($entry) { return ($entry !== ''); } $test = array( 'country_id' => '1', 'state' => '', 'city' => '', 'address1' => '', ); $result = array_keys(array_filter($test, "lambda_filter_empty")); var_dump($result); $bool = $result === array("country_id"); var_dump($bool);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mtpij
function name:  (null)
number of ops:  18
compiled vars:  !0 = $test, !1 = $result, !2 = $bool
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_FCALL                                               'array_keys'
          2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'lambda_filter_empty'
          5        DO_ICALL                                         $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !1, $5
   15     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   16    12        IS_IDENTICAL                                     ~8      !1, <array>
         13        ASSIGN                                                   !2, ~8
   17    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function lambda_filter_empty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mtpij
function name:  lambda_filter_empty
number of ops:  4
compiled vars:  !0 = $entry
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        IS_NOT_IDENTICAL                                 ~1      !0, ''
          2      > RETURN                                                   ~1
    5     3*     > RETURN                                                   null

End of function lambda_filter_empty

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.22 ms | 1395 KiB | 19 Q