3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = '$test'; $name = null; $name = !is_null($name) ?: $test; var_dump($name); echo "\n"; $name = 'name'; $name = !is_null($name) ?: $test; var_dump($name); echo "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oDJuf
function name:  (null)
number of ops:  22
compiled vars:  !0 = $test, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%24test'
    5     1        ASSIGN                                                   !1, null
    6     2        TYPE_CHECK                                    2  ~4      !1
          3        BOOL_NOT                                         ~5      ~4
          4        JMP_SET                                          ~6      ~5, ->6
          5        QM_ASSIGN                                        ~6      !0
          6        ASSIGN                                                   !1, ~6
    7     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
    8    10        ECHO                                                     '%0A'
   10    11        ASSIGN                                                   !1, 'name'
   11    12        TYPE_CHECK                                    2  ~10     !1
         13        BOOL_NOT                                         ~11     ~10
         14        JMP_SET                                          ~12     ~11, ->16
         15        QM_ASSIGN                                        ~12     !0
         16        ASSIGN                                                   !1, ~12
   12    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                                 
   13    20        ECHO                                                     '%0A'
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.3 ms | 1399 KiB | 15 Q