3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array("", 0, array(), "1", "0", "-1", -1, new Object()); foreach ($a as $b) { $c = (bool)$b; echo "value = " . var_export($b, true) . "\n"; echo "result = " . var_export($c, true) . "\n"; echo "\n\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 31
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 31
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/gmcsA
function name:  (null)
number of ops:  33
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_ARRAY                                       ~3      ''
          1        ADD_ARRAY_ELEMENT                                ~3      0
          2        ADD_ARRAY_ELEMENT                                ~3      <array>
          3        ADD_ARRAY_ELEMENT                                ~3      '1'
          4        ADD_ARRAY_ELEMENT                                ~3      '0'
          5        ADD_ARRAY_ELEMENT                                ~3      '-1'
          6        ADD_ARRAY_ELEMENT                                ~3      -1
          7        NEW                                              $4      'Object'
          8        DO_FCALL                                      0          
          9        ADD_ARRAY_ELEMENT                                ~3      $4
         10        ASSIGN                                                   !0, ~3
    3    11      > FE_RESET_R                                       $7      !0, ->31
         12    > > FE_FETCH_R                                               $7, !1, ->31
    4    13    >   BOOL                                             ~8      !1
         14        ASSIGN                                                   !2, ~8
    5    15        INIT_FCALL                                               'var_export'
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $10     
         19        CONCAT                                           ~11     'value+%3D+', $10
         20        CONCAT                                           ~12     ~11, '%0A'
         21        ECHO                                                     ~12
    6    22        INIT_FCALL                                               'var_export'
         23        SEND_VAR                                                 !2
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $13     
         26        CONCAT                                           ~14     'result+%3D+', $13
         27        CONCAT                                           ~15     ~14, '%0A'
         28        ECHO                                                     ~15
    7    29        ECHO                                                     '%0A%0A'
    3    30      > JMP                                                      ->12
         31    >   FE_FREE                                                  $7
    8    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.45 ms | 1396 KiB | 15 Q