3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo '0: '.(boolval(0) ? 'true' : 'false')."\n"; echo '42: '.(boolval(42) ? 'true' : 'false')."\n"; echo '0.0: '.(boolval(0.0) ? 'true' : 'false')."\n"; echo '4.2: '.(boolval(4.2) ? 'true' : 'false')."\n"; echo '"": '.(boolval("") ? 'true' : 'false')."\n"; echo '"string": '.(boolval("string") ? 'true' : 'false')."\n"; echo '"0": '.(boolval("0") ? 'true' : 'false')."\n"; echo '"1": '.(boolval("1") ? 'true' : 'false')."\n"; echo '[1, 2]: '.(boolval([1, 2]) ? 'true' : 'false')."\n"; echo '[]: '.(boolval([]) ? 'true' : 'false')."\n"; echo 'stdClass: '.(boolval(new stdClass) ? 'true' : 'false')."\n"; echo 'stdClass: '.(boolval("true") ? 'true' : 'false')."\n"; ?>
based on mFHVu
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
Jump found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Jump found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
Jump found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Jump found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
Jump found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Jump found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
Jump found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Jump found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
Jump found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Jump found. (Code = 43) Position 1 = 42, Position 2 = 44
Branch analysis from position: 42
Jump found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
Jump found. (Code = 43) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
Jump found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
Jump found. (Code = 43) Position 1 = 58, Position 2 = 60
Branch analysis from position: 58
Jump found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
Jump found. (Code = 43) Position 1 = 66, Position 2 = 68
Branch analysis from position: 66
Jump found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
Jump found. (Code = 43) Position 1 = 74, Position 2 = 76
Branch analysis from position: 74
Jump found. (Code = 42) Position 1 = 77
Branch analysis from position: 77
Jump found. (Code = 43) Position 1 = 84, Position 2 = 86
Branch analysis from position: 84
Jump found. (Code = 42) Position 1 = 87
Branch analysis from position: 87
Jump found. (Code = 43) Position 1 = 92, Position 2 = 94
Branch analysis from position: 92
Jump found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 94
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 86
Jump found. (Code = 43) Position 1 = 92, Position 2 = 94
Branch analysis from position: 92
Branch analysis from position: 94
Branch analysis from position: 76
Jump found. (Code = 43) Position 1 = 84, Position 2 = 86
Branch analysis from position: 84
Branch analysis from position: 86
Branch analysis from position: 68
Jump found. (Code = 43) Position 1 = 74, Position 2 = 76
Branch analysis from position: 74
Branch analysis from position: 76
Branch analysis from position: 60
Jump found. (Code = 43) Position 1 = 66, Position 2 = 68
Branch analysis from position: 66
Branch analysis from position: 68
Branch analysis from position: 52
Jump found. (Code = 43) Position 1 = 58, Position 2 = 60
Branch analysis from position: 58
Branch analysis from position: 60
Branch analysis from position: 44
Jump found. (Code = 43) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
Branch analysis from position: 52
Branch analysis from position: 36
Jump found. (Code = 43) Position 1 = 42, Position 2 = 44
Branch analysis from position: 42
Branch analysis from position: 44
Branch analysis from position: 28
Jump found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
Branch analysis from position: 36
Branch analysis from position: 20
Jump found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
Branch analysis from position: 28
Branch analysis from position: 12
Jump found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
Branch analysis from position: 20
Branch analysis from position: 4
Jump found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
Branch analysis from position: 12
filename:       /in/0aVWV
function name:  (null)
number of ops:  99
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   CAST                                         13  ~0      0
         1      > JMPZ                                                     ~0, ->4
         2    >   QM_ASSIGN                                        ~1      'true'
         3      > JMP                                                      ->5
         4    >   QM_ASSIGN                                        ~1      'false'
         5    >   CONCAT                                           ~2      '0%3A++++++++', ~1
         6        CONCAT                                           ~3      ~2, '%0A'
         7        ECHO                                                     ~3
   3     8        CAST                                         13  ~4      42
         9      > JMPZ                                                     ~4, ->12
        10    >   QM_ASSIGN                                        ~5      'true'
        11      > JMP                                                      ->13
        12    >   QM_ASSIGN                                        ~5      'false'
        13    >   CONCAT                                           ~6      '42%3A+++++++', ~5
        14        CONCAT                                           ~7      ~6, '%0A'
        15        ECHO                                                     ~7
   4    16        CAST                                         13  ~8      0
        17      > JMPZ                                                     ~8, ->20
        18    >   QM_ASSIGN                                        ~9      'true'
        19      > JMP                                                      ->21
        20    >   QM_ASSIGN                                        ~9      'false'
        21    >   CONCAT                                           ~10     '0.0%3A++++++', ~9
        22        CONCAT                                           ~11     ~10, '%0A'
        23        ECHO                                                     ~11
   5    24        CAST                                         13  ~12     4.2
        25      > JMPZ                                                     ~12, ->28
        26    >   QM_ASSIGN                                        ~13     'true'
        27      > JMP                                                      ->29
        28    >   QM_ASSIGN                                        ~13     'false'
        29    >   CONCAT                                           ~14     '4.2%3A++++++', ~13
        30        CONCAT                                           ~15     ~14, '%0A'
        31        ECHO                                                     ~15
   6    32        CAST                                         13  ~16     ''
        33      > JMPZ                                                     ~16, ->36
        34    >   QM_ASSIGN                                        ~17     'true'
        35      > JMP                                                      ->37
        36    >   QM_ASSIGN                                        ~17     'false'
        37    >   CONCAT                                           ~18     '%22%22%3A+++++++', ~17
        38        CONCAT                                           ~19     ~18, '%0A'
        39        ECHO                                                     ~19
   7    40        CAST                                         13  ~20     'string'
        41      > JMPZ                                                     ~20, ->44
        42    >   QM_ASSIGN                                        ~21     'true'
        43      > JMP                                                      ->45
        44    >   QM_ASSIGN                                        ~21     'false'
        45    >   CONCAT                                           ~22     '%22string%22%3A+', ~21
        46        CONCAT                                           ~23     ~22, '%0A'
        47        ECHO                                                     ~23
   8    48        CAST                                         13  ~24     '0'
        49      > JMPZ                                                     ~24, ->52
        50    >   QM_ASSIGN                                        ~25     'true'
        51      > JMP                                                      ->53
        52    >   QM_ASSIGN                                        ~25     'false'
        53    >   CONCAT                                           ~26     '%220%22%3A++++++', ~25
        54        CONCAT                                           ~27     ~26, '%0A'
        55        ECHO                                                     ~27
   9    56        CAST                                         13  ~28     '1'
        57      > JMPZ                                                     ~28, ->60
        58    >   QM_ASSIGN                                        ~29     'true'
        59      > JMP                                                      ->61
        60    >   QM_ASSIGN                                        ~29     'false'
        61    >   CONCAT                                           ~30     '%221%22%3A++++++', ~29
        62        CONCAT                                           ~31     ~30, '%0A'
        63        ECHO                                                     ~31
  10    64        CAST                                         13  ~32     <array>
        65      > JMPZ                                                     ~32, ->68
        66    >   QM_ASSIGN                                        ~33     'true'
        67      > JMP                                                      ->69
        68    >   QM_ASSIGN                                        ~33     'false'
        69    >   CONCAT                                           ~34     '%5B1%2C+2%5D%3A+++', ~33
        70        CONCAT                                           ~35     ~34, '%0A'
        71        ECHO                                                     ~35
  11    72        CAST                                         13  ~36     <array>
        73      > JMPZ                                                     ~36, ->76
        74    >   QM_ASSIGN                                        ~37     'true'
        75      > JMP                                                      ->77
        76    >   QM_ASSIGN                                        ~37     'false'
        77    >   CONCAT                                           ~38     '%5B%5D%3A+++++++', ~37
        78        CONCAT                                           ~39     ~38, '%0A'
        79        ECHO                                                     ~39
  12    80        NEW                                              $40     :45
        81        DO_FCALL                                      0          
        82        CAST                                         13  ~42     $40
        83      > JMPZ                                                     ~42, ->86
        84    >   QM_ASSIGN                                        ~43     'true'
        85      > JMP                                                      ->87
        86    >   QM_ASSIGN                                        ~43     'false'
        87    >   CONCAT                                           ~44     'stdClass%3A+', ~43
        88        CONCAT                                           ~45     ~44, '%0A'
        89        ECHO                                                     ~45
  13    90        CAST                                         13  ~46     'true'
        91      > JMPZ                                                     ~46, ->94
        92    >   QM_ASSIGN                                        ~47     'true'
        93      > JMP                                                      ->95
        94    >   QM_ASSIGN                                        ~47     'false'
        95    >   CONCAT                                           ~48     'stdClass%3A+', ~47
        96        CONCAT                                           ~49     ~48, '%0A'
        97        ECHO                                                     ~49
  14    98      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.2.0