3v4l.org

run code in 300+ PHP versions simultaneously
<?php class beers { const softdrink = 'rootbeer'; public static $ale = 'ipa'; } $rootbeer = 'A & W'; $ipa = 'Alexander Keith\'s'; // Ceci fonctionne ; Affiche : I'd like an A & W echo "I'd like an {${beers::softdrink}}\n"; // Ceci fonctionne également ; Affiche : I'd like an Alexander Keith's echo "I'd like an {${beers::$ale}}\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NRQgT
function name:  (null)
number of ops:  14
compiled vars:  !0 = $rootbeer, !1 = $ipa
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, 'A+%26+W'
   11     1        ASSIGN                                                   !1, 'Alexander+Keith%27s'
   14     2        ROPE_INIT                                     3  ~6      'I%27d+like+an+'
          3        FETCH_R                      local               ~4      'rootbeer'
          4        ROPE_ADD                                      1  ~6      ~6, ~4
          5        ROPE_END                                      2  ~5      ~6, '%0A'
          6        ECHO                                                     ~5
   17     7        ROPE_INIT                                     3  ~11     'I%27d+like+an+'
          8        FETCH_STATIC_PROP_R          unknown             ~8      'ale'
          9        FETCH_R                      local               ~9      ~8
         10        ROPE_ADD                                      1  ~11     ~11, ~9
         11        ROPE_END                                      2  ~10     ~11, '%0A'
         12        ECHO                                                     ~10
         13      > RETURN                                                   1

Class beers: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.64 ms | 1393 KiB | 13 Q