3v4l.org

run code in 500+ PHP versions simultaneously
<?php $key = 12; print 'a: ' . substr((string) $key, 0, 1) . "\n"; $key = ''; print 'b: ' . substr((string) $key, 0, 1) . "\n"; $key = '_test'; print 'c: ' . substr((string) $key, 0, 1) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fEg4g
function name:  (null)
number of ops:  22
compiled vars:  !0 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 12
    3     1        CAST                                              6  ~2      !0
          2        FRAMELESS_ICALL_3                substr              ~3      ~2, 0
          3        OP_DATA                                                      1
          4        CONCAT                                               ~4      'a%3A+', ~3
          5        CONCAT                                               ~5      ~4, '%0A'
          6        ECHO                                                         ~5
    5     7        ASSIGN                                                       !0, ''
    6     8        CAST                                              6  ~7      !0
          9        FRAMELESS_ICALL_3                substr              ~8      ~7, 0
         10        OP_DATA                                                      1
         11        CONCAT                                               ~9      'b%3A+', ~8
         12        CONCAT                                               ~10     ~9, '%0A'
         13        ECHO                                                         ~10
    8    14        ASSIGN                                                       !0, '_test'
    9    15        CAST                                              6  ~12     !0
         16        FRAMELESS_ICALL_3                substr              ~13     ~12, 0
         17        OP_DATA                                                      1
         18        CONCAT                                               ~14     'c%3A+', ~13
         19        CONCAT                                               ~15     ~14, '%0A'
         20        ECHO                                                         ~15
         21      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.15 ms | 3244 KiB | 13 Q