3v4l.org

run code in 300+ PHP versions simultaneously
<?php // This should print '3' $text = '3 '; echo $text[0] . "\n"; // This should print '3' too $text = '33'; echo $text[0] . "\n"; // This should be '4' echo $text[0] + 1 . "\n"; // What about this ? $text = '9'; echo $text[0] + 1 . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6mgWU
function name:  (null)
number of ops:  18
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '3%0A'
    6     1        FETCH_DIM_R                                      ~2      !0, 0
          2        CONCAT                                           ~3      ~2, '%0A'
          3        ECHO                                                     ~3
    9     4        ASSIGN                                                   !0, '33'
   10     5        FETCH_DIM_R                                      ~5      !0, 0
          6        CONCAT                                           ~6      ~5, '%0A'
          7        ECHO                                                     ~6
   13     8        FETCH_DIM_R                                      ~7      !0, 0
          9        ADD                                              ~8      ~7, 1
         10        CONCAT                                           ~9      ~8, '%0A'
         11        ECHO                                                     ~9
   16    12        ASSIGN                                                   !0, '9'
   17    13        FETCH_DIM_R                                      ~11     !0, 0
         14        ADD                                              ~12     ~11, 1
         15        CONCAT                                           ~13     ~12, '%0A'
         16        ECHO                                                     ~13
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.32 ms | 1393 KiB | 13 Q