3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = ["1", "2", "test", "", NAN, new StdClass, array(), array(1)]; foreach ($tests as $test) { echo ((bool)$test === !!$test) ? "Success\n" : "Fail\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 23
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/pG1ag
function name:  (null)
number of ops:  25
compiled vars:  !0 = $tests, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_ARRAY                                       ~2      '1'
          1        ADD_ARRAY_ELEMENT                                ~2      '2'
          2        ADD_ARRAY_ELEMENT                                ~2      'test'
          3        ADD_ARRAY_ELEMENT                                ~2      ''
          4        ADD_ARRAY_ELEMENT                                ~2      NAN
          5        NEW                                              $3      'StdClass'
          6        DO_FCALL                                      0          
          7        ADD_ARRAY_ELEMENT                                ~2      $3
          8        ADD_ARRAY_ELEMENT                                ~2      <array>
          9        ADD_ARRAY_ELEMENT                                ~2      <array>
         10        ASSIGN                                                   !0, ~2
    6    11      > FE_RESET_R                                       $6      !0, ->23
         12    > > FE_FETCH_R                                               $6, !1, ->23
    7    13    >   BOOL                                             ~7      !1
         14        BOOL_NOT                                         ~8      !1
         15        BOOL_NOT                                         ~9      ~8
         16        IS_IDENTICAL                                             ~7, ~9
         17      > JMPZ                                                     ~10, ->20
         18    >   QM_ASSIGN                                        ~11     'Success%0A'
         19      > JMP                                                      ->21
         20    >   QM_ASSIGN                                        ~11     'Fail%0A'
         21    >   ECHO                                                     ~11
    6    22      > JMP                                                      ->12
         23    >   FE_FREE                                                  $6
    8    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.19 ms | 1394 KiB | 13 Q