3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = "hello"; $b = "hi"; $val = "a"; echo $$val; // outputs "hello" echo "\n"; $val = "b"; echo $$val; // outputs "hi"
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/7BJVA
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a, !1 = $b, !2 = $val
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   ASSIGN                                                   !0, 'hello'
   3     1        ASSIGN                                                   !1, 'hi'
   5     2        ASSIGN                                                   !2, 'a'
   6     3        FETCH_R                      local               $6      !2
         4        ECHO                                                     $6
   8     5        ECHO                                                     '%0A'
  10     6        ASSIGN                                                   !2, 'b'
  11     7        FETCH_R                      local               $8      !2
         8        ECHO                                                     $8
         9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.1.0