3v4l.org

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

Class d: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.76 ms | 1396 KiB | 15 Q