3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hasil = 65; $kecewa = array(0,40,65); $biasa = array(40,65,80); $puas = array(65,80,100); $kb = array_intersect($kecewa, $biasa); $bp = array_intersect($biasa, $puas); print_r($kb); print_r($bp); if ( $hasil <= $kb ) { // hitung nilai kecewa pake rumus fuzzy logic $muKecewa = ($kb[2] - $hasil) / ($kb[2] - $kb[1]); //output : 52,5 $muBiasa = ($muKecewa >= 1) ? '0' : '0.5'; // output: bool(true)/ 0.5 echo "muKecewa".$muKecewa; echo "muBiasa".$muBiasa; } elseif ( $hasil <= $bp ) { $muBiasa = ($hasil - $kb[1]) / ($bp[1] - $kb[1]); $muPuas = ($muBiasa >= 1) ? '0.5' : '0'; echo "muBias".$muBiasa; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 40
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 57
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 53
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 57
filename:       /in/2mIOb
function name:  (null)
number of ops:  58
compiled vars:  !0 = $hasil, !1 = $kecewa, !2 = $biasa, !3 = $puas, !4 = $kb, !5 = $bp, !6 = $muKecewa, !7 = $muBiasa, !8 = $muPuas
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 65
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, <array>
    5     3        ASSIGN                                                   !3, <array>
    6     4        INIT_FCALL                                               'array_intersect'
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $13     
          8        ASSIGN                                                   !4, $13
    7     9        INIT_FCALL                                               'array_intersect'
         10        SEND_VAR                                                 !2
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $15     
         13        ASSIGN                                                   !5, $15
    8    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !4
         16        DO_ICALL                                                 
    9    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !5
         19        DO_ICALL                                                 
   11    20        IS_SMALLER_OR_EQUAL                                      !0, !4
         21      > JMPZ                                                     ~19, ->40
   14    22    >   FETCH_DIM_R                                      ~20     !4, 2
         23        SUB                                              ~21     ~20, !0
         24        FETCH_DIM_R                                      ~22     !4, 2
         25        FETCH_DIM_R                                      ~23     !4, 1
         26        SUB                                              ~24     ~22, ~23
         27        DIV                                              ~25     ~21, ~24
         28        ASSIGN                                                   !6, ~25
   15    29        IS_SMALLER_OR_EQUAL                                      1, !6
         30      > JMPZ                                                     ~27, ->33
         31    >   QM_ASSIGN                                        ~28     '0'
         32      > JMP                                                      ->34
         33    >   QM_ASSIGN                                        ~28     '0.5'
         34    >   ASSIGN                                                   !7, ~28
   17    35        CONCAT                                           ~30     'muKecewa', !6
         36        ECHO                                                     ~30
   18    37        CONCAT                                           ~31     'muBiasa', !7
         38        ECHO                                                     ~31
         39      > JMP                                                      ->57
   20    40    >   IS_SMALLER_OR_EQUAL                                      !0, !5
         41      > JMPZ                                                     ~32, ->57
   22    42    >   FETCH_DIM_R                                      ~33     !4, 1
         43        SUB                                              ~34     !0, ~33
         44        FETCH_DIM_R                                      ~35     !5, 1
         45        FETCH_DIM_R                                      ~36     !4, 1
         46        SUB                                              ~37     ~35, ~36
         47        DIV                                              ~38     ~34, ~37
         48        ASSIGN                                                   !7, ~38
   23    49        IS_SMALLER_OR_EQUAL                                      1, !7
         50      > JMPZ                                                     ~40, ->53
         51    >   QM_ASSIGN                                        ~41     '0.5'
         52      > JMP                                                      ->54
         53    >   QM_ASSIGN                                        ~41     '0'
         54    >   ASSIGN                                                   !8, ~41
   24    55        CONCAT                                           ~43     'muBias', !7
         56        ECHO                                                     ~43
   26    57    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.48 ms | 1392 KiB | 17 Q