3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ["subject" => "1"]; $json = json_encode($array); $decoded = json_decode($json, true); $subject = $decoded['subject'] ?? ''; $val = 0; if ($subject === '') { $val = 5; } echo $val;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/HfDto
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array, !1 = $json, !2 = $decoded, !3 = $subject, !4 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        INIT_FCALL                                               'json_encode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
    5     5        INIT_FCALL                                               'json_decode'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !2, $8
    7    10        FETCH_DIM_IS                                     ~10     !2, 'subject'
         11        COALESCE                                         ~11     ~10
         12        QM_ASSIGN                                        ~11     ''
         13        ASSIGN                                                   !3, ~11
    9    14        ASSIGN                                                   !4, 0
   10    15        IS_IDENTICAL                                             !3, ''
         16      > JMPZ                                                     ~14, ->18
   11    17    >   ASSIGN                                                   !4, 5
   14    18    >   ECHO                                                     !4
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.87 ms | 1395 KiB | 17 Q