3v4l.org

run code in 500+ PHP versions simultaneously
<?php $param = null; // $active evaluates to true $active = is_null($param) ? true : false; echo "Simple ternary result = $active". PHP_EOL; // $active evaluates to true $active = is_null($param) ? true : (is_string($param)? (strtolower($param) === 'true'): true); echo "Nested ternary result = $active"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
Branch analysis from position: 15
filename:       /in/gW8pk
function name:  (null)
number of ops:  30
compiled vars:  !0 = $param, !1 = $active
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, null
    4     1        TYPE_CHECK                                        2          !0
          2      > JMPZ                                                         ~3, ->5
          3    >   QM_ASSIGN                                            ~4      <true>
          4      > JMP                                                          ->6
          5    >   QM_ASSIGN                                            ~4      <false>
          6    >   ASSIGN                                                       !1, ~4
    5     7        NOP                                                          
          8        FAST_CONCAT                                          ~6      'Simple+ternary+result+%3D+', !1
          9        CONCAT                                               ~7      ~6, '%0A'
         10        ECHO                                                         ~7
    7    11        TYPE_CHECK                                        2          !0
         12      > JMPZ                                                         ~8, ->15
         13    >   QM_ASSIGN                                            ~9      <true>
         14      > JMP                                                          ->25
         15    >   TYPE_CHECK                                       64          !0
         16      > JMPZ                                                         ~10, ->23
         17    >   INIT_FCALL                                                   'strtolower'
         18        SEND_VAR                                                     !0
         19        DO_ICALL                                             $11     
         20        IS_IDENTICAL                                         ~12     $11, 'true'
         21        QM_ASSIGN                                            ~13     ~12
         22      > JMP                                                          ->24
         23    >   QM_ASSIGN                                            ~13     <true>
         24    >   QM_ASSIGN                                            ~9      ~13
         25    >   ASSIGN                                                       !1, ~9
    8    26        NOP                                                          
         27        FAST_CONCAT                                          ~15     'Nested+ternary+result+%3D+', !1
         28        ECHO                                                         ~15
    9    29      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
218.87 ms | 2224 KiB | 14 Q