3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = array("", NULL, 0, 1, "0", "1", true, false, new stdClass(), array(1), array()); echo "X\t!!(x)\t(x==true)\t(x===true)=\n\n"; foreach($test as $t) { echo var_export($t, true) . "\t" . var_export((!!$t), true) . "\t" . var_export(($t==true),true). "\t" . var_export(($t===true),true). "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 46
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 46
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
filename:       /in/nZL2I
function name:  (null)
number of ops:  48
compiled vars:  !0 = $test, !1 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_ARRAY                                       ~2      ''
          1        ADD_ARRAY_ELEMENT                                ~2      null
          2        ADD_ARRAY_ELEMENT                                ~2      0
          3        ADD_ARRAY_ELEMENT                                ~2      1
          4        ADD_ARRAY_ELEMENT                                ~2      '0'
          5        ADD_ARRAY_ELEMENT                                ~2      '1'
          6        ADD_ARRAY_ELEMENT                                ~2      <true>
          7        ADD_ARRAY_ELEMENT                                ~2      <false>
          8        NEW                                              $3      'stdClass'
          9        DO_FCALL                                      0          
         10        ADD_ARRAY_ELEMENT                                ~2      $3
         11        ADD_ARRAY_ELEMENT                                ~2      <array>
         12        ADD_ARRAY_ELEMENT                                ~2      <array>
         13        ASSIGN                                                   !0, ~2
    3    14        ECHO                                                     'X%09%21%21%28x%29%09%28x%3D%3Dtrue%29%09%28x%3D%3D%3Dtrue%29%3D%0A%0A'
    5    15      > FE_RESET_R                                       $6      !0, ->46
         16    > > FE_FETCH_R                                               $6, !1, ->46
    6    17    >   INIT_FCALL                                               'var_export'
         18        SEND_VAR                                                 !1
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $7      
         21        CONCAT                                           ~8      $7, '%09'
         22        INIT_FCALL                                               'var_export'
         23        BOOL_NOT                                         ~9      !1
         24        BOOL_NOT                                         ~10     ~9
         25        SEND_VAL                                                 ~10
         26        SEND_VAL                                                 <true>
         27        DO_ICALL                                         $11     
         28        CONCAT                                           ~12     ~8, $11
         29        CONCAT                                           ~13     ~12, '%09'
         30        INIT_FCALL                                               'var_export'
         31        BOOL                                             ~14     !1
         32        SEND_VAL                                                 ~14
         33        SEND_VAL                                                 <true>
         34        DO_ICALL                                         $15     
         35        CONCAT                                           ~16     ~13, $15
         36        CONCAT                                           ~17     ~16, '%09'
         37        INIT_FCALL                                               'var_export'
         38        TYPE_CHECK                                    8  ~18     !1
         39        SEND_VAL                                                 ~18
         40        SEND_VAL                                                 <true>
         41        DO_ICALL                                         $19     
         42        CONCAT                                           ~20     ~17, $19
         43        CONCAT                                           ~21     ~20, '%0A'
         44        ECHO                                                     ~21
    5    45      > JMP                                                      ->16
         46    >   FE_FREE                                                  $6
    7    47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.4 ms | 1400 KiB | 15 Q