3v4l.org

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

End of function asbool

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.45 ms | 1403 KiB | 19 Q