3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('a' => false, 'b' => null, 'c' => '', 'd' => 'd'); function asBool($value) { return $value ? 'true' : 'false' ; } foreach ($array as $k => $v) { printf( '%s => %s isset = %s ake = %s' . PHP_EOL, $k, $v, asBool(isset($array[ $k ])), asBool(array_key_exists($k, $array)) ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 20
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/YIkcr
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1      > FE_RESET_R                                       $4      !0, ->20
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->20
          3    >   ASSIGN                                                   !2, ~5
    9     4        INIT_FCALL                                               'printf'
   10     5        SEND_VAL                                                 '%25s+%3D%3E+%25s+isset+%3D+%25s+ake+%3D+%25s%0A'
   11     6        SEND_VAR                                                 !2
          7        SEND_VAR                                                 !1
   12     8        INIT_FCALL                                               'asbool'
          9        ISSET_ISEMPTY_DIM_OBJ                         0  ~7      !0, !2
         10        SEND_VAL                                                 ~7
         11        DO_FCALL                                      0  $8      
         12        SEND_VAR                                                 $8
   13    13        INIT_FCALL                                               'asbool'
         14        ARRAY_KEY_EXISTS                                 ~9      !2, !0
         15        SEND_VAL                                                 ~9
         16        DO_FCALL                                      0  $10     
         17        SEND_VAR                                                 $10
         18        DO_ICALL                                                 
    8    19      > JMP                                                      ->2
         20    >   FE_FREE                                                  $4
   15    21      > RETURN                                                   1

Function asbool:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YIkcr
function name:  asBool
number of ops:  7
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1      > JMPZ                                                     !0, ->4
          2    >   QM_ASSIGN                                        ~1      'true'
          3      > JMP                                                      ->5
          4    >   QM_ASSIGN                                        ~1      'false'
          5    > > RETURN                                                   ~1
    6     6*     > RETURN                                                   null

End of function asbool

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.04 ms | 1399 KiB | 17 Q