3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getPartnerData($data) { $partner = $data['is_partner']; if ($partner !== '1') { $is_partner = false; } elseif ($partner == '1') { $is_partner = true; } return $is_partner; } function isPartner(array $partnerData) { return isset($partnerData['is_partner']) && $partnerData['is_partner'] === '1'; } var_dump( isPartner(['is_partner' => '1']), isPartner(['is_partner' => '2']), isPartner([]) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CFNDi
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'var_dump'
   20     1        INIT_FCALL                                               'ispartner'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
   21     5        INIT_FCALL                                               'ispartner'
          6        SEND_VAL                                                 <array>
          7        DO_FCALL                                      0  $1      
          8        SEND_VAR                                                 $1
   22     9        INIT_FCALL                                               'ispartner'
         10        SEND_VAL                                                 <array>
         11        DO_FCALL                                      0  $2      
         12        SEND_VAR                                                 $2
         13        DO_ICALL                                                 
   23    14      > RETURN                                                   1

Function getpartnerdata:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/CFNDi
function name:  getPartnerData
number of ops:  12
compiled vars:  !0 = $data, !1 = $partner, !2 = $is_partner
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        FETCH_DIM_R                                      ~3      !0, 'is_partner'
          2        ASSIGN                                                   !1, ~3
    6     3        IS_NOT_IDENTICAL                                         !1, '1'
          4      > JMPZ                                                     ~5, ->7
    7     5    >   ASSIGN                                                   !2, <false>
          6      > JMP                                                      ->10
    8     7    >   IS_EQUAL                                                 !1, '1'
          8      > JMPZ                                                     ~7, ->10
    9     9    >   ASSIGN                                                   !2, <true>
   11    10    > > RETURN                                                   !2
   12    11*     > RETURN                                                   null

End of function getpartnerdata

Function ispartner:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/CFNDi
function name:  isPartner
number of ops:  8
compiled vars:  !0 = $partnerData
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        ISSET_ISEMPTY_DIM_OBJ                         0  ~1      !0, 'is_partner'
          2      > JMPZ_EX                                          ~1      ~1, ->6
   16     3    >   FETCH_DIM_R                                      ~2      !0, 'is_partner'
          4        IS_IDENTICAL                                     ~3      ~2, '1'
          5        BOOL                                             ~1      ~3
          6    > > RETURN                                                   ~1
   17     7*     > RETURN                                                   null

End of function ispartner

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.25 ms | 1403 KiB | 18 Q