3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = [ 0 => "Sat 2", 1 => "Sun 3", 2 => "Mon 4", 3 => "Tue 5", 4 => "Mon 4", 5 => "Mon 4", 6 => "Sun 3", ]; $condition = function($count){ return $count == 1; }; $result = array_keys(array_filter(array_count_values($arr),$condition)); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0KEdZ
function name:  (null)
number of ops:  18
compiled vars:  !0 = $arr, !1 = $condition, !2 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   12     1        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
          2        ASSIGN                                                       !1, ~4
   16     3        INIT_FCALL                                                   'array_keys'
          4        INIT_FCALL                                                   'array_filter'
          5        INIT_FCALL                                                   'array_count_values'
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                             $6      
          8        SEND_VAR                                                     $6
          9        SEND_VAR                                                     !1
         10        DO_ICALL                                             $7      
         11        SEND_VAR                                                     $7
         12        DO_ICALL                                             $8      
         13        ASSIGN                                                       !2, $8
   18    14        INIT_FCALL                                                   'var_dump'
         15        SEND_VAR                                                     !2
         16        DO_ICALL                                                     
         17      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0KEdZ
function name:  {closure:/in/0KEdZ:12}
number of ops:  4
compiled vars:  !0 = $count
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV                                                 !0      
   13     1        IS_EQUAL                                             ~1      !0, 1
          2      > RETURN                                                       ~1
   14     3*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.56 ms | 1893 KiB | 17 Q