3v4l.org

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

Class d: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.95 ms | 1396 KiB | 15 Q