3v4l.org

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

Function ishappy:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Aa0U3
function name:  isHappy
number of ops:  14
compiled vars:  !0 = $issues, !1 = $happiness
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'array_count_values'
          2        INIT_FCALL                                               'array_map'
          3        SEND_VAL                                                 'intval'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                         $3      
          8        ASSIGN                                                   !1, $3
    5     9        FETCH_DIM_R                                      ~5      !1, 1
         10        FETCH_DIM_R                                      ~6      !1, 0
         11        IS_SMALLER                                       ~7      ~6, ~5
         12      > RETURN                                                   ~7
    6    13*     > RETURN                                                   null

End of function ishappy

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.13 ms | 1004 KiB | 17 Q