3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php foreach([true, 1, '1', 'a', [1], (object)[]] as $val) echo var_export($val, true) . ' == true is ' . ($val == true ? 'true' : 'false') . PHP_EOL;
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 77) Position 1 = 8, Position 2 = 23
Branch analysis from position: 8
Jump found. (Code = 78) Position 1 = 9, Position 2 = 23
Branch analysis from position: 9
Jump found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
Jump found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Jump found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 18
Jump found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 23
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/54qvM
function name:  (null)
number of ops:  25
compiled vars:  !0 = $val
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   INIT_ARRAY                                       ~1      <true>
         1        ADD_ARRAY_ELEMENT                                ~1      1
         2        ADD_ARRAY_ELEMENT                                ~1      '1'
         3        ADD_ARRAY_ELEMENT                                ~1      'a'
         4        ADD_ARRAY_ELEMENT                                ~1      <array>
         5        CAST                                          8  ~2      <array>
         6        ADD_ARRAY_ELEMENT                                ~1      ~2
         7      > FE_RESET_R                                       $3      ~1, ->23
         8    > > FE_FETCH_R                                               $3, !0, ->23
   4     9    >   INIT_FCALL                                               'var_export'
        10        SEND_VAR                                                 !0
        11        SEND_VAL                                                 <true>
        12        DO_ICALL                                         $4      
        13        CONCAT                                           ~5      $4, '+%3D%3D+true+is+'
        14        BOOL                                             ~6      !0
        15      > JMPZ                                                     ~6, ->18
        16    >   QM_ASSIGN                                        ~7      'true'
        17      > JMP                                                      ->19
        18    >   QM_ASSIGN                                        ~7      'false'
        19    >   CONCAT                                           ~8      ~5, ~7
        20        CONCAT                                           ~9      ~8, '%0A'
        21        ECHO                                                     ~9
        22      > JMP                                                      ->8
        23    >   FE_FREE                                                  $3
   5    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.2.0